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
Milo Davis
673f70c5d0
Client Keys: Vanity keys
2017-11-09 12:57:18 +00:00
Benjamin Canou
6de9c68e81
Remove reminiscent trace of Sha256
2017-11-08 23:30:34 +00:00
Grégoire Henry
cb1e5cc396
P2p: missing Lwt_utils.protect
in the reader worker.
2017-11-08 23:30:33 +00:00
Grégoire Henry
c9fe53eb10
P2p: reduce the default value of "expected connections".
2017-11-08 23:30:33 +00:00
Grégoire Henry
6f5c51f050
Client: ignore empty files
2017-11-08 23:30:32 +00:00
Grégoire Henry
0e2a751408
P2p: better logging on read timeout.
2017-11-08 23:30:32 +00:00
Grégoire Henry
dad0793353
P2p: better logging on failing "Swap".
2017-11-08 23:30:31 +00:00
Grégoire Henry
ee2cb59731
Remove reminiscent trace of Base48
.
...
A long time ago we were using a custom Base48 encoding instead of the
standard Base58.
2017-11-08 23:30:31 +00:00
Milo Davis
f83e0fd7c0
Node: adds version to data directory
2017-11-08 17:49:19 +01:00
Milo Davis
5109db2813
Node: adds error for directory parsing failure
2017-11-08 17:41:54 +01:00
Alex Coventry
14597b8f7e
Utils: OcamlDoc for Data_encoding module.
...
This patch is coathored with @milodavis, @abate,
and @klakplok.
2017-11-08 16:42:35 +01:00
Pietro Abate
48d7ba29e8
Generate html API documentation
...
- add a new targert "make doc-html" to generate the html doc via
jbuilder
- this patch adds public_name to jbuild files for all libraries
2017-11-08 15:55:40 +01:00
Grégoire Henry
0c3a54c2f9
Distributed_db: export disconnect
2017-11-03 15:12:09 +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
Grégoire Henry
5c1f96f3a1
Shell: add the number of validation passes in the block header.
2017-11-03 15:12:06 +00:00
Grégoire Henry
f7aed9d45d
Shell: keep a reference to 'State.t' in 'State.Net.t'
2017-11-03 15:12:05 +00:00
Grégoire Henry
3909baaedc
Raw_store: document the Missing_key
error
2017-11-03 15:12:05 +00:00
Grégoire Henry
900f16228b
Distributed_db: properly reexport the error Missing_data
2017-11-03 15:12:04 +00:00