admin

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

README

Omni Contract Admin Commands

Defines contract admin commands for live omni networks.

Contract Specs

We define a number of ensure-<contract>-spec commands. These commands apply local contract specifications defined in here to live contracts, if necessary. This includes pausing / unpausing, setting parameters, etc.

ensure-bridge-spec
  • specs defined in bridgespec.go
  • manages OmniBridgeL1 and OmniBridgeNative contracts
ensure-portal-spec
  • specs defined in portalspec.go
  • manages OmniPortal deployments

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowOperators

func AllowOperators(ctx context.Context, def app.Definition, cfg Config) error

AllowOperators ensures that all operators hard-coded in this package is allowed as validators. Note it only adds any of the operators that are missing, it doesn't remove any ever.

func EnsureBridgeSpec

func EnsureBridgeSpec(ctx context.Context, def app.Definition, cfg Config, specOverride *NetworkBridgeSpec) error

EnsureBridgeSpec ensures that live bridge contracts are configured as per the local spec.

func EnsurePortalSpec

func EnsurePortalSpec(ctx context.Context, def app.Definition, cfg Config, localSpecOverride *PortalSpec) error

EnsurePortalSpec ensures that live portal contracts are configured as per the local spec.

func PlanUpgrade added in v0.9.0

func PlanUpgrade(ctx context.Context, def app.Definition, cfg Config) error

PlanUpgrade plans the above configured network upgrade.

func Test

func Test(ctx context.Context, def app.Definition) error

Test tests all admin commands against an ephemeral network.

func UpgradeBridgeL1

func UpgradeBridgeL1(ctx context.Context, def app.Definition, cfg Config) error

UpgradeBridgeL1 upgrades the OmniBridgeL1 contract.

func UpgradeBridgeNative

func UpgradeBridgeNative(ctx context.Context, def app.Definition, cfg Config) error

UpgradeBridgeNative upgrades the OmniBridgeNative predeploy.

func UpgradeFeeOracleV1

func UpgradeFeeOracleV1(ctx context.Context, def app.Definition, cfg Config) error

UpgradeFeeOracleV1 upgrades the FeeOracleV1 contracts on a network.

func UpgradeGasPump

func UpgradeGasPump(ctx context.Context, def app.Definition, cfg Config) error

UpgradeGasPump upgrades the OmniGasPump contracts on a network.

func UpgradeGasStation

func UpgradeGasStation(ctx context.Context, def app.Definition, cfg Config) error

UpgradeGasStation upgrades the GasStation contracts on a network.

func UpgradePortal

func UpgradePortal(ctx context.Context, def app.Definition, cfg Config) error

UpgradePortal upgrades the portal contracts on a network.

func UpgradePortalRegistry

func UpgradePortalRegistry(ctx context.Context, def app.Definition, cfg Config) error

UpgradePortalRegistry upgrades the PortalRegistry predeploy.

func UpgradeSlashing

func UpgradeSlashing(ctx context.Context, def app.Definition, cfg Config) error

UpgradeSlashing upgrades the Slashing predeploy.

func UpgradeStaking

func UpgradeStaking(ctx context.Context, def app.Definition, cfg Config) error

UpgradeStaking upgrades the Staking predeploy.

Types

type BridgeCommon

type BridgeCommon interface {
	// KeyPauseAll returns the key for pausing all actions (PauseableUpgradeable.KeyPauseAll)
	KeyPauseAll(opts *bind.CallOpts) ([32]byte, error)

	// ACTIONWITHDRAW returns the key for pausing withdraws (OmniBridgeCommon.ACTION_WITHDRAW)
	ACTIONWITHDRAW(opts *bind.CallOpts) ([32]byte, error)

	// ACTIONBRIDGE returns the key for pausing bridge actions (OmniBridgeCommon.ACTION_BRIDGE)
	ACTIONBRIDGE(opts *bind.CallOpts) ([32]byte, error)

	// IsPaused returns true if the action is paused
	IsPaused(opts *bind.CallOpts, action [32]byte) (bool, error)
}

BridgeCommon is a common interface between native and L1 bridge contracts. It lists a subset of OmniBridgeCommon views.

type BridgeDirectives

type BridgeDirectives struct {
	PauseAll        bool
	UnpauseAll      bool
	PauseWithdraw   bool
	UnpauseWithdraw bool
	PauseBridge     bool
	UnpauseBridge   bool
}

BridgeDirectives define updates required for a bridge contract to match the spec.

type BridgeSpec

type BridgeSpec struct {
	PauseAll      bool
	PauseWithdraw bool
	PauseBridge   bool
}

BridgeSpec is the specification for a bridge contract (native or L1).

func (BridgeSpec) Verify

func (s BridgeSpec) Verify() error

Verify checks that there are no conflicting specifications.

type Config

type Config struct {
	// Broadcast  determines whether or not transactions.
	Broadcast bool

	// Chain is the name of chain to run on. Leave empty to run on all applicable chains.
	Chain string
}

func DefaultConfig

func DefaultConfig() Config

type NetworkBridgeDirectives

type NetworkBridgeDirectives struct {
	Native BridgeDirectives
	L1     BridgeDirectives
}

NetworkBridgeDirectives defines the bridge directives for a network, both native and L1.

type NetworkBridgeSpec

type NetworkBridgeSpec struct {
	Native BridgeSpec
	L1     BridgeSpec
}

NetworkBridgeSpec defines the bridge spec for a network, both native and L1.

func DefaultBridgeSpec

func DefaultBridgeSpec() NetworkBridgeSpec

type NetworkPortalSpec

type NetworkPortalSpec struct {
	// Global is the portal spec, maintained on all chains.
	Global PortalSpec

	// ChainOverrides overrides the global spec for specific chains. Must specify full spec, not just diff.
	ChainOverrides map[uint64]*PortalSpec
}

type PortalDirectives

type PortalDirectives struct {
	// PauseAll indicates that all actions on the portal should be paused.
	PauseAll bool

	// UnpauseAll indicates that all actions on the portal should be unpaused.
	UnpauseAll bool

	// PauseXCall indicates that all xcalls should be paused.
	PauseXCall bool

	// UnpauseXCall indicates that all xcalls should be unpaused.
	UnpauseXCall bool

	// PauseXCallTo indicates that xcalls to specific chains should be paused.
	PauseXCallTo []uint64

	// UnpauseXCallTo indicates that xcalls to specific chains should be unpaused.
	UnpauseXCallTo []uint64

	// PauseXSubmit indicates that all xsubmits should be paused.
	PauseXSubmit bool

	// UnpauseXSubmit indicates that all xsubmits should be unpaused.
	UnpauseXSubmit bool

	// PauseXSubmitFrom indicates that xsubmits from specific chains should be paused.
	PauseXSubmitFrom []uint64

	// UnpauseXSubmitFrom indicates that xsubmits from specific chains should be unpaused.
	UnpauseXSubmitFrom []uint64
}

PortalDirectives defines updates required on a portal to match a spec.

func (PortalDirectives) Verify

func (d PortalDirectives) Verify() error

Verify checks that there are no conflicting directives.

type PortalSpec

type PortalSpec struct {
	// PauseAll indicates that all actions on the portal should be paused.
	PauseAll bool

	// PauseXCall indicates that all xcalls should be paused.
	PauseXCall bool

	// PauseXCallTo indicates that xcalls to specific chains should be paused.
	PauseXCallTo []uint64

	// PauseXSubmit indicates that all xsubmits should be paused.
	PauseXSubmit bool

	// PauseXSubmitFrom indicates that xsubmits from specific chains should be paused.
	PauseXSubmitFrom []uint64
}

PortalSpec is the specification for the OmniPortal contract.

func DefaultPortalSpec

func DefaultPortalSpec() PortalSpec

func (PortalSpec) Verify

func (s PortalSpec) Verify() error

Verify checks that there are no conflicting specifications.

Jump to

Keyboard shortcuts

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