Commit Graph

203 Commits

Author SHA1 Message Date
Grégoire Henry
245fa66140 Shell: Split the operations list out of the (minimal) block header.
The minimal header now (classically) contains the root of a Merkle tree,
wrapping a list of lists of operations. Currently, the validator only
accept a single list of operations, but the 3+pass validator will
requires at least two lists.
2017-03-31 01:19:34 +02:00
Grégoire Henry
e273cfa07f Shell/Distributed_db: allow to precheck data. 2017-03-31 01:19:34 +02:00
Benjamin Canou
ed6e91a47d RPCs: make the result of [/blocks/X] compatible with Alpha's [/helpers/parse/block]. 2017-03-28 14:37:26 +02:00
Benjamin Canou
9872ff8b36 RPCs: make the result of [/operations/X] compatible with Alpha's [/helpers/parse/operation].
fixes #160
2017-03-28 14:37:26 +02:00
Grégoire Henry
7e1cc171cc Shell: fix unhandled exception in io_scheduler. 2017-03-28 14:37:15 +02:00
Benjamin Canou
c46950b903 Shell: repack the context every 10 commits. 2017-03-16 18:49:31 +01:00
Guillem Rieu
83f2e0dcd3 Client: switch to JSON config file and remove config-file dependency. 2017-03-16 18:49:31 +01:00
Guillem Rieu
cc44053229 RPC: add HTTP methods and Content-Type headers. 2017-03-16 18:49:31 +01:00
Arthur Breitman
76fad5a3db Economic = economique
Economical = econome
2017-03-15 08:00:53 -07:00
Grégoire Henry
826f2ea4ba P2p: implements peer swapping 2017-03-14 11:56:42 +01:00
Benjamin Canou
b5f0021016 Shell: add RPC to list network protocol versions. 2017-03-13 19:08:08 +01:00
Vincent Bernardoff
d845dc9740 Alpha: documentation of RPC wrappers. 2017-03-10 18:33:46 +01:00
Vincent Bernardoff
556c965af7 RPC server: use ~on_exn 2017-03-09 14:38:39 +01:00
Grégoire Henry
ab4015b189 Shell: fix (part of) the memory leak in validator 2017-03-09 14:38:39 +01:00
Grégoire Henry
39403e243e Shell: avoid operation leaks 2017-03-09 14:38:38 +01:00
Grégoire Henry
ccfdaa6bd0 FunView: fix recursive removal. 2017-03-09 14:38:38 +01:00
Grégoire Henry
534dc6af9d Shell: the genesis block should not flag the node as 'bootstraped' 2017-03-09 14:38:38 +01:00
Grégoire Henry
8453a69e0b Shell: no duplicates in Prevalidation 2017-03-09 14:38:38 +01:00
Vincent Bernardoff
63e5ea5e79 Client: Add "network stat" command. 2017-03-07 13:07:18 +01:00
Vincent Bernardoff
9e823c7dfb typo 2017-03-07 13:04:14 +01:00
Grégoire Henry
49392afd73 Validation: fetch new protocol on demand. 2017-03-03 18:20:38 +01:00
Benjamin Canou
015f3edff3 Shell-level commit messages and timestamps. 2017-03-03 18:20:38 +01:00
Grégoire Henry
257a3972df Shell: do not forbid to restart the node. 2017-03-02 16:19:19 +01:00
Grégoire Henry
b087042d83 Shell: do not split the validation scheduler... 2017-03-02 16:19:06 +01:00
Benjamin Canou
85055aace6 Shell: do not validate blocks that don't increase the timestamp or fitness. 2017-03-02 16:18:51 +01:00
Grégoire Henry
22e3aee362 Alphanet: remove the secret bootstrap keys 2017-03-02 16:18:09 +01:00
Grégoire Henry
768cf91cd6 Client: implements ./tezos-client bootstrapped
It wait for the node to be synchronized with the network. The heuristic
is currently:

- the timestamp of current head is less than 1 minute old ;
- there was a period of 30 seconds without new block discovered.
2017-03-02 16:17:58 +01:00
Grégoire Henry
de050bfee1 Shell: tezos-node identity should read the configuration file 2017-02-27 22:29:06 +01:00
Grégoire Henry
0b27503f30 Shell: exit properly on SIGTERM. 2017-02-27 22:28:59 +01:00
Grégoire Henry
3edace2720 Makefile: fix various dependencies errors 2017-02-27 09:49:03 +01:00
Grégoire Henry
eb89877d58 Shell: fix propagation of error in inject_block 2017-02-26 02:03:06 +01:00
Grégoire Henry
b461b6c0c6 Shell: protection against serialisation error. 2017-02-26 01:25:47 +01:00
Grégoire Henry
0b33e5a6da Shell/RPC: Implements `/block/<hash>/predecessors 2017-02-26 00:23:52 +01:00
Grégoire Henry
e88e4b0848 Shell: Proto.fitness -> Context.set_fitness.
Intead of providing a `fitness` function, an economic protocol should
now call `Context.set_fitness`.

This simplify the shell's code and avoid complexity on protocol
change. Previously the fitness of a context produced by the old protocol
had to be read by the new protocol. Now, the shell read the context
without requesting the help of the economic protocol.
2017-02-25 18:14:06 +01:00
Vincent Bernardoff
8f5f5a2106 Genesis protocol 2017-02-25 18:14:06 +01:00
Grégoire Henry
b674c538b2 Shell: refactor the distributed DB.
This refactors `src/node/shell/state.ml` in order to trace the source of
blocks and operations. This prepares the node for the three-pass
validator.

In the procces, it adds an in-memory overlay for blocks and operations.
2017-02-25 18:14:05 +01:00
Grégoire Henry
300dd5ea6d Makefile: praise the return of utop.
The Makefile is really hackish...
2017-02-25 18:14:05 +01:00
Grégoire Henry
09dcb59c14 Makefile: praise the return of utop.
The Makefile is really hackish...
2017-02-24 18:02:24 +01:00
Grégoire Henry
69ebe7d0cc Shell: minor doc improvement in RPC. 2017-02-24 16:22:56 +01:00
Grégoire Henry
bda80bf613 Shell: rename gid into peer_id 2017-02-24 16:22:56 +01:00
Vincent Bernardoff
b0ed3cefac Shell: Add RPCs for introspecting the state of the P2P layer 2017-02-24 16:22:55 +01:00
Pierre Chambart
a23d718515 Add utils/Watcher 2017-02-24 16:20:59 +01:00
Vincent Bernardoff
70491aea8c Utils: Moving_average: use int64 for total 2017-02-24 16:20:59 +01:00
Vincent Bernardoff
92c339f732 P2P: more types 2017-02-24 16:20:59 +01:00
Grégoire Henry
fc53f3b233 Switch to Base58.
Base48 was fun but... hell yeah... let's stay standard.

Public encoding of hash:

```
  Block:      "B..." (len: 51)
  Operation:  "o..." (len: 51)
  Protocol:   "P..." (len: 51)

  Ed25519:    "tz1.." (len: 36)
  Contract:   "TZ1.." (len: 36)

  NetworkdId: "id.." (len: 30)
```

Other internal prefixes (in the RPC):

```
  Hash of Michelson's expression: "expr..." (len: 54)

  Ed25519 public key: "edpk..." (len: 54)
  Ed25519 secret key: "edsk..." (len: 98)
  Ed25519 signature:  "edsig.." (len: 99)

  Hash of a random seed nonce: "nce...." (len: 53)
  Random seed:                 "rng...." (len: 53)
```
2017-02-24 15:44:21 +01:00
Vincent Bernardoff
efc6d285c6 Shell: limit known points table size
* Gc events still need to be recorded
2017-02-16 13:23:01 +01:00
Benjamin Canou
f7a70f355c Node: shutdown on an RPC server error. 2017-02-15 15:26:39 +01:00
Grégoire Henry
55e2429758 P2p: more debug traces. 2017-02-15 15:26:39 +01:00
Grégoire Henry
48da8299a6 P2p: various small fixes.
* fix bad "locking" in `p2p_io_scheduler.shutdown`
* add missing exception handler in `P2p_io_scheduler`
* wake-up `P2p.recv_any` when a new connection is established
* reintroduce version negotiation
* fix typo in greylisting
2017-02-15 15:26:39 +01:00
Vincent Bernardoff
6d41b3d38c Shell: Improve the CLI of tezos-node
* Use subcommands:
  * `tezos_node run`
  * `tezos_node config`
  * `tezos_node identity`
* Regroup all on-disk data in `--data-dir`
* Split `Node_main` in multiple files.
* Add DNS resolution for `--net-addr` and `--rpc-addr`
* Hardcode `bootstrap.tezos.com` as bootstrap peer(s)
* Add `--no-bootstrap-peers`
* Rename `--expected-connections` -> `--connections`
2017-02-15 15:26:17 +01:00
Grégoire Henry
ec0e7d4d48 Merge branch 'lwt_pipes_limit' into 'master'
Lwt_pipe: limit by content size in bytes

See merge request !137
2017-01-24 00:05:07 +01:00
Grégoire Henry
0820744619 Lwt_pipe: minor style issue 2017-01-23 23:59:16 +01:00
Grégoire Henry
b228904bc7 Node: more CLI argument 2017-01-23 22:15:36 +01:00
Grégoire Henry
2da0c83b5a P2p: postpone the first maintenance step. 2017-01-23 22:01:35 +01:00
Grégoire Henry
5ee3581d60 P2p: fix in P2p_maintenance 2017-01-23 22:01:35 +01:00
Grégoire Henry
c87e88d84d Shell: minor fix in RPC description 2017-01-23 22:01:35 +01:00
Grégoire Henry
197ac28f0b Shell: Add Cryptobox.target_of_float
[target_of_float f] is `2 ^ (256 - f)`.
2017-01-23 21:33:01 +01:00
Grégoire Henry
3a70d88fe6 Shell: animated generation of P2p.Identity 2017-01-23 21:31:30 +01:00
Grégoire Henry
5e1eddf681 Shell: Use Error_monad in Data_encoding_ezjsonm 2017-01-23 21:31:30 +01:00
Grégoire Henry
866e7add2f Shell: improve Utils 2017-01-23 21:31:30 +01:00
Vincent Bernardoff
1e4d090e2c Lwt_pipe: limit by content size in bytes 2017-01-23 18:03:00 +01:00
Grégoire Henry
52fab9528c P2p: add error for invalid authentification 2017-01-23 09:18:56 +01:00
Vincent Bernardoff
ce986c4a9c Shell: sign Ack message 2017-01-23 09:13:41 +01:00
Grégoire Henry
26ce72bc18 P2p: remove functors and rename recv into recv_any.
This allows to export the underlying `P2p_connection_pool.recv`
that will be used in the refactored distributed DB.
2017-01-19 10:26:45 +01:00
Vincent Bernardoff
e1692ed9bf Shell: use the new P2P backend 2017-01-19 10:26:45 +01:00
Grégoire Henry
d9fc93a5c0 Shell: implement P2p_{maintenance,discovery}. 2017-01-19 10:26:45 +01:00
Grégoire Henry
b694a62810 Shell: implement P2p_{connection_pool,welcome} 2017-01-19 10:26:45 +01:00
Grégoire Henry
6d47cb2c8f Shell: implement P2p_connection 2017-01-19 10:21:21 +01:00
Grégoire Henry
2ed8bf2cfa Shell: implement P2p_io_scheduler 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
7f091b38b9 Shell: add Crypto_box.Public_key_hash 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
1f7f9b369d Shell: improve Lwt_pipe 2017-01-19 10:21:21 +01:00
Vincent Bernardoff
6b3e002285 Shell: improve Lwt_utils 2017-01-19 10:21:21 +01:00
Grégoire Henry
61bea21033 Merge branch 'rpc-tls' into 'master'
Rpc tls

See merge request !128
2017-01-02 09:36:39 +01:00
Benjamin Canou
8360b4e407 RPC: fixes some comments. 2016-12-14 16:40:42 +01:00
Vincent Bernardoff
cdb34ca7d3 RPC: TLS bugfixes 2016-12-13 01:52:55 +01:00
Vincent Bernardoff
77506ac4b5 RPC: Fix doc 2016-12-13 00:45:46 +01:00
Vincent Bernardoff
42b30f7bd2 RPC: Add TLS 2016-12-13 00:45:46 +01:00
Vincent Bernardoff
01fe34bc4b Node: catch correct P2P exn 2016-12-09 18:18:59 +01:00
Vincent Bernardoff
224e5d8c73 P2P: Add counters in peer_info 2016-12-06 14:12:18 +01:00
Vincent Bernardoff
92f78b29e4 P2P: recv: return size read 2016-12-06 14:12:18 +01:00
Vincent Bernardoff
2b27a1ffbe P2P: Discovery: avoid unneeded connections 2016-12-06 14:12:18 +01:00
Vincent Bernardoff
c2249056d7 P2P: Do not send unauthenticated Advertise msgs 2016-12-06 14:12:18 +01:00
Vincent Bernardoff
6a1265255f P2P: refactor for less indenting 2016-12-06 14:12:18 +01:00
damian
517893f707 RPC: Add CORS headers 2016-12-06 13:58:21 +01:00
Benjamin Canou
e7c39578b4 Extract the js_of_ocaml compatible part of utils. 2016-12-01 18:27:53 +01:00
Benjamin Canou
69f682357f Add hooks to the RPC server to handle static files. 2016-12-01 15:52:31 +01:00
Vincent Bernardoff
1ffe2db277 P2P: Minor changes 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
bdb2d20f05 P2P: Introduce a worker dedicated to user events 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
a832c2069f P2P: Do not log ``ordinary'' errors 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
e1d6df6e99 P2P: Do not accept unauthenticated Advertise msgs 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
5f8b74e96c P2P: Cancel MA computations on client disconnect 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
158447416b Shell: Count sent and received bytes in P2p. 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
56a58cc962 Shell: use bounded Lwt_pipe in P2p 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
dc2084d993 Shell: export P2p.gid 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
41d5bbe989 Shell: Use some Error_monad in P2p 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
d41c05a066 Shell: minor rewording in P2p 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
fdff344989 Shell: minor cosmetics in p2p.ml 2016-12-01 13:52:05 +01:00
Vincent Bernardoff
bc7f4b48e2 RPC: launch: remove unused argument 2016-11-29 16:41:17 +01:00
Grégoire Henry
2a43eeaa7f P2P: properly handle End_of_file. 2016-11-26 11:49:07 +01:00
Grégoire Henry
17475aa743 Shell: switch to Blake2b (closes #87 #89)
Also drop the dependencies on Cryptokit.
2016-11-25 19:46:50 +01:00