embedded

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultUpgrader = new(Upgrader)

Functions

func Upgrade

func Upgrade(host *script.Host, input UpgradeOPChainInput) error

func UpgradeSuperchainConfig

func UpgradeSuperchainConfig(host *script.Host, input UpgradeSuperchainConfigInput) error

Types

type DisputeGameConfig

type DisputeGameConfig struct {
	Enabled                            bool                                `json:"enabled"`
	InitBond                           *big.Int                            `json:"initBond"`
	GameType                           GameType                            `json:"gameType"`
	FaultDisputeGameConfig             *FaultDisputeGameConfig             `json:"faultDisputeGameConfig,omitempty"`
	PermissionedDisputeGameConfig      *PermissionedDisputeGameConfig      `json:"permissionedDisputeGameConfig,omitempty"`
	SuperPermissionedDisputeGameConfig *SuperPermissionedDisputeGameConfig `json:"superPermissionedDisputeGameConfig,omitempty"`
	ZKDisputeGameConfig                *ZKDisputeGameConfig                `json:"zkDisputeGameConfig,omitempty"`
}

DisputeGameConfig represents the configuration for a dispute game.

type EncodableDisputeGameConfig

type EncodableDisputeGameConfig struct {
	Enabled  bool
	InitBond *big.Int
	GameType uint32
	GameArgs []byte
}

EncodableDisputeGameConfig is an intermediate struct that matches the encoder expectation.

type EncodableUpgradeInput

type EncodableUpgradeInput struct {
	SystemConfig       common.Address
	DisputeGameConfigs []EncodableDisputeGameConfig
	ExtraInstructions  []ExtraInstruction
}

EncodableUpgradeInput is an intermediate struct that matches the encoder expectation for the UpgradeInputV2 struct.

type ExtraInstruction

type ExtraInstruction struct {
	Key  string `json:"key"`
	Data []byte `json:"data"`
}

ExtraInstruction represents an additional upgrade instruction for the upgrade on OPCM v2.

type FaultDisputeGameConfig

type FaultDisputeGameConfig struct {
	AbsolutePrestate common.Hash `json:"absolutePrestate"`
}

FaultDisputeGameConfig represents the configuration for a fault dispute game. It contains the absolute prestate of the fault dispute game.

type GameType

type GameType uint32

GameType represents the type of dispute game.

const (
	GameTypeCannon             GameType = 0
	GameTypePermissionedCannon GameType = 1
	GameTypeSuperPermissioned  GameType = 5
	GameTypeCannonKona         GameType = 8
	GameTypeSuperCannonKona    GameType = 9
	GameTypeZKDisputeGame      GameType = 10
)

type PermissionedDisputeGameConfig

type PermissionedDisputeGameConfig struct {
	AbsolutePrestate common.Hash    `json:"absolutePrestate"`
	Proposer         common.Address `json:"proposer"`
	Challenger       common.Address `json:"challenger"`
}

PermissionedDisputeGameConfig represents the configuration for a permissioned dispute game. It contains the absolute prestate, proposer, and challenger of the permissioned dispute game.

type ScriptInput

type ScriptInput struct {
	Prank        common.Address `evm:"prank"`
	Opcm         common.Address `evm:"opcm"`
	UpgradeInput []byte         `evm:"upgradeInput"`
}

ScriptInput represents the input struct that is actually passed to the script. It contains the prank, opcm, and upgrade input.

type SuperPermissionedDisputeGameConfig added in v1.19.0

type SuperPermissionedDisputeGameConfig struct {
	Proposer common.Address `json:"proposer"`
}

SuperPermissionedDisputeGameConfig represents the configuration for a super-permissioned dispute game. It contains the proposer of the super-permissioned dispute game.

type UpgradeInputV2

type UpgradeInputV2 struct {
	SystemConfig       common.Address      `json:"systemConfig"`
	DisputeGameConfigs []DisputeGameConfig `json:"disputeGameConfigs"`
	ExtraInstructions  []ExtraInstruction  `json:"extraInstructions"`
}

UpgradeInputV2 represents the upgrade input for OPCM v2.

type UpgradeOPChain

type UpgradeOPChain struct {
	Run func(input common.Address)
}

type UpgradeOPChainInput

type UpgradeOPChainInput struct {
	Prank          common.Address  `json:"prank"`
	Opcm           common.Address  `json:"opcm"`
	UpgradeInputV2 *UpgradeInputV2 `json:"upgradeInput,omitempty"`
}

UpgradeOPChainInput represents the struct that is read from the config file.

func (*UpgradeOPChainInput) EncodedUpgradeInputV2

func (u *UpgradeOPChainInput) EncodedUpgradeInputV2() ([]byte, error)

EncodedUpgradeInputV2 encodes the upgrade input, assumes UpgradeInputV2 is not nil

type UpgradeSuperchainConfigInput

type UpgradeSuperchainConfigInput struct {
	Prank             common.Address     `json:"prank"`
	Opcm              common.Address     `json:"opcm"`
	SuperchainConfig  common.Address     `json:"superchainConfig"`
	ExtraInstructions []ExtraInstruction `json:"extraInstructions,omitempty"`
}

type UpgradeSuperchainConfigScript

type UpgradeSuperchainConfigScript script.DeployScriptWithoutOutput[UpgradeSuperchainConfigInput]

func NewUpgradeSuperchainConfigScript

func NewUpgradeSuperchainConfigScript(host *script.Host) (UpgradeSuperchainConfigScript, error)

NewDeployImplementationsScript loads and validates the DeployImplementations script contract

type Upgrader

type Upgrader struct{}

func (*Upgrader) ArtifactsURL

func (u *Upgrader) ArtifactsURL() string

func (*Upgrader) Upgrade

func (u *Upgrader) Upgrade(host *script.Host, input json.RawMessage) error

func (*Upgrader) UpgradeSuperchainConfig

func (u *Upgrader) UpgradeSuperchainConfig(host *script.Host, input json.RawMessage) error

type ZKDisputeGameConfig added in v1.17.0

type ZKDisputeGameConfig struct {
	AbsolutePrestate     common.Hash    `json:"absolutePrestate"`
	Verifier             common.Address `json:"verifier"`
	MaxChallengeDuration uint64         `json:"maxChallengeDuration"`
	MaxProveDuration     uint64         `json:"maxProveDuration"`
	ChallengerBond       *big.Int       `json:"challengerBond"`
}

ZKDisputeGameConfig represents the configuration for a ZK dispute game. It contains the absolute prestate, verifier address, challenge/prove durations, and challenger bond.

Jump to

Keyboard shortcuts

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