Skip to content

Conversation

@esorense
Copy link

@esorense esorense commented Jan 4, 2026

Changes:

  • Removed rootClaim parameter from StartOutputCannonGame, StartOutputAlphabetGame, and StartPermissionedGame
  • Added WithInvalidOutputRoot() and WithOutputRoot() options
  • Auto-derive rootClaim via crypto.Keccak256Hash(extraData) internally
  • Made CreateBisectionGameExtraData private

Before:

game := factory.StartOutputCannonGame(ctx, "sequencer", 4, common.Hash{0x01})

After:
game := factory.StartOutputCannonGame(ctx, "sequencer", 4, disputegame.WithInvalidOutputRoot())

Updated 27 test instances across 6 files. This aligns output games with the super games pattern, making the API more consistent and harder to misuse.

@esorense esorense requested review from a team as code owners January 4, 2026 14:27
@esorense esorense requested review from ajsutton and mds1 January 4, 2026 14:27
Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also remove the StartOutputCannonGameWithCorrectRoot method (and any similar WithCorrectRoot methods) and just make the default output root value be the valid output root.

I'd also remove the WithInvalidOutputRoot method and consistently use WithOutputRoot to provide an incorrect output root. There's a potential for confusion between "invalid" meaning "not valid to create a game with this root" vs "not the canonical output root". Output root games don't actually have any hashes you can't use as the root claim but super root games do now which creates the potential for confusion when using the term "invalid".

Comment on lines +353 to +355
} else {
rootClaim = crypto.Keccak256Hash(extraData)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense for output root type games - it's only super root games where the extra data is the preimage of the root claim. 0x000 is an allowed root claim for output root games.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants