[go: up one dir, main page]

Dal_node: Add more cases for elements in the attestable slots stream

What

In !19459 (merged) we introduced a monitoring RPC to get the attestable slots for a delegate at each level, as soon as we know that information. You can refer to that MR for more details.

In this MR, we extend the information provided to include a Not_in_committee information, similar to what we provide to the baker, currently, with the static GET RPC.

Additionally, we also add (for debugging purposes mostly) a Slot_has_trap case.

Why

Because, in a future effort (see !19528 (closed)) to get rid of the static RPC, in favour of the monitoring one, we will need all the information already provided by the former. Otherwise, we will not know what to report to the baker.

How

By extending the type of the elements in the stream. We still notify when a slot becomes attestable by a delegate the same way, with the addition that at every finalized head, when we compute the committee, we notify all delegate streams when we know that the delegate is not part of it.

Manually testing the MR

Similar to the monitoring RPC MR, one can do:

./octez-node config init --data-dir ~/.tezos-node-ghostnet --network "ghostnet"

./octez-node identity generate --data-dir ~/.tezos-node-ghostnet

./octez-node snapshot import ghostnet.snapshot --data-dir ~/.tezos-node-ghostnet --no-check

./octez-node run --data-dir ~/.tezos-node-ghostnet --rpc-addr 127.0.0.1:18733 --net-addr 127.0.0.1:19732

and for the DAL node:

./octez-dal-node config init --endpoint http://127.0.0.1:18733 --attester-profiles=tz1Zt8QQ9aBznYNk5LUBjtME9DuExomw9YRs --operator-profiles=3

./octez-dal-node run --rpc-addr 127.0.0.1:11832

Oct 22 17:20:51.243 NOTICE │ Finalized block BLJigEUUtspvgbGuLtAi15Qp2o8MPCm3w3XHv7LCc9TpaZ6bohq at level 15797721, round
Oct 22 17:20:51.243 NOTICE │   0
Oct 22 17:20:55.204 NOTICE │ tz1Zt8QQ9aBzn attested slot(s) 0 at attested level 15797722.
Oct 22 17:20:55.204 NOTICE │ Finalized block BKuUckmtP9Py5QezBK5ed2EDQYbm5yyCLSGY7G6mWxvNKbhzwSR at level 15797722, round
Oct 22 17:20:55.204 NOTICE │   0
...

and call the monitoring RPC for the following delegates:

curl -N "http://127.0.0.1:11832/profiles/tz1Zt8QQ9aBznYNk5LUBjtME9DuExomw9YRs/monitor/attestable_slots"
{"kind":"attestable_slot","slot_id":{"slot_level":15797728,"slot_index":0}}
{"kind":"attestable_slot","slot_id":{"slot_level":15797729,"slot_index":0}}
{"kind":"attestable_slot","slot_id":{"slot_level":15797730,"slot_index":0}}
...

and

curl -N "http://127.0.0.1:11832/profiles/tz3ghnjLnUSqtQC29Q6tKy5Tpdwz52BpiZuf/monitor/attestable_slots"

{"kind":"not_in_committee","attested_level":15797735}
{"kind":"not_in_committee","attested_level":15797736}
{"kind":"not_in_committee","attested_level":15797737}
...

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Gabriel Moise

Merge request reports

Loading