Commit Graph

21 Commits

Author SHA1 Message Date
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
d5a2bd9604 Distributed_db: register new internal errors 2017-11-13 22:17:56 +01:00
Grégoire Henry
06873da197 Distributed_db: add an argument timeout to 'prefetch`. 2017-11-13 11:04:15 +00: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
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
Grégoire Henry
06e4ec4d9b Distributed_db: proper logging
New category:

- node.distributed_db.p2p_reader

    log all incoming message, from any peer (debug)

- node.distributed_db.scheduler.*

    log the request scheduler of the given ressources (notice/debug),
    where '*' might be:

    - Operation_hash   (individual operation)
    - Block_hash       (block header)
    - operation_hashes (aggregated operation_hashes of a block)
    - operations       (aggregated operations of a block)
    - Protocol_hash    (protocol)
2017-11-03 15:12:08 +00:00
Grégoire Henry
616ca33498 Distributed_db: randomly selecting peer 2017-11-03 15:12:08 +00:00
Grégoire Henry
c05c739475 Distributed_db: reset next_request delay
When registring a new peer as a provider for a ressource,
reset the next request delay.
2017-11-03 15:12:07 +00:00
Grégoire Henry
79ae54625d Distributed_db: fix concurency issue
Some `events` might be lost in case of the timeout happens before
concomitantly. We avoid this by storing the `events` promise into the
worker state.
2017-11-03 15:12:07 +00:00
Grégoire Henry
5c03d92457 Distributed_db: fix concurency issue
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.
2017-11-03 15:12:07 +00:00
Benjamin Canou
4bd9a864cf Shell: document internal distributed_db error, 2017-07-21 16:16:39 +02:00
Grégoire Henry
747cdb1963 Shell: export Distributed_db.*.clear 2017-06-12 11:07:37 +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
e273cfa07f Shell/Distributed_db: allow to precheck data. 2017-03-31 01:19:34 +02:00
Grégoire Henry
39403e243e Shell: avoid operation leaks 2017-03-09 14:38:38 +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