Documentation
¶
Index ¶
- Constants
- func FaultDetectionPrepare(cfg *core.InvSessionParams) error
- func NewBalanceInvariant(cfg *BalanceInvConfig) (invariant.Invariant, error)
- func NewEventInvariant(cfg *EventInvConfig) invariant.Invariant
- func NewFaultDetector(ctx context.Context, cfg *FaultDetectorCfg) (invariant.Invariant, error)
- func NewWithdrawalEnforceInv(ctx context.Context, cfg *WithdrawalEnforceCfg) (invariant.Invariant, error)
- func ValidateAddressing(cfg *core.InvSessionParams) error
- func ValidateEventTracking(cfg *core.InvSessionParams) error
- func ValidateNoTopicsExist(cfg *core.InvSessionParams) error
- func ValidateTopicsExist(cfg *core.InvSessionParams) error
- func WithdrawEnforcePrepare(cfg *core.InvSessionParams) error
- type BalanceInvConfig
- type BalanceInvariant
- type EventInvConfig
- type EventInvariant
- type FaultDetectorCfg
- type InvRegister
- type InvariantTable
- 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.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 ¶
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 ¶
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 ¶
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
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 ¶
WithdrawalEnforceInv ... WithdrawalEnforceInvariant implementation
func (*WithdrawalEnforceInv) Invalidate ¶
func (wi *WithdrawalEnforceInv) Invalidate(td core.TransitData) (*core.Invalidation, bool, error)
Invalidate ... Verifies than an L1 WithdrawalProven has a correlating hash to the withdrawal storage of the L2ToL1MessagePasser