Commit Graph

992 Commits

Author SHA1 Message Date
Grégoire Henry
d417a679e6 Alpha/test: fix symbolic link 2018-02-11 19:17:38 +01:00
Grégoire Henry
f6b55fa46d Test: fix manual execution of ./test-basic.sh 2018-02-11 19:17:38 +01:00
Grégoire Henry
0e675c2d16 Client refactor: add calling function in Worker_services 2018-02-08 17:23:30 +01:00
Grégoire Henry
1858bdd852 Client refactor: Move Client_node_rpcs into Shell_services 2018-02-08 17:23:30 +01:00
Grégoire Henry
21789be756 Client refactor: Move Client_node_rpcs.Protocols into Protocols_services 2018-02-08 17:23:30 +01:00
Grégoire Henry
37e65d93e7 Client refactor: Move Client_node_rpcs.Network into P2p_services 2018-02-08 17:23:30 +01:00
Grégoire Henry
02c2035e93 Client refactor: Move Client_node_rpcs.Block into Block_services 2018-02-08 17:23:30 +01:00
Grégoire Henry
db500b5ebd RPC_service: hide the 'error type parameter 2018-02-08 17:23:30 +01:00
Grégoire Henry
5c2ba214f0 Client refactor: Move handling of unix error from Error_monad to stdlib-unix 2018-02-08 17:23:30 +01:00
Grégoire Henry
41d30777a6 Client refactor: remove Utils.read_file... 2018-02-08 17:23:30 +01:00
Grégoire Henry
1f0c10bc6f Client refactor: Rename stdlib-lwt into stdlib-unix 2018-02-08 17:23:30 +01:00
Grégoire Henry
484b5b5b08 Client refactor: move stdlib_lwt out of base 2018-02-08 17:23:30 +01:00
Grégoire Henry
84d8ae9222 Client refactor: Move Data_encoding_ezjsonm.read_file into Lwt_utils_unix 2018-02-08 17:23:30 +01:00
Grégoire Henry
24c6f4ea98 Client refactor: Move Lwt_utils_unix.protect into Error_monad 2018-02-08 17:23:30 +01:00
Grégoire Henry
7dc52dcf10 Client refactor: Move Lwt_Exit into base 2018-02-08 17:23:30 +01:00
Grégoire Henry
27ae0591b1 Client refactor: Move Cli_entries into base 2018-02-08 17:23:30 +01:00
Grégoire Henry
8c58d7a610 Client refactor: Move non-unix part of Data_Encoding_Ezjsonm into Data_Encoding.Json 2018-02-08 17:23:30 +01:00
Grégoire Henry
c55181273c Client refactor: Move non-unix depend modules of stdlib-lwt into stdlib 2018-02-08 17:23:29 +01:00
Grégoire Henry
154b932713 Client refactor: Remove usage of Lwt_unix from Lwt_dropbox 2018-02-08 17:23:29 +01:00
Grégoire Henry
8f7f205031 Client refactor: Remove usage of Lwt_unix from Lwt_pipe 2018-02-08 17:23:29 +01:00
Grégoire Henry
7a3277e625 Client refactor: Move part of Logging into Logging_unix 2018-02-08 17:23:29 +01:00
Grégoire Henry
f61eed1a67 Client refactor: move part of Lwt_utils in Lwt_utils_unix 2018-02-08 17:23:29 +01:00
Grégoire Henry
f22b3576d2 Client refactor: simpler dependencies in tezos-crypto 2018-02-08 17:23:29 +01:00
Grégoire Henry
2f295a3af8 P2p: less types in lib_base
Let's only have types required for the RPCs.
2018-02-08 17:23:29 +01:00
Marco Stronati
67ac4d8f5c Protocol: change external to val in zarith protocol env 2018-02-08 15:28:32 +00:00
Marco Stronati
3ca9a081f9 Locator: added extended test with benchmark 2018-02-08 15:18:11 +00:00
Marco Stronati
d05dceb0b0 State: export predecessor_n 2018-02-08 15:18:10 +00:00
Marco Stronati
f8e69ac8f5 Locator: added test for size 0 and size larger than chain 2018-02-08 15:18:09 +00:00
Marco Stronati
0890034575 State: removed old linear predecessor 2018-02-08 15:18:09 +00:00
Marco Stronati
f62ce16e5c Locator: rewrote compute to use efficient predecessor from state 2018-02-08 15:18:09 +00:00
Marco Stronati
95a4ede273 State: added function to get predecessor at any distance 2018-02-08 15:18:08 +00:00
Marco Stronati
738310df62 State: added a function to populate the predecessors storage 2018-02-08 15:18:08 +00:00
Marco Stronati
eaf2103967 Storage: added a dedicated store for predecessors under /block/ 2018-02-08 15:18:08 +00:00
Benjamin Canou
75f4946072 Alpha: remove unused function 2018-02-07 12:24:01 +01:00
Grégoire Henry
acffadafae Jbuilder: fix warning 2018-02-07 11:16:39 +01:00
Vincent Bernardoff
e1d1292c09 Crypto: drop libsodium
We now use simpler OCaml bindings much easier to review.
2018-02-07 11:16:39 +01:00
Benjamin Canou
8bec8b7b9c Michelson: add isolate test for big maps 2018-02-06 17:04:49 +01:00
Benjamin Canou
5ae24aa7a3 Scripts: repair tezos-autocomplete, and make it work with emacs and zsh 2018-02-06 17:04:49 +01:00
Benjamin Canou
0352278621 Emacs: repair Michelson parsing error reporting 2018-02-06 17:04:49 +01:00
Milo Davis
79472c727a Michelson: introducing big maps, limited edition
Quick and dirty (yet safe, of course) implementation of lazily
  deserialized maps for storing large collections of indexed data.

  Only one big_map is allowed, as the left component of the toplevel
  storage pair.

  Review and bugfixes: Benjamin Canou <benjamin@canou.fr>
2018-02-06 17:00:54 +01:00
Benjamin Canou
3d0ec5deb4 Michelson: remove instruction MAP on sets 2018-02-06 16:32:30 +01:00
Grégoire Henry
575e367026 Update copyright notice (2018) 2018-02-05 23:34:05 +01:00
Grégoire Henry
e28219ad60 Opam: update to jbuilder.1.0+beta17 2018-02-05 23:34:05 +01:00
Grégoire Henry
c4c375dfc2 Proto_alpha/test: module renaming 2018-02-05 23:34:05 +01:00
Grégoire Henry
c6bf7d78b6 Proto_alpha/test: split tests. 2018-02-05 23:34:05 +01:00
Grégoire Henry
7929027793 Proto/test: do not depend on shell
For the test suite we only use the in-memory context.
2018-02-05 23:34:05 +01:00
Grégoire Henry
a6ab12e701 Context: add an alternative in-memory only implementation 2018-02-05 23:34:05 +01:00
Grégoire Henry
971c3c4b21 Refactor: move Registred_protocol from State to Tezos_updater 2018-02-05 23:34:05 +01:00
Grégoire Henry
2498da2815 Protocol_environment: more sharing between node and client 2018-02-05 23:34:05 +01:00
Grégoire Henry
dffa65f648 Test: add test dependencies into *.opam and fix .gitlab-ci.yml 2018-02-05 23:34:05 +01:00
Grégoire Henry
0166f2325e Test: move test into src/bin_client/test 2018-02-05 23:34:05 +01:00
Grégoire Henry
f7668c3799 Test: move test/proto_alpha into proto_alpha/lib_client/test 2018-02-05 23:34:05 +01:00
Grégoire Henry
4d5e55595b Test: split test/shell into src/lib_{storage,shell} 2018-02-05 23:34:05 +01:00
Grégoire Henry
868514af2b Test: move test/proto_alpha_isolate into proto_alpha/lib_protocol/test 2018-02-05 23:34:05 +01:00
Grégoire Henry
14d902a3fc Test: split out test/{p2p,utils} in various package dir 2018-02-05 23:34:05 +01:00
Grégoire Henry
6205ca9b31 Test: move data_encoding tests 2018-02-05 23:34:04 +01:00
bruno
ffe41a003c Michelson: add comments + registration for "Transfer in DIP" 2018-02-05 15:57:15 +01:00
bruno
ff7a8abb27 Michelson: mv registration of type-checking errors in a specific file 2018-02-05 15:49:30 +01:00
bruno
21c4cc6e69 Michelson: add registration for Overflow + some comments 2018-02-05 15:06:00 +01:00
bruno
75f29f4a05 Michelson: mv typechecking error definitions to a separate file 2018-02-05 14:58:19 +01:00
Grégoire Henry
d8151c0d00 Proto/alpha: use two operations list (endorsement / others) 2018-02-02 11:56:57 +01:00
Grégoire Henry
a1122f2083 Baking: handle validation passes 2018-02-02 11:56:57 +01:00
Grégoire Henry
09a7e98f9d Shell: enforce the allowed passes of an operation 2018-02-02 11:56:57 +01:00
Grégoire Henry
618a43b485 Proto: export acceptable_passes 2018-02-02 11:56:54 +01:00
Grégoire Henry
ae3ff0503b Proto: the number of validation is now a protocol constant 2018-02-02 10:27:58 +01:00
Benjamin Canou
42023753a2 Client: add signer modules documentation 2018-02-01 23:16:13 +01:00
Vincent Bernardoff
4ffb00ffde Client: segregate signing 2018-02-01 23:16:13 +01:00
Vincent Bernardoff
95ccd34864 Client: remove useless argument 2018-02-01 22:11:46 +01:00
Gabriel Alfour
aeb910b9f9 Utils: add a few primitives 2018-02-01 16:57:07 +01:00
Benjamin Canou
efef124261 Fix typo in tezos-protocol-compiler.opam 2018-01-31 23:27:53 +01:00
Benjamin Canou
0863a2a9e4 Docs: add online help pages for the client 2018-01-31 14:51:56 +00:00
Benjamin Canou
6063f67992 Client: restore automatic verbosity in man 2018-01-31 14:51:55 +00:00
Benjamin Canou
329e13cefa Client: add quick and dirty HTML output for man to produce online help pages 2018-01-31 14:51:54 +00:00
Benjamin Canou
f86438c56a Client: better verbosity levels in help pages 2018-01-31 14:51:54 +00:00
Benjamin Canou
2178a6adee Client: cleanup / homogeneize command docs 2018-01-31 14:51:54 +00:00
Benjamin Canou
02bc0533fa Client: add placeholders for arguments in help screens 2018-01-31 14:51:53 +00:00
Benjamin Canou
3955b6a61d Client: add colors to client help screens 2018-01-31 14:51:52 +00:00
Grégoire Henry
de80f0150b Compiler: allow bytecode compilation 2018-01-31 14:45:32 +00:00
Milo Davis
d1b4230962 Michelson: export and printing for Duplicate_field error 2018-01-31 14:06:35 +01:00
Milo Davis
695b23bd92 Michelson: export and printing for Type_too_large error 2018-01-31 11:25:50 +00:00
Grégoire Henry
8dcc5cefb5 jbuild: fix installation of tezos-protocol-alpha 2018-01-30 14:55:04 +01:00
Grégoire Henry
4b142184fa opam: fix tezos-client-base dependencies 2018-01-30 12:23:38 +01:00
Grégoire Henry
657e214e83 Refactor: rename tezos-client-environment into tezos-protocol-environment-client 2018-01-30 11:54:57 +01:00
Grégoire Henry
ca29c92442 Refactor: move tezos-micheline below tezos-base 2018-01-30 11:47:57 +01:00
Grégoire Henry
f2de3ffa3e Proto_sigs: split the deprecated module Hash 2018-01-30 11:25:52 +01:00
Grégoire Henry
04465e3ac6 Proto_sigs: split the deprecated module Tezos_data 2018-01-30 11:25:46 +01:00
Grégoire Henry
70a4fbac3a Refactor: rename package tezos-embedded-client-* -> tezos-client-* 2018-01-30 10:13:40 +01:00
Grégoire Henry
fda8b4ee5f Refactor: rename prota_alpha/lib_proto 2018-01-30 10:13:40 +01:00
Grégoire Henry
c75756bd6d Refactor: introduce lib_client_environment
This allow to use the functorised version of the protocol in the
client.
2018-01-30 10:13:40 +01:00
Grégoire Henry
acc0c5c512 Compiler: allow not to generate Registerer 2018-01-30 10:13:40 +01:00
Grégoire Henry
0c2acd2d48 RPC: simplify Worker.EVENT 2018-01-30 10:13:40 +01:00
Grégoire Henry
e664179927 Refactor: CI: check opam packages 2018-01-30 10:13:40 +01:00
Grégoire Henry
1d5b4c1e3b Refactor: merge lib_p2p_services into lib_shell_services
Also split the module `Shell_services` in smaller modules.
2018-01-30 10:13:40 +01:00
Grégoire Henry
7277c9889b Refactor: Move/split P2p_types into lib_base 2018-01-30 10:13:40 +01:00
Grégoire Henry
be9f068478 Refactor: More PRC types into Tezos_base 2018-01-30 10:13:40 +01:00
Grégoire Henry
c4420ac40e Refactor: Move Blake2B.Make instanciation into Tezos_base 2018-01-30 10:13:40 +01:00
Grégoire Henry
b0466aceed Refactor: Fix lib_protocol_updater dependencies 2018-01-30 10:13:40 +01:00
Grégoire Henry
96e493006c Refactor: Rename lib_node_updater -> lib_protocol_updater 2018-01-30 10:13:40 +01:00
Grégoire Henry
96fe5239c9 Refactor: Rename lib_node_shell -> lib_shell 2018-01-30 10:13:40 +01:00
Grégoire Henry
58388bd304 Refactor: Merge lib_node_shell_base/lib_node_services} -> lib_shell_services 2018-01-30 10:13:40 +01:00
Grégoire Henry
552237673e Refactor: Move Mempool and Block_locator into lib_base 2018-01-30 10:13:26 +01:00
Grégoire Henry
4acdfc67fb Refactor: Remame lib_node_p2p/p2p_base into lib_p2p/p2p_services 2018-01-30 10:13:26 +01:00
Grégoire Henry
e0a2570988 Refactor: Rename Node_rpc_services.Network into P2p_services 2018-01-30 10:12:55 +01:00
Grégoire Henry
1f3c68cbd8 Refactor: Regroup protocols 2018-01-30 10:12:55 +01:00
Grégoire Henry
a3d0ee644a Refactor: Rename lib_rpc_base -> lib_rpc 2018-01-30 10:12:55 +01:00
Grégoire Henry
66fb1811ae Opam: add missing dep in tezos-node-shell-base 2018-01-28 20:02:51 +01:00
Milo Davis
f00c7c0667 Data encoding: fail on string_enum that should be a constant 2018-01-27 15:30:09 +01:00
Milo Davis
c77cbcb30b Data_encoding: use constant from ocplib-json-typed 2018-01-27 15:30:09 +01:00
Grégoire Henry
ea500256f0 P2p: tentative fix for #98 2018-01-27 15:30:09 +01:00
Grégoire Henry
e7483ff392 Opam: new release of ocp-ocamlres 2018-01-27 14:55:57 +01:00
Grégoire Henry
0c51f7a7ca Proto: Fix warning 2018-01-27 13:37:03 +01:00
Grégoire Henry
a30f20c4e3 Base: remove Lwt_utils.canceler
It has been replaced by `Lwt_canceler`
2018-01-27 13:35:47 +01:00
Benjamin Canou
9060122b26 Node: only validate branches that can increase the current head's fitness
And also make the check when processing new head increments. That way
we prevent spamming with valid head successors that bear the same
fitness.
2018-01-27 13:34:02 +01:00
Benjamin Canou
41ad73a3ed Utils: remove Lwt_utils.queue 2018-01-27 13:34:02 +01:00
Benjamin Canou
6f34b85504 RPC: net validator worker introspection 2018-01-27 13:34:02 +01:00
Benjamin Canou
0779221d04 Node: switch the net validator to Tezos_worker 2018-01-27 13:34:02 +01:00
Benjamin Canou
e5405c2f72 RPC: peer validator worker introspection 2018-01-27 13:34:02 +01:00
Benjamin Canou
ecbf1805e1 Node: switch the peer validator to Tezos_worker 2018-01-27 13:34:02 +01:00
Benjamin Canou
50b1957714 RPC: block validator worker introspection 2018-01-27 13:34:02 +01:00
Grégoire Henry
6d3f5af163 Node: switch the block validator to Tezos_worker 2018-01-27 13:34:02 +01:00
Benjamin Canou
4e04e233a0 RPC: prevalidator worker introspection 2018-01-27 13:34:02 +01:00
Benjamin Canou
98ec3393b6 Node: switch the prevalidator to Tezos_worker 2018-01-27 13:34:02 +01:00
Benjamin Canou
d50402c27b Introduce Tezos_shell.Worker 2018-01-27 13:34:02 +01:00
Benjamin Canou
4d197b4ba3 Node: document an internal prevalidator error 2018-01-27 12:43:37 +01:00
Benjamin Canou
cd94b998c0 Node: throttle advertisement of newly discovered operations a little bit 2018-01-27 12:43:37 +01:00
Benjamin Canou
755d63c0ef Node: limit the refused operations cache in the prevalidator 2018-01-27 12:43:37 +01:00
Benjamin Canou
0652808259 Shell: refactoring of the prevalidator 2018-01-27 12:43:37 +01:00
Benjamin Canou
566a92197b Get rid of forced operation injection 2018-01-27 12:43:37 +01:00
Benjamin Canou
dee86fb462 Utils: add Lwt_pipe.pop_with_timeout 2018-01-27 12:43:37 +01:00
Benjamin Canou
9b09e70f5e Utils: add Ring.clear 2018-01-27 11:33:30 +01:00
Benjamin Canou
bb90cc9dec Utils: add Lwt_pipe.peek_all 2018-01-27 11:33:30 +01:00
Benjamin Canou
2441ad6026 Utils: add Ring.add_and_return_erased 2018-01-27 11:33:30 +01:00
Benjamin Canou
f145c4b196 Utils: add Lwt_pipe.pop_all_now 2018-01-27 11:33:30 +01:00
Benjamin Canou
cfd5151279 Alpha: fix colliding JSON schema definitions 2018-01-27 11:33:30 +01:00
Grégoire Henry
6e629584ff Jbuilder: fix rule runtest_indent 2018-01-27 11:32:57 +01:00
Milo Davis
545cd0c869 Client: commands to update config file 2018-01-25 23:22:59 +01:00
Milo Davis
937869da43 Client: split admin/debug commands into separate executable 2018-01-25 15:57:20 +00:00
Milo Davis
c98426fb02 Debug: unmark invalid block 2018-01-25 15:57:20 +00:00
Pietro
df746e606d Indent: reindent with ocp-indent and fix the script 2018-01-25 15:01:12 +00:00
Grégoire Henry
bd8eaddc8c Resto: properly handle text/ocaml.exception. 2018-01-25 12:33:13 +01:00
Milo Davis
00f7a0ea87 RPC: improves error handling for exceptions on generic RPCs 2018-01-25 12:33:13 +01:00
Pietro
4109adfd77 Node: properly report RPC port already in use, fixes #69 2018-01-24 18:28:19 +01:00
Bruno B
ce35bc5346 Michelson: light refactoring of equality witnesses 2018-01-23 13:35:48 +00:00
Benjamin Canou
adf860ea40 Docs: new documentation structure using Sphinx/RST
- Provides a toplevel documentation structure using Sphinx
 - Adds a `doc-html` target to the main Makefile
 - Converts existing documentation to RST format
 - Add some new documentation / tutorials
 - Links the developer manual and OCaml documentation
 - Synchronized documentation on Gitlab pages

This patch is co-authored by:
 - Benjamin Canou <benjamin@canou.fr>
 - Bruno Bernardo <bernardobruno@gmail.com>
 - Pietro Abate <pietro.abate@inria.fr>
2018-01-23 08:02:17 +01:00
Benjamin Canou
64c65558d8 Node: add missing error pretty printers 2018-01-22 22:25:30 +01:00
Pietro
2f85dc526d Node: fails gracefully if data dir cannot be created, fixes #83 2018-01-22 22:25:30 +01:00
Grégoire Henry
0abdb2a893 Minor renaming. 2018-01-22 09:20:53 +01:00
Grégoire Henry
bfb2d223c0 opam: fix sandboxed scripts 2018-01-22 09:20:46 +01:00
Milo Davis
fbeff067c3 lib_RPC: bonary -> binary 2018-01-21 16:27:16 +00:00
Milo Davis
6e56b7b5e7 Client: Typo in michelson error reporting 2018-01-19 13:59:09 +01:00
Milo Davis
4433395c6e Proto/Env: export the Option module 2018-01-19 13:59:04 +01:00
Milo Davis
b8063b40fe Storage: add omitted case to storage_error_encoding 2018-01-19 13:59:01 +01:00
Grégoire Henry
525b09259f Fix d9405292a4 2018-01-18 16:08:20 +01:00
Vincent Bernardoff
e6f773f697 Base58: encode secret keys as seed 2018-01-18 10:45:47 +01:00
Pietro
d9405292a4 Move all packages to src/
Modify Makefile accordingly
2018-01-16 23:11:39 +01:00
Grégoire Henry
82857dcb94 Jbuilder: split lib_node_net
- `lib_node_p2p_base`: Base datatypes for the P2P layers
- `lib_node_services`: RPC service definitions (depends on `node_p2p_base`)
- `lib_node_http`: RPC http server
- `lib_node_p2p`: the P2P workers
2017-12-04 19:15:26 +01:00
Grégoire Henry
ab5b597eb1 Jbuilder: Move client & node libraries in their own OPAM packages 2017-12-04 19:15:26 +01:00
Grégoire Henry
9cb498eee6 Jbuilder: Move alpha/genesis/demo in their own two OPAM packages
One package for the embedded version. One for the functorized one.
2017-12-04 16:05:54 +01:00
Grégoire Henry
78d838059f Jbuilder: move protocol-compiler in its own OPAM package 2017-12-04 16:05:54 +01:00
Grégoire Henry
e24b1dda75 Jbuilder: move protocol_environment_sigs in its own OPAM package 2017-12-04 16:05:54 +01:00
Grégoire Henry
92d166175f Jbuilder: move Micheline in its own OPAM package 2017-12-04 16:05:54 +01:00
Grégoire Henry
b6449cae87 Jbuilder: split src/utils/ in multiple OPAM packages
* `lib_stdlib`: basic extended OCaml stdlib and generic data structures

* `lib_data_encoding`: almost independant 'Data_encoding'
* `lib_error_monad`: almost independant 'Error_monad'

* `lib_stdlib_lwt`: extended Lwt library
* `lib_crypto`: all the crypto stuff (hashing, signing, cryptobox).

* `lib_base`:
  - basic type definitions (Block_header, Operation, ...)
  - a module `TzPervasives` to bind them all and to be the
    single module opened everywhere.

In the process, I splitted `Tezos_data` and `Hash` in multiple
submodules, thus removing a lot of `-open`.

The following two modules may not have found their place yet:
- Base58 (currently in `lib_crypto`)
- Cli_entries (currently in `lib_stdlib_lwt`)
2017-12-04 16:05:54 +01:00
Grégoire Henry
5b50279851 Import new version of vendors/ocplib-resto
The new version of ocplib-resto :

- uses jbuilder ;
- is functorized over `Json_encoding` rather than `Json_repr` ;
- handles query parameters ;
- handles HTTP methods (GET, POST, DELETE, PUT, PATCH) ;
- replaces `custom_service` by a more generic trailer argument ;
- replaces generic answer `(code, body)` by a more ad-hoc sum type
  (allowing distinct encoding for success and error) ;
- includes a minimal HTTP-server based on Cohttp
  (includings CORS and media type negotiation).
- adds a function `Directory.transparent_lookup` to lookup/call
  a service handler without serializing the various parameters
  (path, query, request body).

As a first consequences in Tezos, this patch allows binary
communication between the client and the node.

This patch tries to be minimal inside the tezos source code and
therefore it introduces a minimal compatibility layer in
`RPC.ml`. This code should be removed as soon as possible.
2017-12-04 15:51:59 +01:00
Pierre Chambart
6c679d2e2c Michelson: compute depth for type size check
This allows to ensure that the depth to look at is updated when
michelson is.
2017-12-02 23:02:50 +00:00
Pierre Chambart
fedeb6c8fd Michelson: enforce a maximum stack item type size 2017-12-02 23:02:50 +00:00
Milo Davis
b4495568cb Fixes OSX select exception
This patch is primarily authored by @chambart
2017-11-30 14:50:36 +01:00
Benjamin Canou
97d983285e Node: allow identity.json to stay when clearing the data-dir 2017-11-28 17:28:56 +01:00
Benjamin Canou
e91f5bc588 Node: Cleanup a few error messages. 2017-11-28 15:43:58 +01:00
Benjamin Canou
606c6e55e4 Node: update shutdown order to prevent some leveldb read errors. 2017-11-28 15:43:47 +01:00
Pietro Abate
6e68fb425a Fix #66 and #59 2017-11-27 17:26:36 +01:00
Grégoire Henry
8f30934220 Validator: always log invalid block 2017-11-27 10:40:43 +00:00
Grégoire Henry
471006b2dd Validator: properly handle termination of Block_validator. 2017-11-27 10:40:43 +00:00
Grégoire Henry
10d1b08c85 Validator: do not try to validate twice an invalid block 2017-11-27 10:40:42 +00:00
Milo Davis
7bed296525 Client: stuck node debug command 2017-11-27 10:40:42 +00:00
Benjamin Canou
61f7a95102 RPCs: fix encoding of list_invalid RPC 2017-11-27 10:40:41 +00:00
Milo Davis
9f45ae9126 Node: listing of invalid blocks 2017-11-27 10:40:41 +00:00
Milo Davis
42e29c8f4a Node: allow invalid block errors to be stored 2017-11-27 10:40:40 +00:00
Milo Davis
059e4cac79 Fix spelling mistake 2017-11-27 10:40:39 +00:00
Grégoire Henry
c6b4a83e2b Reset the chain. 2017-11-26 22:49:20 +00:00
Grégoire Henry
667d4fd575 Alphanet: never more than 5 faucet operations per block 2017-11-26 22:49:20 +00:00
Grégoire Henry
a648c34f0a Alphanet: let the number of rolls never reach 100000.
This is a hack! This is a possible mitigation for the 'faucet war'.
2017-11-26 22:49:19 +00:00
Grégoire Henry
7bd5ef32d9 Alpha: better spreading of roll storage
This greatly reduces the time spent reading roll, while it only
slightly increase the time spent while 'freezing' rolls at the end of
a cycle.
2017-11-26 22:49:18 +00:00
Grégoire Henry
485d8bc26a Context: quick-and-dirty leveldb backend for Irmin
This is a dirty and non-optimized backend, it is still faster than the
current git backend.

Main drawbacks:
- the leveldb binding is non-coopertive, the node will
  block while committing a block to the disk ;
- the leveldb use 'string' while internally we use 'cstruct',
  this implies a lot of time-consuming 'memcpy'.
2017-11-26 22:49:17 +00:00
Grégoire Henry
3fcc6df975 Alpha: use recursive removal when possible 2017-11-26 22:49:16 +00:00
Benjamin Canou
450d0dba4e Client: remove trace of the web client. 2017-11-26 23:32:04 +01:00
Pietro Abate
b4573fb323 Client: duplicates results in list versions. 2017-11-26 23:31:58 +01:00
Pietro Abate
4c30016af3 Client: add -protocol to the client command line. 2017-11-26 23:30:38 +01:00
Milo Davis
f2c27c78ab Fixes Github issue #141 (no implementation of EndianBigstring) 2017-11-22 16:07:05 +00:00
Grégoire Henry
f9e6831363 Shell: enforce maximum operation size 2017-11-20 05:03:00 +01:00
Grégoire Henry
84a2f1ee29 Shell: enforce the maximum number of operation per block 2017-11-20 05:03:00 +01:00
Grégoire Henry
3c06879deb Shell: add Error_monad.{iter2_p,iteri2_p} 2017-11-20 04:57:09 +01:00
Grégoire Henry
06a6cf5b9a Proto: allow to update 'max_number_of_operations'
The constant is now defined per block and not per protocol.
Also allows to set a limit per validation pass.
2017-11-20 04:57:09 +01:00
Grégoire Henry
13dd470d06 More renaming: 'mine' -> 'bake' 2017-11-20 04:27:27 +01:00
Grégoire Henry
42681dfea5 Jbuilder: better error reporting 2017-11-20 01:21:54 +01:00
Benjamin Canou
ac62538eb6 Alpha: remove some fixme and assert false 2017-11-17 15:54:36 +01:00
Grégoire Henry
17644e0fa3 Proto: reimplements Storage_functors with iterable indexes
The new `Storage_functors` is now a "functional" equivalent of the
"imperative" `Store_helpers` used in the shell.
2017-11-17 15:54:36 +01:00
Grégoire Henry
b6b59be5fd Jbuilder: minor improvement in error reporting. 2017-11-17 15:54:36 +01:00
Grégoire Henry
a7364f0ed5 Proto_env: remove Context.list
This was a reminder of old-time (before irmin-1.0). It is now replaced
with: `Context.{fold,keys}`.
2017-11-17 15:54:36 +01:00
Grégoire Henry
49b7db258d Move Persist from the shell to the protocol.
It is not used anymore in the shell.
2017-11-17 15:54:36 +01:00
Benjamin Canou
1d357587d0 Node: register error Validator.Inactive_network 2017-11-17 14:13:55 +01:00
Grégoire Henry
659d1aa63a Shell: remove unrequired net_id from network messages 2017-11-17 14:13:55 +01:00
Grégoire Henry
178d839ee1 Shell: remove net_id from the block header. 2017-11-17 14:13:55 +01:00
Grégoire Henry
b7deebaf42 Shell: Remove net_id from the operation header.
The `branch` of the operation contains enough information to induce
the `net_id`, and the code of the validator/prevalidator is now mature
enough to efficiently determine the `net_id` of an incoming operation.
2017-11-17 14:13:55 +01:00
Grégoire Henry
4d2bc49960 Shell: memorize the current list of live blocks and operations 2017-11-17 14:13:55 +01:00
Grégoire Henry
1d71ea5718 Fix docstring attachment 2017-11-17 14:13:55 +01:00
Grégoire Henry
6a00c55c4e Shell: add docstrings for the validator. 2017-11-17 14:13:55 +01:00
Grégoire Henry
119f724e64 Mempool: also broadcast 'branch_{delayed,refused}' operations 2017-11-17 14:13:55 +01:00
Grégoire Henry
3e39f82bee Shell/baker: inline full operation contents in RPC. 2017-11-17 14:13:55 +01:00
Grégoire Henry
1163c19213 Shell: add configuration variable for various timeouts. 2017-11-17 14:13:55 +01:00
Grégoire Henry
910b43726b Shell: add CLI options for bootstrap_threshold 2017-11-17 14:13:55 +01:00
Grégoire Henry
f3555488c7 Shell: use one 'validation worker' per peer.
The single validation module is split in multiple (simpler)
modules. In the process, we introduce one "validation worker" per
peer. This worker handle all the `New_head` and `New_branch`
advertised by a given peer. For so, it sends "fetching request" and
"validation request" to respectively the `Distributed_db` and and the
`Block_validator`. These two global workers are responsible of the
'fair' allocation of network and CPU ressources amongst the connected
'peers'.
2017-11-17 14:13:55 +01:00
Grégoire Henry
c5b5a87ab7
P2p: add regression test for oversized message 2017-11-17 13:46:27 +01:00
Grégoire Henry
529795efd7
Reset the chain 2017-11-17 02:51:39 +01:00
Grégoire Henry
72c414aaeb
P2p: fix bound checks
Credit to `tomjack` on freenode.
2017-11-17 01:58:41 +01:00
Pietro Abate
472f1d53d1 Some docstrings in src/proto/alpha 2017-11-15 13:14:37 +01:00
Pietro Abate
3e1c4008c3 Add docstrings in src/environment/v1/ 2017-11-15 13:14:16 +01:00
Grégoire Henry
1429a6c8e6 Almost too late for copyright update. 2017-11-15 13:13:16 +01:00
Grégoire Henry
b810b360ea Add missing copyright headers. 2017-11-15 13:11:11 +01:00
Benjamin Canou
94295fa281 Micheline: resilient parser for better error reporting 2017-11-15 11:57:37 +00:00
Pietro Abate
102ba49149 Proto: Rename Public_key to Delegates_pubkey 2017-11-14 16:56:15 +01:00
Pietro Abate
de8967540f Proto: store the public key of the manager in the contract 2017-11-14 16:56:15 +01:00
jevonearth
e37974c64f Spelling and consistency fixes
From doing a quick grep, the rest of the code-base tends to hyphenate
the term 'hard-coded'.
2017-11-14 00:22:19 +01:00
jevonearth
e9d1dbcce1 Spelling fixes and grammar improvements 2017-11-14 00:22:19 +01:00
jevonearth
f4937fd8ef Change data dir error messages to use present tense 2017-11-14 00:22:19 +01:00
Grégoire Henry
44364295ee Jbuilder: use --dev for running test and other minor improvments 2017-11-14 00:12:40 +01:00
Pietro Abate
6ecfca9396 Reindent all files
Now `make test` fails when sources are not indented correctly, the
indentation test is also executed in the CI.
2017-11-13 23:13:34 +01:00
Milo Davis
32a466556e Jbuilder: use --dev option 2017-11-13 22:30:35 +01:00
Benjamin Canou
6a38f76956 Reset the chain. 2017-11-13 22:18:17 +01:00
Benjamin Canou
42734ee4a2 Node: Make sure fatal errors are properly printed 2017-11-13 22:18:16 +01:00
Benjamin Canou
602a10651c Prevalidator: log_debug canceled operation fetches 2017-11-13 22:18:16 +01:00
Benjamin Canou
d5a2bd9604 Distributed_db: register new internal errors 2017-11-13 22:17:56 +01:00
Grégoire Henry
6cb428c1a2 Utils/Data_encoding: add missing case in merge_objs. 2017-11-13 11:04:17 +00:00
Grégoire Henry
5beb62c83e P2p: more debug in P2p_connection. 2017-11-13 11:04:17 +00:00
Grégoire Henry
d866b1bfa5 Distributed_db: add primitive for sending 'message'. 2017-11-13 11:04:17 +00:00
Grégoire Henry
e98e175c21 Lwt_pipe: do not force the size function to count bytes.
For now, we were always bounding a queue size by the total amount of
allocated bytes. We might want to use ather kind of bounds (e.g. the
total number of elements).
2017-11-13 11:04:16 +00:00
Grégoire Henry
2d08ba778f Utils: fix Lwt_utils.with_timeout
The function will never fail with `Timeout`, if the concurrent
computation terminates at the same "time".
2017-11-13 11:04:16 +00:00
Grégoire Henry
f0acd2e4da Utils: introduce Lwt_dropbox.
This is a blocking "dropbox" containing a single element. Writing in
the dropbox is a non-blocking operation, that might overwrite the
current element. Reading in the dropbox is blocking while the
'dropbox' is empty.
2017-11-13 11:04:16 +00:00
Grégoire Henry
f63c5acbf5 Distributed_db: inline the header when broadcasting a new block.
This adds a small size overhead in the network message, but in most
cases it will avoid a subsequent 'fetch' of the header.
2017-11-13 11:04:15 +00:00
Grégoire Henry
06873da197 Distributed_db: add an argument timeout to 'prefetch`. 2017-11-13 11:04:15 +00:00
Grégoire Henry
e5c931c6a3 Shell: rename Distributed_db.state -> net_state 2017-11-13 11:04:14 +00:00
Grégoire Henry
16cc5b7ec8 Shell: add more timeout in the prevalidator 2017-11-13 11:04:14 +00:00
Grégoire Henry
f4c045b126 Shell: reintroduce lost call to 'git repack'.
When updating to 'irmin-1.3' we merged the branch too quickly and we
incidentally removed the support for 'git repack'. This induced heavy
usage of inodes.

This is still a temporary hack, while waiting for a proper backend for
irmin (e.g. based LevelDB).
2017-11-13 11:31:09 +01:00
Pietro Abate
b25f35e2b5 Rename last occurences of miner into baker 2017-11-10 13:41:52 +01:00
Grégoire Henry
ed75bc5acd Distributed_db: handle timeout in fetch. 2017-11-10 09:52:35 +00:00
Grégoire Henry
a8a906b1ae Distributed_db: use the error monad for fetch. 2017-11-10 09:52:34 +00:00
Grégoire Henry
f40c418d0f Distributed_db: remove the last "lol-object". 2017-11-10 09:52:33 +00:00
Grégoire Henry
41c82d7481 Distributed_db: handle cancelation of call to fetch.
We properly count the number of waiters and cleanup the table when the
count drops to zero.
2017-11-10 09:52:33 +00:00
Grégoire Henry
2b4e898407 Distributed_db: use a record instead of a tuple. 2017-11-10 09:52:30 +00:00
Grégoire Henry
f3abee1fdf Utils: add Lwt_pipe.pop_all. 2017-11-10 09:52:29 +00:00
Grégoire Henry
1a10504959 Shell: fixme broken invariant in Distributed_db_functors.
The invariant of the `clear` function was not properly inforced by the
module interface. This patch remove the inappropriate invariant and
properly rename the function.
2017-11-10 09:52:29 +00:00