proofs

package
v1.19.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZKProposalUnchallenged                      = challengerContracts.ProposalStatusUnchallenged
	ZKProposalChallenged                        = challengerContracts.ProposalStatusChallenged
	ZKProposalUnchallengedAndValidProofProvided = challengerContracts.ProposalStatusUnchallengedAndValidProofProvided
	ZKProposalChallengedAndValidProofProvided   = challengerContracts.ProposalStatusChallengedAndValidProofProvided
	ZKProposalResolved                          = challengerContracts.ProposalStatusResolved
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactBytecode

type ArtifactBytecode struct {
	Object string `json:"object"`
}

type ArtifactJSON

type ArtifactJSON struct {
	Bytecode ArtifactBytecode `json:"bytecode"`
	ABI      json.RawMessage  `json:"abi"`
}

type Claim

type Claim struct {
	Index uint64
	// contains filtered or unexported fields
}

func (*Claim) Attack

func (c *Claim) Attack(eoa *dsl.EOA, newClaim common.Hash) *Claim

func (*Claim) Bond

func (c *Claim) Bond() *big.Int

func (*Claim) Claimant

func (c *Claim) Claimant() common.Address

func (*Claim) CounteredBy

func (c *Claim) CounteredBy() common.Address

func (*Claim) Defend

func (c *Claim) Defend(eoa *dsl.EOA, newClaim common.Hash) *Claim

func (*Claim) Depth

func (c *Claim) Depth() types.Depth

func (*Claim) Position

func (c *Claim) Position() types.Position

func (*Claim) String

func (c *Claim) String() string

func (*Claim) Value

func (c *Claim) Value() common.Hash

func (*Claim) VerifyNoCounterClaim

func (c *Claim) VerifyNoCounterClaim()

func (*Claim) WaitForCounterClaim

func (c *Claim) WaitForCounterClaim(ignoreClaims ...*Claim) *Claim

WaitForCounterClaim waits for the claim to be countered by another claim being posted. Return the new claim that counters this claim.

func (*Claim) WaitForCountered

func (c *Claim) WaitForCountered()

WaitForCountered waits until the claim is countered either by a child claim or by a step call.

type DelayedWETH added in v1.19.5

type DelayedWETH struct {
	// contains filtered or unexported fields
}

DelayedWETH exposes the minimal DelayedWETH read surface needed to observe two-phase bond claiming (unlock, then withdraw after the delay).

func (*DelayedWETH) Delay added in v1.19.5

func (w *DelayedWETH) Delay() *big.Int

Delay returns the withdrawal delay in seconds.

func (*DelayedWETH) Withdrawal added in v1.19.5

func (w *DelayedWETH) Withdrawal(game, recipient common.Address) ZKWithdrawal

Withdrawal returns the pending withdrawal request the game holds for recipient.

type DisputeGameFactory

type DisputeGameFactory struct {
	// contains filtered or unexported fields
}

func NewDisputeGameFactory

func NewDisputeGameFactory(
	t devtest.T,
	l1Network *dsl.L1Network,
	ethClient apis.EthClient,
	dgfAddr common.Address,
	l2CL *dsl.L2CLNode,
	l2EL *dsl.L2ELNode,
	superNode dsl.SuperRootSource,
	l1Proposer *dsl.EOA,
	challengerCfg *challengerConfig.Config,
) *DisputeGameFactory

func (*DisputeGameFactory) Address

func (f *DisputeGameFactory) Address() common.Address

func (*DisputeGameFactory) CreateHelperEOA

func (f *DisputeGameFactory) CreateHelperEOA(eoa *dsl.EOA) *GameHelperEOA

func (*DisputeGameFactory) DelayedWETH added in v1.19.5

func (f *DisputeGameFactory) DelayedWETH(addr common.Address) *DelayedWETH

DelayedWETH binds the DelayedWETH contract at addr (e.g. the ZK game implementation's weth arg) using the factory's L1 client.

func (*DisputeGameFactory) GameArgs

func (f *DisputeGameFactory) GameArgs(gameType gameTypes.GameType) []byte

func (*DisputeGameFactory) GameAtIndex

func (f *DisputeGameFactory) GameAtIndex(idx int64) *FaultDisputeGame

func (*DisputeGameFactory) GameCount

func (f *DisputeGameFactory) GameCount() int64

func (*DisputeGameFactory) GameImpl

func (f *DisputeGameFactory) GameImpl(gameType gameTypes.GameType) *FaultDisputeGame

func (*DisputeGameFactory) RunFPP

func (f *DisputeGameFactory) RunFPP(startTimestamp uint64, endTimestamp uint64)

RunFPP runs the fault proof program between the two supplied timestamps. Currently only supports kona-interop.

func (*DisputeGameFactory) StartCannonKonaGame

func (f *DisputeGameFactory) StartCannonKonaGame(eoa *dsl.EOA, opts ...GameOpt) *FaultDisputeGame

func (*DisputeGameFactory) StartSuperCannonKonaGame

func (f *DisputeGameFactory) StartSuperCannonKonaGame(eoa *dsl.EOA, opts ...GameOpt) *SuperFaultDisputeGame

func (*DisputeGameFactory) StartSuperPermissionedGame added in v1.19.5

func (f *DisputeGameFactory) StartSuperPermissionedGame(opts ...GameOpt) *SuperFaultDisputeGame

func (*DisputeGameFactory) StartZKGame added in v1.19.5

func (f *DisputeGameFactory) StartZKGame(eoa *dsl.EOA, opts ...GameOpt) *ZKGame

func (*DisputeGameFactory) SuperGameAtIndex

func (f *DisputeGameFactory) SuperGameAtIndex(idx int64) *SuperFaultDisputeGame

func (*DisputeGameFactory) VerifyGameImplAbsent

func (f *DisputeGameFactory) VerifyGameImplAbsent(gameType gameTypes.GameType)

func (*DisputeGameFactory) VerifyGameImplPresent

func (f *DisputeGameFactory) VerifyGameImplPresent(gameType gameTypes.GameType)

func (*DisputeGameFactory) WaitForGame

func (f *DisputeGameFactory) WaitForGame() *FaultDisputeGame

func (*DisputeGameFactory) WaitForSafeSuperRootAfter added in v1.19.5

func (f *DisputeGameFactory) WaitForSafeSuperRootAfter(sequence uint64) (uint64, []eth.Bytes32)

WaitForSafeSuperRootAfter returns a verified super-root timestamp and a copy of its per-chain output roots. Tests can mutate the copy to model a faulty proposer without changing supernode-owned response data.

func (*DisputeGameFactory) WaitForZKGameAtIndex added in v1.19.5

func (f *DisputeGameFactory) WaitForZKGameAtIndex(idx int64) *ZKGame

WaitForZKGameAtIndex waits until the factory holds a ZK dispute game at the given index, then returns that game.

func (*DisputeGameFactory) ZKGameAtIndex added in v1.19.5

func (f *DisputeGameFactory) ZKGameAtIndex(idx uint32) *ZKGame

func (*DisputeGameFactory) ZKGameImpl added in v1.17.0

func (f *DisputeGameFactory) ZKGameImpl() *ZKDisputeGame

ZKGameImpl returns the ZK dispute game implementation address and its parsed constructor args from the DisputeGameFactory.

type FaultDisputeGame

type FaultDisputeGame struct {
	Address common.Address
	// contains filtered or unexported fields
}

func NewFaultDisputeGame

func NewFaultDisputeGame(
	t devtest.T,
	require *require.Assertions,
	addr common.Address,
	helperProvider gameHelperProvider,
	honestTrace func(game *FaultDisputeGame) challengerTypes.TraceAccessor,
	game *bindings.FaultDisputeGame,
) *FaultDisputeGame

func (*FaultDisputeGame) Attack

func (g *FaultDisputeGame) Attack(eoa *dsl.EOA, claimIdx uint64, newClaim common.Hash)

func (*FaultDisputeGame) ClaimAtIndex

func (g *FaultDisputeGame) ClaimAtIndex(claimIndex uint64) *Claim

func (*FaultDisputeGame) CreatedAt added in v1.19.5

func (g *FaultDisputeGame) CreatedAt() uint64

func (*FaultDisputeGame) Defend

func (g *FaultDisputeGame) Defend(eoa *dsl.EOA, claimIdx uint64, newClaim common.Hash)

func (*FaultDisputeGame) DisputeL2SequenceNumber

func (g *FaultDisputeGame) DisputeL2SequenceNumber(eoa *dsl.EOA, startClaim *Claim, l2SequenceNumber uint64) *Claim

func (*FaultDisputeGame) DisputeToStep

func (g *FaultDisputeGame) DisputeToStep(eoa *dsl.EOA, startClaim *Claim, traceIndex uint64) *Claim

func (*FaultDisputeGame) GameData

func (g *FaultDisputeGame) GameData() string

func (*FaultDisputeGame) GameType

func (g *FaultDisputeGame) GameType() gameTypes.GameType

func (*FaultDisputeGame) L1Head

func (g *FaultDisputeGame) L1Head() common.Hash

func (*FaultDisputeGame) L2SequenceNumber

func (g *FaultDisputeGame) L2SequenceNumber() uint64

func (*FaultDisputeGame) LogGameData

func (g *FaultDisputeGame) LogGameData()

func (*FaultDisputeGame) MaxClockDuration added in v1.19.5

func (g *FaultDisputeGame) MaxClockDuration() time.Duration

func (*FaultDisputeGame) MaxDepth

func (g *FaultDisputeGame) MaxDepth() challengerTypes.Depth

func (*FaultDisputeGame) PerformMoves

func (g *FaultDisputeGame) PerformMoves(eoa *dsl.EOA, moves ...GameHelperMove) []*Claim

func (*FaultDisputeGame) Resolve added in v1.19.5

func (g *FaultDisputeGame) Resolve(eoa *dsl.EOA)

func (*FaultDisputeGame) ResolveClaim added in v1.19.5

func (g *FaultDisputeGame) ResolveClaim(eoa *dsl.EOA, claimIdx uint64)

func (*FaultDisputeGame) RootClaim

func (g *FaultDisputeGame) RootClaim() *Claim

func (*FaultDisputeGame) RootClaimValue added in v1.19.5

func (g *FaultDisputeGame) RootClaimValue() common.Hash

func (*FaultDisputeGame) SplitDepth

func (g *FaultDisputeGame) SplitDepth() challengerTypes.Depth

func (*FaultDisputeGame) StartingL2SequenceNumber

func (g *FaultDisputeGame) StartingL2SequenceNumber() uint64

func (*FaultDisputeGame) VerifyGameType added in v1.19.5

func (g *FaultDisputeGame) VerifyGameType(expected gameTypes.GameType)

func (*FaultDisputeGame) WETHAddress added in v1.19.5

func (g *FaultDisputeGame) WETHAddress() common.Address

func (*FaultDisputeGame) WaitForGameStatus added in v1.19.5

func (g *FaultDisputeGame) WaitForGameStatus(expected gameTypes.GameStatus)

type GameCfg

type GameCfg struct {
	// contains filtered or unexported fields
}

func NewGameCfg

func NewGameCfg(opts ...GameOpt) *GameCfg

type GameHelper

type GameHelper struct {
	// contains filtered or unexported fields
}

func DeployGameHelper

func DeployGameHelper(t devtest.T, deployer *dsl.EOA, honestTraceProvider func(game *FaultDisputeGame) challengerTypes.TraceAccessor) *GameHelper

func (*GameHelper) AuthEOA

func (gs *GameHelper) AuthEOA(eoa *dsl.EOA) *GameHelper

func (*GameHelper) CreateGameWithClaims

func (gs *GameHelper) CreateGameWithClaims(
	eoa *dsl.EOA,
	factory *DisputeGameFactory,
	gameType gameTypes.GameType,
	rootClaim common.Hash,
	extraData []byte,
	moves []GameHelperMove,
) common.Address

func (*GameHelper) DisputeL2SequenceNumber

func (gs *GameHelper) DisputeL2SequenceNumber(eoa *dsl.EOA, game *FaultDisputeGame, startClaim *Claim, l2SequenceNumber uint64) *Claim

func (*GameHelper) DisputeToStep

func (gs *GameHelper) DisputeToStep(eoa *dsl.EOA, game *FaultDisputeGame, startClaim *Claim, traceIndex uint64) *Claim

func (*GameHelper) PerformMoves

func (gs *GameHelper) PerformMoves(eoa *dsl.EOA, game *FaultDisputeGame, moves []GameHelperMove) []*Claim

type GameHelperEOA

type GameHelperEOA struct {
	EOA *dsl.EOA
	// contains filtered or unexported fields
}

func (*GameHelperEOA) Address

func (a *GameHelperEOA) Address() common.Address

func (*GameHelperEOA) PerformMoves

func (a *GameHelperEOA) PerformMoves(game *FaultDisputeGame, moves ...GameHelperMove) []*Claim

type GameHelperMove

type GameHelperMove struct {
	ParentIdx *big.Int
	Claim     common.Hash
	Attack    bool
}

func Move

func Move(parentIdx int64, claim common.Hash, attack bool) GameHelperMove

type GameOpt

type GameOpt interface {
	Apply(cfg *GameCfg)
}

func WithFutureProposal

func WithFutureProposal() GameOpt

func WithL2SequenceNumber

func WithL2SequenceNumber(seqNum uint64) GameOpt

func WithRootClaim

func WithRootClaim(claim common.Hash) GameOpt

func WithSuperRootFrom

func WithSuperRootFrom(outputRoots ...eth.Bytes32) GameOpt

WithSuperRootFrom sets the output roots to use in a super root game. The length of outputRoots must match the number of chains in the super root.

func WithUnsafeProposal

func WithUnsafeProposal() GameOpt

func WithZKParent added in v1.19.5

func WithZKParent(parentIndex uint32) GameOpt

WithZKParent links a ZK game to an earlier ZK game in the factory. Without this option, StartZKGame uses the uint32 max sentinel for a root game.

type SuperFaultDisputeGame

type SuperFaultDisputeGame struct {
	*FaultDisputeGame
}

func NewSuperFaultDisputeGame

func NewSuperFaultDisputeGame(
	t devtest.T,
	require *require.Assertions,
	addr common.Address,
	helperProvider gameHelperProvider,
	honestTrace func(game *FaultDisputeGame) types.TraceAccessor,
	game *bindings.FaultDisputeGame,
) *SuperFaultDisputeGame

func (*SuperFaultDisputeGame) StartingL2SequenceNumber

func (g *SuperFaultDisputeGame) StartingL2SequenceNumber() uint64

type ZKClaimData added in v1.19.5

type ZKClaimData struct {
	ParentIndex uint32
	Status      uint8
	Challenger  common.Address
	Prover      common.Address
	Deadline    uint64
	Claim       common.Hash
}

type ZKDisputeGame added in v1.17.0

type ZKDisputeGame struct {
	Address common.Address
	Args    gameargs.ZKGameArgs
}

ZKDisputeGame holds the impl address and parsed args for a deployed ZK dispute game.

type ZKGame added in v1.19.5

type ZKGame struct {
	Address common.Address
	// contains filtered or unexported fields
}

ZKGame is a deployed ZK dispute-game instance. It exposes the contract calls used to exercise the game lifecycle in acceptance tests.

func (*ZKGame) BondDistributionMode added in v1.19.5

func (g *ZKGame) BondDistributionMode() challengerTypes.BondDistributionMode

func (*ZKGame) Challenge added in v1.19.5

func (g *ZKGame) Challenge(challenger *dsl.EOA) ZKClaimData

func (*ZKGame) ChallengerBond added in v1.19.5

func (g *ZKGame) ChallengerBond() eth.ETH

func (*ZKGame) ClaimCredit added in v1.19.5

func (g *ZKGame) ClaimCredit(eoa *dsl.EOA, recipient common.Address)

func (*ZKGame) ClaimData added in v1.19.5

func (g *ZKGame) ClaimData() ZKClaimData

func (*ZKGame) Close added in v1.19.5

func (g *ZKGame) Close(eoa *dsl.EOA)

func (*ZKGame) Credit added in v1.19.5

func (g *ZKGame) Credit(recipient common.Address) eth.ETH

func (*ZKGame) FactoryIndex added in v1.19.5

func (g *ZKGame) FactoryIndex() uint32

func (*ZKGame) GameOver added in v1.19.5

func (g *ZKGame) GameOver() bool

func (*ZKGame) GameStatus added in v1.19.5

func (g *ZKGame) GameStatus() gameTypes.GameStatus

func (*ZKGame) L2SequenceNumber added in v1.19.5

func (g *ZKGame) L2SequenceNumber() uint64

func (*ZKGame) ParentIndex added in v1.19.5

func (g *ZKGame) ParentIndex() uint32

func (*ZKGame) ProposalStatus added in v1.19.5

func (g *ZKGame) ProposalStatus() ZKProposalStatus

func (*ZKGame) Resolve added in v1.19.5

func (g *ZKGame) Resolve(eoa *dsl.EOA) gameTypes.GameStatus

func (*ZKGame) ResolvedAt added in v1.19.5

func (g *ZKGame) ResolvedAt() uint64

func (*ZKGame) RootClaimValue added in v1.19.5

func (g *ZKGame) RootClaimValue() common.Hash

func (*ZKGame) WaitForClaimData added in v1.19.5

func (g *ZKGame) WaitForClaimData(ctx context.Context) (ZKClaimData, error)

WaitForClaimData retries transient read failures until ctx ends or the DSL timeout elapses.

func (*ZKGame) WaitForClaimedCredit added in v1.19.5

func (g *ZKGame) WaitForClaimedCredit(recipient common.Address)

WaitForClaimedCredit waits until the game has distributed bonds (NormalDistributionMode) and the recipient has no unclaimed credit remaining, i.e. the honest challenger closed the game and claimed.

func (*ZKGame) WaitForGameStatus added in v1.19.5

func (g *ZKGame) WaitForGameStatus(expected gameTypes.GameStatus)

WaitForGameStatus polls the game status until it reaches expected or the timeout elapses.

func (*ZKGame) WaitForProposalStatus added in v1.19.5

func (g *ZKGame) WaitForProposalStatus(expected ZKProposalStatus)

WaitForProposalStatus polls the proposal status until it reaches expected or the timeout elapses.

type ZKProposalStatus added in v1.19.5

type ZKProposalStatus = challengerContracts.ProposalStatus

type ZKWithdrawal added in v1.19.5

type ZKWithdrawal struct {
	Amount    *big.Int
	Timestamp *big.Int
}

ZKWithdrawal mirrors DelayedWETH's WithdrawalRequest struct (amount, timestamp), as returned by the public withdrawals mapping getter.

func (ZKWithdrawal) MaturesAt added in v1.19.5

func (w ZKWithdrawal) MaturesAt(delay *big.Int) uint64

MaturesAt returns the first L1 timestamp at which this withdrawal can be paid out under the given DelayedWETH delay (DelayedWETH.withdraw requires `timestamp + delay <= block.timestamp`).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL