Draft: Implement refutation game logic in rollup node
Context
This MR introduces the refutation game logic in the rollup node.
To make this logic as simple as possible, we have slightly modified how refutation games are initialized. In the current version, the initialization operation comes with a first move. This first move was not easy to build and would have required reimplementing some of the game state initialization logic in the rollup node: we want to avoid such a situation by reusing the protocol code as much as possible. Indeed, if we have several implementations of the same logic, there is a chance that the two implementations diverge, which would be dramatic for the rollup operator. Now, the game is started by a first operation and the next operation is the first move.
In the same spirit, we introduce two new protocol RPCs for the rollup node to know the ongoing games it is part of and the stakers that conflict with its commitment.
This MR ends up to have a large number of commits because of several bugfixes and improvements made along the way.
Fixes #2115 (closed)
Manually testing the MR
TODO
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.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR