registry

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Event declaration strings
	OutputProposedEvent   = "OutputProposed(bytes32,uint256,uint256,uint256)"
	WithdrawalProvenEvent = "WithdrawalProven(bytes32,address,address)"
)

Variables

This section is empty.

Functions

func FaultDetectionPrepare

func FaultDetectionPrepare(cfg *core.InvSessionParams) error

FaultDetectionPrepare ... Configures the session params with the appropriate address key and nested args for the ETL to subscribe to L2OutputOracle events

func NewBalanceInvariant

func NewBalanceInvariant(cfg *BalanceInvConfig) (invariant.Invariant, error)

NewBalanceInvariant ... Initializer

func NewEventInvariant

func NewEventInvariant(cfg *EventInvConfig) invariant.Invariant

NewEventInvariant ... Initializer

func NewFaultDetector

func NewFaultDetector(ctx context.Context, cfg *FaultDetectorCfg) (invariant.Invariant, error)

NewFaultDetector ... Initializer

func NewWithdrawalEnforceInv

func NewWithdrawalEnforceInv(ctx context.Context, cfg *WithdrawalEnforceCfg) (invariant.Invariant, error)

NewWithdrawalEnforceInv ... Initializer

func ValidateAddressing

func ValidateAddressing(cfg *core.InvSessionParams) error

ValidateAddressing ... Ensures that an address exists in the session params

func ValidateEventTracking

func ValidateEventTracking(cfg *core.InvSessionParams) error

ValidateEventTracking ... Ensures that an address and nested args exist in the session params

func ValidateNoTopicsExist

func ValidateNoTopicsExist(cfg *core.InvSessionParams) error

ValidateNoTopicsExist ... Ensures that no nested args exist in the session params

func ValidateTopicsExist

func ValidateTopicsExist(cfg *core.InvSessionParams) error

ValidateTopicsExist ... Ensures that some nested args exist in the session params

func WithdrawEnforcePrepare

func WithdrawEnforcePrepare(cfg *core.InvSessionParams) error

WithdrawEnforcePrepare ... Ensures that the l2 to l1 message passer exists and performs a "hack" operation to set the address key as the l2tol1MessagePasser address for upstream ETL components (ie. event log) to know which L1 address to query for events

Types

type BalanceInvConfig

type BalanceInvConfig struct {
	Address    string   `json:"address"`
	UpperBound *float64 `json:"upper"`
	LowerBound *float64 `json:"lower"`
}

BalanceInvConfig ... Configuration for the balance invariant

func (*BalanceInvConfig) Unmarshal

func (bi *BalanceInvConfig) Unmarshal(isp *core.InvSessionParams) error

Unmarshal ... Converts a general config to a balance invariant config

type BalanceInvariant

type BalanceInvariant struct {
	invariant.Invariant
	// contains filtered or unexported fields
}

BalanceInvariant ...

func (*BalanceInvariant) Invalidate

func (bi *BalanceInvariant) Invalidate(td core.TransitData) (*core.Invalidation, bool, error)

Invalidate ... Checks if the balance is within the bounds specified in the config

type EventInvConfig

type EventInvConfig struct {
	ContractName string   `json:"contract_name"`
	Address      string   `json:"address"`
	Sigs         []string `json:"args"`
}

EventInvConfig ... Configuration for the event invariant

func (*EventInvConfig) Unmarshal

func (eic *EventInvConfig) Unmarshal(isp *core.InvSessionParams) error

Unmarshal ... Converts a general config to an event invariant config

type EventInvariant

type EventInvariant struct {
	invariant.Invariant
	// contains filtered or unexported fields
}

EventInvariant ...

func (*EventInvariant) Invalidate

func (ei *EventInvariant) Invalidate(td core.TransitData) (*core.Invalidation, bool, error)

Invalidate ... Checks if the balance is within the bounds specified in the config

type FaultDetectorCfg

type FaultDetectorCfg struct {
	L2OutputOracle string `json:"l2_output_address"`
	L2ToL1Address  string `json:"l2_to_l1_address"`
}

FaultDetectorCfg ... Configuration for the fault detector invariant

func (*FaultDetectorCfg) Unmarshal

func (fdc *FaultDetectorCfg) Unmarshal(isp *core.InvSessionParams) error

Unmarshal ... Converts a general config to a fault detector invariant config

type InvRegister

type InvRegister struct {
	PrepareValidate func(*core.InvSessionParams) error
	Policy          core.ChainSubscription
	InputType       core.RegisterType
	Constructor     func(ctx context.Context, isp *core.InvSessionParams) (invariant.Invariant, error)
}

InvRegister ... Invariant register struct

type InvariantTable

type InvariantTable map[core.InvariantType]*InvRegister

InvariantTable ... Invariant table

func NewInvariantTable

func NewInvariantTable() InvariantTable

NewInvariantTable ... Initializer

type WithdrawalEnforceCfg

type WithdrawalEnforceCfg struct {
	L1PortalAddress string `json:"l1_portal_address"`
	L2ToL1Address   string `json:"l2_to_l1_address"`
}

WithdrawalEnforceCfg ... Configuration for the balance invariant

func (*WithdrawalEnforceCfg) Unmarshal

func (cfg *WithdrawalEnforceCfg) Unmarshal(isp *core.InvSessionParams) error

Unmarshal ... Converts a general config to a balance invariant config

type WithdrawalEnforceInv

type WithdrawalEnforceInv struct {
	invariant.Invariant
	// contains filtered or unexported fields
}

WithdrawalEnforceInv ... WithdrawalEnforceInvariant implementation

func (*WithdrawalEnforceInv) Invalidate

Invalidate ... Verifies than an L1 WithdrawalProven has a correlating hash to the withdrawal storage of the L2ToL1MessagePasser

Jump to

Keyboard shortcuts

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