Documentation
¶
Index ¶
- Constants
- type ArtifactBytecode
- type ArtifactJSON
- type Claim
- func (c *Claim) Attack(eoa *dsl.EOA, newClaim common.Hash) *Claim
- func (c *Claim) Bond() *big.Int
- func (c *Claim) Claimant() common.Address
- func (c *Claim) CounteredBy() common.Address
- func (c *Claim) Defend(eoa *dsl.EOA, newClaim common.Hash) *Claim
- func (c *Claim) Depth() types.Depth
- func (c *Claim) Position() types.Position
- func (c *Claim) String() string
- func (c *Claim) Value() common.Hash
- func (c *Claim) VerifyNoCounterClaim()
- func (c *Claim) WaitForCounterClaim(ignoreClaims ...*Claim) *Claim
- func (c *Claim) WaitForCountered()
- type DelayedWETH
- type DisputeGameFactory
- func (f *DisputeGameFactory) Address() common.Address
- func (f *DisputeGameFactory) CreateHelperEOA(eoa *dsl.EOA) *GameHelperEOA
- func (f *DisputeGameFactory) DelayedWETH(addr common.Address) *DelayedWETH
- func (f *DisputeGameFactory) GameArgs(gameType gameTypes.GameType) []byte
- func (f *DisputeGameFactory) GameAtIndex(idx int64) *FaultDisputeGame
- func (f *DisputeGameFactory) GameCount() int64
- func (f *DisputeGameFactory) GameImpl(gameType gameTypes.GameType) *FaultDisputeGame
- func (f *DisputeGameFactory) RunFPP(startTimestamp uint64, endTimestamp uint64)
- func (f *DisputeGameFactory) StartCannonKonaGame(eoa *dsl.EOA, opts ...GameOpt) *FaultDisputeGame
- func (f *DisputeGameFactory) StartSuperCannonKonaGame(eoa *dsl.EOA, opts ...GameOpt) *SuperFaultDisputeGame
- func (f *DisputeGameFactory) StartSuperPermissionedGame(opts ...GameOpt) *SuperFaultDisputeGame
- func (f *DisputeGameFactory) StartZKGame(eoa *dsl.EOA, opts ...GameOpt) *ZKGame
- func (f *DisputeGameFactory) SuperGameAtIndex(idx int64) *SuperFaultDisputeGame
- func (f *DisputeGameFactory) VerifyGameImplAbsent(gameType gameTypes.GameType)
- func (f *DisputeGameFactory) VerifyGameImplPresent(gameType gameTypes.GameType)
- func (f *DisputeGameFactory) WaitForGame() *FaultDisputeGame
- func (f *DisputeGameFactory) WaitForSafeSuperRootAfter(sequence uint64) (uint64, []eth.Bytes32)
- func (f *DisputeGameFactory) WaitForZKGameAtIndex(idx int64) *ZKGame
- func (f *DisputeGameFactory) ZKGameAtIndex(idx uint32) *ZKGame
- func (f *DisputeGameFactory) ZKGameImpl() *ZKDisputeGame
- type FaultDisputeGame
- func (g *FaultDisputeGame) Attack(eoa *dsl.EOA, claimIdx uint64, newClaim common.Hash)
- func (g *FaultDisputeGame) ClaimAtIndex(claimIndex uint64) *Claim
- func (g *FaultDisputeGame) CreatedAt() uint64
- func (g *FaultDisputeGame) Defend(eoa *dsl.EOA, claimIdx uint64, newClaim common.Hash)
- func (g *FaultDisputeGame) DisputeL2SequenceNumber(eoa *dsl.EOA, startClaim *Claim, l2SequenceNumber uint64) *Claim
- func (g *FaultDisputeGame) DisputeToStep(eoa *dsl.EOA, startClaim *Claim, traceIndex uint64) *Claim
- func (g *FaultDisputeGame) GameData() string
- func (g *FaultDisputeGame) GameType() gameTypes.GameType
- func (g *FaultDisputeGame) L1Head() common.Hash
- func (g *FaultDisputeGame) L2SequenceNumber() uint64
- func (g *FaultDisputeGame) LogGameData()
- func (g *FaultDisputeGame) MaxClockDuration() time.Duration
- func (g *FaultDisputeGame) MaxDepth() challengerTypes.Depth
- func (g *FaultDisputeGame) PerformMoves(eoa *dsl.EOA, moves ...GameHelperMove) []*Claim
- func (g *FaultDisputeGame) Resolve(eoa *dsl.EOA)
- func (g *FaultDisputeGame) ResolveClaim(eoa *dsl.EOA, claimIdx uint64)
- func (g *FaultDisputeGame) RootClaim() *Claim
- func (g *FaultDisputeGame) RootClaimValue() common.Hash
- func (g *FaultDisputeGame) SplitDepth() challengerTypes.Depth
- func (g *FaultDisputeGame) StartingL2SequenceNumber() uint64
- func (g *FaultDisputeGame) VerifyGameType(expected gameTypes.GameType)
- func (g *FaultDisputeGame) WETHAddress() common.Address
- func (g *FaultDisputeGame) WaitForGameStatus(expected gameTypes.GameStatus)
- type GameCfg
- type GameHelper
- func (gs *GameHelper) AuthEOA(eoa *dsl.EOA) *GameHelper
- func (gs *GameHelper) CreateGameWithClaims(eoa *dsl.EOA, factory *DisputeGameFactory, gameType gameTypes.GameType, ...) common.Address
- func (gs *GameHelper) DisputeL2SequenceNumber(eoa *dsl.EOA, game *FaultDisputeGame, startClaim *Claim, ...) *Claim
- func (gs *GameHelper) DisputeToStep(eoa *dsl.EOA, game *FaultDisputeGame, startClaim *Claim, traceIndex uint64) *Claim
- func (gs *GameHelper) PerformMoves(eoa *dsl.EOA, game *FaultDisputeGame, moves []GameHelperMove) []*Claim
- type GameHelperEOA
- type GameHelperMove
- type GameOpt
- type SuperFaultDisputeGame
- type ZKClaimData
- type ZKDisputeGame
- type ZKGame
- func (g *ZKGame) AwaitRootSourcePastL1Head(source dsl.SuperRootSource)
- func (g *ZKGame) BondDistributionMode() challengerTypes.BondDistributionMode
- func (g *ZKGame) Challenge(challenger *dsl.EOA) ZKClaimData
- func (g *ZKGame) ChallengerBond() eth.ETH
- func (g *ZKGame) ClaimCredit(eoa *dsl.EOA, recipient common.Address)
- func (g *ZKGame) ClaimData() ZKClaimData
- func (g *ZKGame) Close(eoa *dsl.EOA)
- func (g *ZKGame) Credit(recipient common.Address) eth.ETH
- func (g *ZKGame) FactoryIndex() uint32
- func (g *ZKGame) GameOver() bool
- func (g *ZKGame) GameStatus() gameTypes.GameStatus
- func (g *ZKGame) L1Head() common.Hash
- func (g *ZKGame) L2SequenceNumber() uint64
- func (g *ZKGame) ParentIndex() uint32
- func (g *ZKGame) ProposalStatus() ZKProposalStatus
- func (g *ZKGame) Resolve(eoa *dsl.EOA) gameTypes.GameStatus
- func (g *ZKGame) ResolvedAt() uint64
- func (g *ZKGame) RootClaimValue() common.Hash
- func (g *ZKGame) TotalBonds() eth.ETH
- func (g *ZKGame) WETHAddress() common.Address
- func (g *ZKGame) WaitForClaimData(ctx context.Context) (ZKClaimData, error)
- func (g *ZKGame) WaitForClaimedCredit(recipient common.Address)
- func (g *ZKGame) WaitForGameStatus(expected gameTypes.GameStatus)
- func (g *ZKGame) WaitForProposalStatus(expected ZKProposalStatus)
- type ZKProposalStatus
- type ZKWithdrawal
Constants ¶
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) CounteredBy ¶
func (*Claim) VerifyNoCounterClaim ¶
func (c *Claim) VerifyNoCounterClaim()
func (*Claim) WaitForCounterClaim ¶
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 (*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 ¶
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) ClaimAtIndex ¶
func (g *FaultDisputeGame) ClaimAtIndex(claimIndex uint64) *Claim
func (*FaultDisputeGame) CreatedAt ¶ added in v1.19.5
func (g *FaultDisputeGame) CreatedAt() uint64
func (*FaultDisputeGame) DisputeL2SequenceNumber ¶
func (*FaultDisputeGame) DisputeToStep ¶
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 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 ¶
func (*GameHelperEOA) Address ¶
func (a *GameHelperEOA) Address() common.Address
func (*GameHelperEOA) PerformMoves ¶
func (a *GameHelperEOA) PerformMoves(game *FaultDisputeGame, moves ...GameHelperMove) []*Claim
type GameHelperMove ¶
type GameOpt ¶
type GameOpt interface {
Apply(cfg *GameCfg)
}
func WithFutureProposal ¶
func WithFutureProposal() GameOpt
func WithL2SequenceNumber ¶
func WithRootClaim ¶
func WithSuperRootFrom ¶
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
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 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
ZKGame is a deployed ZK dispute-game instance. It exposes the contract calls used to exercise the game lifecycle in acceptance tests.
func (*ZKGame) AwaitRootSourcePastL1Head ¶ added in v1.19.6
func (g *ZKGame) AwaitRootSourcePastL1Head(source dsl.SuperRootSource)
AwaitRootSourcePastL1Head waits until source has fully processed the L1 snapshot pinned by this game.
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 (*ZKGame) ClaimCredit ¶ added in v1.19.5
func (*ZKGame) ClaimData ¶ added in v1.19.5
func (g *ZKGame) ClaimData() ZKClaimData
func (*ZKGame) FactoryIndex ¶ added in v1.19.5
func (*ZKGame) GameStatus ¶ added in v1.19.5
func (g *ZKGame) GameStatus() gameTypes.GameStatus
func (*ZKGame) L2SequenceNumber ¶ added in v1.19.5
func (*ZKGame) ParentIndex ¶ added in v1.19.5
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 (*ZKGame) RootClaimValue ¶ added in v1.19.5
func (*ZKGame) TotalBonds ¶ added in v1.19.6
func (*ZKGame) WETHAddress ¶ added in v1.19.6
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
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
ZKWithdrawal mirrors DelayedWETH's WithdrawalRequest struct (amount, timestamp), as returned by the public withdrawals mapping getter.