Rollup node: command to repair commitments of a protocol
What
This MR introduces the command
octez-smart-rollup-node repair commitments for <protocol_hash>
to recompute commitments for the given protocol up to the current head of the rollup node. The rollup node must be stop before attempting this operation.
Depends on !13588 (merged).
Why
Before !13588 (merged), commitments in a new protocol where the commitment period changes were not computed correctly. This MR allows to repair a rollup node data without having to import a correct snapshot. If there are no commitments to fix the command does nothing.
How
We iterate over L2 blocks and recompute the commitments one by one and update the L2 chain accordingly.
Manually testing the MR
- Run the command above for a rollup node that did not perform the ParisB2 protocol migration correctly wrt commitments.
- Look at a recent commitment published on https://tzkt.io/sr1Ghq66tYK9y3r8CC1Tf8i8m5nxh8nTvZEf/commitments
- Make the following RPC on the rollup node:
and check that it contains the correct commitment hash.
curl http://localhost:8932/global/block/<inbox_level> | jq .commitment
Edited by Alain Mebsout