[go: up one dir, main page]

Rollup node: RPCs to query the commitment including a block and the cementation status of a block

What

This MR adds the RPC:

  • GET /global/block/<block_id>/committed_status : retrieve if the block block_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
  }
}
Edited by Alain Mebsout

Merge request reports

Loading