Backport v21 !15409: Rollup node: RPCs to query the commitment including a block and the cementation status of a block
Backport !15409 (merged) to v21: Rollup node: RPCs to query the commitment including a block and the cementation status of a block
Commits
- 32f63354 Rollup node: Services encodings for committed/cemented RPC
- 8c47b2ac Rollup node: Helpers to compute comitted/cemented status of a block
- 43983780 Rollup node/Alpha: RPC for committed/cemented status
- 93350a1b Rollup node: backport committed/cemented RPCs to previous protocols
- 43cf9a0e Doc: changelog
Original MR description
What
This MR adds the RPC:
-
GET
/global/block/<block_id>/committed_status: retrieve if the blockblock_id's content is committed or cemented or neither
In the negative, the RPC indicates the estimated time at which the block will be committed (resp. cemented).
Why
This is useful to track commitment status of blocks and more particularly messages. For instance using the second RPC, one can estimate the time at which a withdrawal will be executable on L1.
How
By writing two helper functions to compute this information.
Manually testing the MR
The RPCs should return something like :
> curl -s localhost:8998/global/block/head/committed_status | jq
{
"uncommitted": {
"commitment_level": 8831262,
"estimated_commitment_time": "2024-10-31T16:43:05.000-00:00",
"estimated_cementation_time": "2024-11-14T16:42:55.000-00:00"
}
}
> curl -s localhost:8998/global/block/8621113/committed_status | jq
{
"committed": {
"commitment_hash": "src13yLTnjgXtMJyUdV1hGoV6zTRcw7qo2asMZMpPs8dhUuiTjwHRt",
"commitment_level": 8621202,
"first_published_level": 8621205,
"published_level": 8631070,
"estimated_cementation_time": "2024-11-02T12:57:22.000-00:00"
}
}
> curl -s localhost:8998/global/block/8550113/committed_status | jq
{
"cemented": {
"commitment_hash": "src147wpcs34QkxkGgDhmT8NTYePtt9j6RUu5biHRxM9b8rx8ycVAd",
"commitment_level": 8550282,
"first_published_level": 8550285,
"published_level": 8563928,
"blocks_cemented_since_cemented": 39049
}
}