Documentation ¶
Index ¶
- Constants
- func FaultDetectionPrepare(cfg *core.SessionParams) error
- func NewBalanceHeuristic(cfg *BalanceInvConfig) (heuristic.Heuristic, error)
- func NewEventHeuristic(cfg *EventInvConfig) heuristic.Heuristic
- func NewFaultDetector(ctx context.Context, cfg *FaultDetectorCfg) (heuristic.Heuristic, error)
- func NewWithdrawalEnforceInv(ctx context.Context, cfg *WithdrawalEnforceCfg) (heuristic.Heuristic, error)
- func ValidateAddressing(cfg *core.SessionParams) error
- func ValidateEventTracking(cfg *core.SessionParams) error
- func ValidateNoTopicsExist(cfg *core.SessionParams) error
- func ValidateTopicsExist(cfg *core.SessionParams) error
- func WithdrawEnforcePrepare(cfg *core.SessionParams) error
- type BalanceHeuristic
- type BalanceInvConfig
- type EventHeuristic
- type EventInvConfig
- type FaultDetectorCfg
- type HeuristicTable
- type InvRegister
- type WithdrawalEnforceCfg
- type WithdrawalEnforceInv
Constants ¶
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 ¶
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
BalanceHeuristic ...
func (*BalanceHeuristic) Assess ¶ added in v1.0.0
func (bi *BalanceHeuristic) Assess(td core.TransitData) (*core.Activation, bool, error)
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
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 ¶
WithdrawalEnforceInv ... WithdrawalEnforceHeuristic implementation
func (*WithdrawalEnforceInv) Assess ¶ added in v1.0.0
func (wi *WithdrawalEnforceInv) Assess(td core.TransitData) (*core.Activation, bool, error)
Assess ... Verifies than an L1 WithdrawalProven has a correlating hash to the withdrawal storage of the L2ToL1MessagePasser