Concurent request of the same ressource might insert multiple 'Pending
request' in the request tracking table. Resulting, only one of them
will ever be satisfied and some worker might be stuck for ever. We
avoid this be removing any cooperation between lookup and insertion in
the table.
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
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.