op-challenger: Update list-games sub command to support optimistic zk games #18393
+501
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Starts to build out the OptimisticZK contract bindings and make challenger not require everything to look like a FaultDisputeGame. Chose to make the ZK contracts independent rather than trying to have a base class with shared code - the hierarchy of versions of
FaultDisputeGameare already pretty complex and the method call implementations are generally pretty mechanical so better to keep the implementation simple at the cost of some code duplication. Especially since these methods haven't needed to change much outside of actual contract implementation changes.There is however a hierarchy of contract interfaces so that we can have a single constructor method that creates the right bindings per game type with a generic interface returned and then can check if more specific interfaces are supported conditionally when required. That will be most useful for dispute-mon but is also used for the claim count value in list-games which doesn't apply to ZK games.
A new game type is introduced for optimistic ZK games, but a corresponding trace type doesn't exist yet - that can follow when actually supporting challenging the games. For now we just need to be able to handle the game type so we can fetch the metadata for list-games.
Tests
Added unit tests for the new bindings.
Metadata
fixes #18392