Documentation
¶
Index ¶
- 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 DisputeGameFactory
- func (f *DisputeGameFactory) Address() common.Address
- func (f *DisputeGameFactory) CreateHelperEOA(eoa *dsl.EOA) *GameHelperEOA
- 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) StartCannonGame(eoa *dsl.EOA, opts ...GameOpt) *FaultDisputeGame
- func (f *DisputeGameFactory) StartCannonKonaGame(eoa *dsl.EOA, opts ...GameOpt) *FaultDisputeGame
- func (f *DisputeGameFactory) StartSuperCannonKonaGame(eoa *dsl.EOA, opts ...GameOpt) *SuperFaultDisputeGame
- 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) 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) 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) MaxDepth() challengerTypes.Depth
- func (g *FaultDisputeGame) PerformMoves(eoa *dsl.EOA, moves ...GameHelperMove) []*Claim
- func (g *FaultDisputeGame) RootClaim() *Claim
- func (g *FaultDisputeGame) SplitDepth() challengerTypes.Depth
- func (g *FaultDisputeGame) StartingL2SequenceNumber() uint64
- 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 ZKDisputeGame
- type ZKGameArgs
Constants ¶
This section is empty.
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 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) 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) StartCannonGame ¶
func (f *DisputeGameFactory) StartCannonGame(eoa *dsl.EOA, opts ...GameOpt) *FaultDisputeGame
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) 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) 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) 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) MaxDepth ¶
func (g *FaultDisputeGame) MaxDepth() challengerTypes.Depth
func (*FaultDisputeGame) PerformMoves ¶
func (g *FaultDisputeGame) PerformMoves(eoa *dsl.EOA, moves ...GameHelperMove) []*Claim
func (*FaultDisputeGame) RootClaim ¶
func (g *FaultDisputeGame) RootClaim() *Claim
func (*FaultDisputeGame) SplitDepth ¶
func (g *FaultDisputeGame) SplitDepth() challengerTypes.Depth
func (*FaultDisputeGame) StartingL2SequenceNumber ¶
func (g *FaultDisputeGame) StartingL2SequenceNumber() uint64
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
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 ZKDisputeGame ¶ added in v1.17.0
type ZKDisputeGame struct {
Address common.Address
Args ZKGameArgs
}
ZKDisputeGame holds the impl address and parsed args for a deployed ZK dispute game.
type ZKGameArgs ¶ added in v1.17.0
type ZKGameArgs struct {
AbsolutePrestate common.Hash
Verifier common.Address
MaxChallengeDuration uint64
MaxProveDuration uint64
ChallengerBond *big.Int
AnchorStateRegistry common.Address
WETH common.Address
L2ChainID *big.Int
}
ZKGameArgs contains the parsed arguments for a ZK dispute game template.