registry

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 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.SessionParams) error

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

func NewBalanceHeuristic added in v1.0.0

func NewBalanceHeuristic(cfg *BalanceInvConfig) (heuristic.Heuristic, error)

NewBalanceHeuristic ... Initializer

func NewEventHeuristic added in v1.0.0

func NewEventHeuristic(cfg *EventInvConfig) heuristic.Heuristic

NewEventHeuristic ... Initializer

func NewFaultDetector

func NewFaultDetector(ctx context.Context, cfg *FaultDetectorCfg) (heuristic.Heuristic, error)

NewFaultDetector ... Initializer

func NewWithdrawalEnforceInv

func NewWithdrawalEnforceInv(ctx context.Context, cfg *WithdrawalEnforceCfg) (heuristic.Heuristic, error)

NewWithdrawalEnforceInv ... Initializer

func ValidateAddressing

func ValidateAddressing(cfg *core.SessionParams) error

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

func ValidateEventTracking

func ValidateEventTracking(cfg *core.SessionParams) error

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

func ValidateNoTopicsExist

func ValidateNoTopicsExist(cfg *core.SessionParams) error

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

func ValidateTopicsExist

func ValidateTopicsExist(cfg *core.SessionParams) error

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

func WithdrawEnforcePrepare

func WithdrawEnforcePrepare(cfg *core.SessionParams) 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 BalanceHeuristic added in v1.0.0

type BalanceHeuristic struct {
	heuristic.Heuristic
	// contains filtered or unexported fields
}

BalanceHeuristic ...

func (*BalanceHeuristic) Assess added in v1.0.0

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

type BalanceInvConfig

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

BalanceInvConfig ... Configuration for the balance heuristic

func (*BalanceInvConfig) Unmarshal

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

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

type EventHeuristic added in v1.0.0

type EventHeuristic struct {
	heuristic.Heuristic
	// contains filtered or unexported fields
}

EventHeuristic ...

func (*EventHeuristic) Assess added in v1.0.0

func (ei *EventHeuristic) Assess(td core.TransitData) (*core.Activation, bool, error)

Assess ... 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 heuristic

func (*EventInvConfig) Unmarshal

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

Unmarshal ... Converts a general config to an event heuristic 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 heuristic

func (*FaultDetectorCfg) Unmarshal

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

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

type HeuristicTable added in v1.0.0

type HeuristicTable map[core.HeuristicType]*InvRegister

HeuristicTable ... Heuristic table

func NewHeuristicTable added in v1.0.0

func NewHeuristicTable() HeuristicTable

NewHeuristicTable ... Initializer

type InvRegister

type InvRegister struct {
	PrepareValidate func(*core.SessionParams) error
	Policy          core.ChainSubscription
	InputType       core.RegisterType
	Constructor     func(ctx context.Context, isp *core.SessionParams) (heuristic.Heuristic, error)
}

InvRegister ... Heuristic register struct

type WithdrawalEnforceCfg

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

WithdrawalEnforceCfg ... Configuration for the balance heuristic

func (*WithdrawalEnforceCfg) Unmarshal

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

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

type WithdrawalEnforceInv

type WithdrawalEnforceInv struct {
	heuristic.Heuristic
	// contains filtered or unexported fields
}

WithdrawalEnforceInv ... WithdrawalEnforceHeuristic implementation

func (*WithdrawalEnforceInv) Assess added in v1.0.0

Assess ... 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