Commit Graph

121 Commits

Author SHA1 Message Date
Grégoire Henry
a0a2d6b004 Shell: filter out future block 2018-06-19 12:15:27 +00:00
Grégoire Henry
67566c271c Shell: forced upgrades 2018-06-18 15:58:00 +02:00
Grégoire Henry
f615459200 Shell/RPC: /chains/<id>/mempool new returned parsed operations 2018-06-14 22:57:04 +00:00
Grégoire Henry
c2517a0432 Shell: minor renaming 2018-06-14 22:57:04 +00:00
Vincent Bernardoff
a6bc6333da Shell: use lmdb for disk storage 2018-06-13 00:55:37 +02:00
Grégoire Henry
6f4a98f6fd P2P: allow to limit the size of mempool 2018-06-12 21:27:55 +02:00
Grégoire Henry
fed04d4b8f P2P: allow to limit the size of protocols 2018-06-12 21:27:55 +02:00
Grégoire Henry
99f6e40471 P2P: allow to limit the size of operations and operations list 2018-06-12 21:27:55 +02:00
Grégoire Henry
8072d413fc P2P: allow to limit the size of block header 2018-06-12 21:27:55 +02:00
Grégoire Henry
85a25e200d P2P: allow ti limit the length of list in requests 2018-06-12 21:27:55 +02:00
Grégoire Henry
a5cec8fca0 Proto: move back max_operation_data_length as a constants 2018-06-12 21:27:55 +02:00
Grégoire Henry
22bf535d68 Shell: faster propagation of protocols 2018-06-11 09:24:41 +00:00
Grégoire Henry
5fd5c1c5f7 Dune: upgrade to 1.0+beta20 2018-06-08 15:27:23 +00:00
Grégoire Henry
ca1d4158a7 Shell/RPC: add raw block header in monitoring RPCs 2018-06-06 15:24:05 +02:00
Grégoire Henry
5aa65ee71f Shell/RPC: allow to fetch raw Block_header 2018-06-06 15:24:05 +02:00
Benjamin Canou
23e1486564 RPC: add missing error registration 2018-06-06 10:54:33 +02:00
Grégoire Henry
030630ec0f Data_encoding: mandatory title to case 2018-06-06 10:54:33 +02:00
Grégoire Henry
632144b689 RPC: remove subfield accessors
This is painful to maintain and `jq` works well.
2018-06-06 10:54:33 +02:00
Grégoire Henry
420986b45b Alpha: simplify the operation datatype 2018-06-06 10:54:33 +02:00
Grégoire Henry
33c3d1fcbd Alpha/RPC: add a low-level but typed RPC for context introspection
Example:

```
> tezos-client rpc get /chains/main/blocks/head/context/raw/json/\?depth\=1 | jq
{
  "commitments": [],
  "contracts": {
    "global_counter": 0,
    "index": []
  },
  "cycle": [
    4,
    3,
    2,
    1,
    0
  ],
  "delegates": [
    "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN",
    "tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU",
    "tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv",
    "tz1b7tUupMgCNw2cCLpKTkSD1NZzB5TkP2sv",
    "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"
  ],
  "last_block_priority": 0,
  "rolls": {
    "index": [],
    "next": 2000,
    "owner": {}
  },
  "votes": {
    "ballots": [],
    "current_period_kind": "proposal",
    "current_quorum": 8000,
    "listings": [],
    "proposals": []
  }
}
> tezos-client rpc get /chains/main/blocks/head/context/raw/json/cycle/4\?depth\=2 | jq
{
  "last_roll": [
    [
      0,
      2000
    ]
  ],
  "nonces": [],
  "random_seed": "97d50852c159ada8e9f107e98f693b059ba28336c723e6cd0f6353eb3c0cb415",
  "roll_snapshot": 0
}
> tezos-client rpc get /chains/main/blocks/head/context/raw/json/cycle/5\?depth\=2 | jq
{
  "last_roll": [
    [
      1,
      2000
    ],
    [
      0,
      2000
    ]
  ],
  "nonces": [],
  "roll_snapshot": 2
}
```
2018-06-06 10:54:33 +02:00
Grégoire Henry
f5e3fb17c0 Resto: lift the lwt monad into Resto. 2018-06-06 10:54:33 +02:00
Grégoire Henry
89cbe0f8fa Docs/RPC: fix doc generation
The current doc generator does not handles path were multiple method
are registred. The fix remove the intermediate (compilation) tree.
2018-06-06 10:54:33 +02:00
Grégoire Henry
0a78bbe33b Shell/RPC: use GET request for /workers 2018-06-06 10:54:33 +02:00
Grégoire Henry
64c464a73f Shell/RPC: some module renaming/aliasing 2018-06-06 10:54:33 +02:00
Grégoire Henry
2a93a336aa Shell/RPC: use query parameters in /injection 2018-06-06 10:54:33 +02:00
Grégoire Henry
9bc7b1e573 Shell/RPC: also list embedded protocols 2018-06-06 10:54:33 +02:00
Grégoire Henry
04c920df29 Shell/RPC: use query parameters in /protocols 2018-06-06 10:54:33 +02:00
Grégoire Henry
bbf5c7408b Shell/RPC: split out Monitor_services 2018-06-06 10:54:33 +02:00
Grégoire Henry
0b08dce3e8 Shell/RPC: move preapply_operation into Block_services 2018-06-06 10:54:33 +02:00
Grégoire Henry
d6f79edae2 Shell/RPC: rework /blocks
- start using `GET` and query parameters instead of `POST`  when
  meaningful

- inline parsed protocol data and metadata in block headers

- inline parsed protocol data and metadata in operations

- split the RPC in four categories:

  - static data, available explicitly in block headers and operations

  - static "metadata", information that were computed while validating
    a block or an operation, but which are not explicit in the block
    header (e.g. the baker of a block, the list of internal
    transfer... (currently not implemented, but that's WIP))

  - "context" all the static data we may read in the context
    (contracts balance, list of delegates, ...)

  - "helpers" are some RPC that may perform some computation.
2018-06-06 10:54:33 +02:00
Grégoire Henry
95a56753df P2p: store connection_local_metadata in P2p_connection.Info.t 2018-06-05 13:51:25 +02:00
Grégoire Henry
e610fcaade P2p: read connection metadata before to accept connections
This will allow to decide whether to accept a connection or not
depending on its actual metadata.
2018-06-05 13:51:20 +02:00
OCamlPro-Iguernlala
4a16b3ef0b P2p: add "private node" information in Connection_metadata.
Add private_node flag in Connection_metadata.t and update Node,
Distributed_db, P2p and P2p_pool to propagate the information
2018-06-05 13:40:00 +02:00
michael
aedf867e4a RPC: Add conn_metadata to peer_info rpcs 2018-06-04 15:55:41 +02:00
michael
df4e474577 Shell: disable prevalidator if disable-mempool is used 2018-06-04 15:39:42 +02:00
michael
d5925f088c P2p: Add option to disable the mempool
This allows a node to specify that it doesn't want to receive operations
that are not included in a block. To do so, one should use the new
--disable-mempool option.

A disabled mempool node announce its configuration during the ACK exchange.
This configuration should be easily expandable with other options.

Node will keep track of the ack exchange configuration for each nodes it
is connected to and will not propagate its mempool to disabled mempool
nodes.

A disabled mempool node will ignore non-empty mempool received.
In the future, this incident should be punish by a decrement of its score
and / or ban.
2018-06-04 15:35:22 +02:00
michael
a8e607a5a9 Shell: preliminary work for ack_cfg exchange 2018-06-01 16:25:43 +00:00
Grégoire Henry
d7e5ca81e4 Shell: store metadata for block header and operations 2018-06-01 16:20:10 +02:00
Grégoire Henry
fc26022cd2 Proto: associate metadata to valid block headers and operations 2018-06-01 16:20:10 +02:00
Grégoire Henry
c85e27605b Proto: export Data_encoding.t for block headers and operationss
Previously we were only exporting parsing function. This will allow
to move out of the protocol some `helpers` RPCs.
2018-06-01 16:20:10 +02:00
James Deikun
afa335ff48 move module-specific logging to the modules that use it 2018-05-31 17:05:00 -04:00
Grégoire Henry
0d8990887c Jbuilder: fix the target @runtest_indent 2018-05-26 20:08:03 +02:00
michael
3f1363b9ba P2P/Shell: Split metadata into peer_metadata and conn_metadata
Peer_metadata is meant to keep track of peer's score.

Conn_metadata is meant to keep track of connection configuration given
during Ack exchange.
2018-05-25 11:39:22 +02:00
Grégoire Henry
5023e1a261 Data_encoding: rename Binary.to_bytes into to_bytes_exn 2018-05-24 15:43:15 +00:00
Vincent Bernardoff
b3df4e63c8 [P2P] ACLs: cosmetics, renamings, comments 2018-05-03 16:03:01 +02:00
Pietro
02838a4cbc p2p,node,client: Add Greylists
- add admin commands to ban and unban ips and peers
- add greylist_timeout option to configuration file (node)
- Add greylist modules + RPC
2018-05-03 16:03:01 +02:00
Grégoire Henry
c9eab8689a Shell/Distributed_db: tune requests delay 2018-05-03 11:51:29 +02:00
Grégoire Henry
f2db5ffde3 Shell/Bootstrap: improve network paralellism 2018-05-03 11:51:29 +02:00
Grégoire Henry
6e4b2eab47 Shell: reduce default logging a little bit 2018-05-03 11:51:29 +02:00
Grégoire Henry
c3eda23b45 Shell: add a global watcher for new valid blocks in State 2018-04-22 13:46:31 +02:00