Commit Graph

227 Commits

Author SHA1 Message Date
Benjamin Canou
e18802b32e Introducing Micheline, the IR of Michelson 2017-11-03 15:39:04 +01:00
Milo Davis
466831c179 CLI: Autocomplete 2017-11-03 10:59:02 +01:00
Grégoire Henry
108fe7799f Jbuilder: Wrap Tezos_protocol_environment_sigs 2017-10-31 20:33:57 +00:00
Grégoire Henry
05da5a73b8 Jbuilder: Wrap the Tezos_protocol_compiler 2017-10-31 20:33:57 +00:00
Milo Davis
0a7f9a39a9 Switch to Jbuilder
This is a rewrite of the build system with `jbuilder`, with just a
minimal toplevel Makefile for backward compatibility.

This first patch preserves the project architecture, we only gain
proper dependencies handling and always up-to-date `.merlin` files.
A latter patch may split the project in smaller "sub-package",
i.e. multiple `.opam` files.

The embedded versions of the economic protocol are now compiled with
`jbuilder` instead of `tezos-protocol-compiler`, potentially allowing
proper inlining at the cost of slightly-less-stricter
sandboxing. Nevertheless, dynamically loaded protocol are still
compiled with the `tezos-protocol-compiler` and thus strictly
sandboxed ; and a CI rule also checks the proper sandboxing of
embedded protocols.

This patch is coauthored with @hnrgrgr
2017-10-31 20:33:56 +00:00
Milo Davis
490ce840f9 Remove all .merlin 2017-10-31 20:33:54 +00:00
Grégoire Henry
9c90e2e514 Merge node_compiler_main.ml into node_main.ml 2017-10-31 20:33:51 +00:00
Grégoire Henry
3d21245959 Rename tezos_compiler.ml 2017-10-31 20:33:51 +00:00
Grégoire Henry
2e477ebb26 Rename tezos_protocol_registerer.ml 2017-10-31 20:33:50 +00:00
Milo Davis
1cb48bbb3a Rename store_sigs.mli into store_sigs.ml 2017-10-31 20:33:49 +00:00
Milo Davis
9a056eef23 Improved error message 2017-10-31 20:33:49 +00:00
Grégoire Henry
dd9e5f5c95 Updater: simplify signature and error registration.
In particular, register the `Ecoproto_error` at the same time the
functor `Environment.Make` is applied.
2017-10-31 20:33:48 +00:00
Milo Davis
ceeb3f7eac Remove dead code 2017-10-31 20:33:46 +00:00
Grégoire Henry
dc2cd4db1c Utils: add Data_encoding.delayed
This allows a better representation for `Error_monad.error_encoding`,
capturing the side-effect of new error registration.
2017-10-31 20:33:45 +00:00
Grégoire Henry
79f2dca33a Shell: fix possible stack overflow in validation.
Ouch! That was a subtle Lwt misuse.

With the current (very-old) validator code, when the validation of
block is waiting to the validation of its predecessor, a "pending" Lwt
thread is created. The validation of the predecessor might also wait
on its own predecessor, potentially creating a very long chain of
pending validation"... If in the process one of the block is tagged
invalid, all the pending "successors" in the chain are 'wakeuped'
immediatly and in sequence, potentially blowing the stack in the
process.

A quick fix is to add an `Lwt_unix.yield` to break the recursion.

A better fix is to not create such long chain of "pending" validations.
See merge request !59.
2017-10-31 17:59:14 +01:00
Grégoire Henry
370112f9b8 Makefile: simplify the compilation process.
This patch is co-authored with: cagdas.bozman@ocamlpro.com

With this patch the economic protocol is now compiled as as
"functor-pack", parameterized over the environment. This will ease the
protocol reusability outside of the tezos source tree (e.g. for a
michelson Web IDE) and will allow proper unit testing of the economic
protocol.

This functorization allows to break the dependency of the
'tezos-protocol-compiler' on various '.mli' of the node, and hence
we don't need anymore the unusual compilation schema:

  a.mli -> b.mli -> b.ml -> a.ml

where 'A' is linked after 'B' but 'a.mli' should still be compiled
before 'b.mli'. This will simplify a switch to 'ocp-build' or 'jbuiler'.
2017-10-11 13:44:09 +00:00
Grégoire Henry
c2fd13f3ab Reset the chain 2017-09-22 19:11:21 +02:00
Grégoire Henry
76bf007660 Shell/Irmin: tag the commit of the head as the "git branch" 2017-09-22 19:07:54 +02:00
Grégoire Henry
b49491587f Reset the chain. 2017-09-22 11:37:57 +02:00
Grégoire Henry
d2ad611c3d Node/Sandbox: allow 'private' address
Allows any kind of 'private' listening address (as defined by IANA)
rather than only allowing `[::1]`.

Also document the error.
2017-08-28 21:25:19 +02:00
Grégoire Henry
4c7d4a8348 P2p: comment out dead code 2017-08-22 14:56:15 +02:00
Benjamin Canou
7c586aaf25 Reset the chain (on-disk storage updated) 2017-08-17 14:54:34 +02:00
Grégoire Henry
a01f786de4 Update to irmin.1.3 2017-08-16 11:12:51 +02:00
Grégoire Henry
571e87dacb Update to mtime.1.0 2017-08-16 10:53:43 +02:00
Benjamin Canou
9ae9f3f4b7 Node: fix misplaced logging message 2017-08-11 15:24:38 +02:00
Milo Davis
299ebe3865 Testing: Tests multiple nodes 2017-08-11 13:01:46 +00:00
Grégoire Henry
30b2cd3e0e Update protocol version 2017-08-08 16:49:56 +02:00
OCamlPro-Iguernlala
fbacfff9e6 P2p: use incremental encoding/decoding 2017-08-08 11:22:05 +02:00
Grégoire Henry
32fa712e13 Prevalidation: minor bugfix. 2017-08-07 08:29:52 +02:00
Fabrice Le Fessant
4dd1ef9988 Michelson: replace all numbers with only int and nat 2017-07-26 15:19:05 +02:00
Wyatt Sullivan
cca69e409d Node: fix typo in config variable name 2017-07-25 17:46:05 +02:00
Wyatt Sullivan
9b2d0882b1 Node: fix typos in help pages 2017-07-25 17:46:05 +02:00
Milo Davis
9e1ec0c159 Doc: fixes incorrect usage example 2017-07-24 14:42:16 +02:00
Benjamin Canou
4bd9a864cf Shell: document internal distributed_db error, 2017-07-21 16:16:39 +02:00
Grégoire Henry
2bc63854a8 Shell: Liveness of operations
Operations now include a block hash in their header. Such an operation
could only be included in a successor of this block.

Furthermore, when validating a block, the economic protocol now
returns---together with the context---an integer `max_operations_ttl`.
Then, when validating a successor, the shell will fail if it contains
an operation whose header's block hash is not one the
`max_operations_ttl` predecessors of the block.

As a bonus, the shell is now able to detect and forbid replayed
operations. Then, we might decide to remove some replay
detection-mechanism that we previously implemented in the economic
protocol.
2017-06-12 11:07:37 +02:00
Grégoire Henry
329c8b185a Shell: implements Chain.live_blocks 2017-06-12 11:07:37 +02:00
Grégoire Henry
8d5155cf32 Proto: return the maximum TTL for operations 2017-06-12 11:07:37 +02:00
Grégoire Henry
747cdb1963 Shell: export Distributed_db.*.clear 2017-06-12 11:07:37 +02:00
Grégoire Henry
4bbc97aeb6 Shell: rework the preapply RPC
It now takes a `proto_header` in parameter, and it returns a full
`shell_header`. This prepares the inclusion of the context's hash in the
`shell_header`.
2017-06-12 11:07:35 +02:00
Grégoire Henry
3b7a314669 Shell/Proto: more complete "begin_construction".
The `begin_construction` function now accepts an optional argument
`proto_header`. This is to be used by a new RPC that ease forging the
shell header of a block (i.e. it will compute the fitness and, in a
near future, the hash of the resulting context).
2017-06-12 11:05:49 +02:00
Grégoire Henry
565654a242 Client: minor renaming 2017-06-12 11:05:48 +02:00
Grégoire Henry
f39eca214a Shell: remove the on-disk index of operations
Let's get serious. The full index of operations is not sustainable in
the production code. We now only keep the index of operations not yet
in the chain (i.e. the mempool/prevalidation). Operations from the
chain are now only accesible through a block. For instance, see the
RPC:

   /blocks/<hash>/proto/operations
2017-06-12 11:04:43 +02:00
Grégoire Henry
4995864316 Shell: regroups basic data types in Tezos_data 2017-06-12 11:04:43 +02:00
Grégoire Henry
61eb67cbca Shell: do not keep tracks of 'invalid_successors' 2017-06-12 11:04:43 +02:00
OCamlPro-Iguernlala
4ded0660d6 p2p: check values of some options in P2p.create 2017-06-12 09:39:36 +02:00
Vincent Bernardoff
3b3428ddad Shell: experimental leveldb backend 2017-06-06 23:12:33 +02:00
Vincent Bernardoff
35792ccc37 RPCs: fix node crash on SSL write error 2017-06-06 18:58:03 +02:00
Benjamin Canou
d351bb1608 Shell: small bugfix preventing mempool cleanup. 2017-05-31 16:36:07 +02:00
Grégoire Henry
443cee2bb3 Fix compilation with lwt.3.0.0 2017-05-07 12:26:27 +02:00
Benjamin Canou
442f2d00a0 RPCs: fix missing CORS headers. 2017-04-19 17:27:45 +02:00