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.
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'.
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.
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