Documentation ¶
Index ¶
Constants ¶
const ( L1NodeURLFlagName = "l1.node.url" EventBlockRangeFlagName = "event.block.range" StartingL1BlockHeightFlagName = "start.block.height" SafeAddressFlagName = "safe.address" LivenessModuleAddressFlagName = "livenessmodule.address" LivenessGuardAddressFlagName = "livenessguard.address" )
const (
MetricsNamespace = "liveness_expiration_mon"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLIConfig ¶
type CLIConfig struct { L1NodeURL string EventBlockRange uint64 StartingL1BlockHeight uint64 LivenessModuleAddress common.Address LivenessGuardAddress common.Address SafeAddress common.Address }
func ReadCLIFlags ¶
type Monitor ¶
type Monitor struct { /** Contracts **/ GnosisSafe *bindings.GnosisSafe GnosisSafeAddress common.Address LivenessGuard *bindings.LivenessGuard LivenessGuardAddress common.Address LivenessModule *bindings.LivenessModule LivenessModuleAddress common.Address // contains filtered or unexported fields }
func NewMonitor ¶
func NewMonitor(ctx context.Context, log log.Logger, m metrics.Factory, cfg CLIConfig) (*Monitor, error)
NewMonitor creates a new monitor.
func (*Monitor) Run ¶
Run is the main loop of the monitor. This loop will update the metrics `blockTimestamp`, `highestBlockNumber`, `lastLiveOfAOwner`, `intervalLiveness`. Thanks to these metrics we can monitor the liveness expiration through (block.timestamp + BUFFER > lastLive(owner) + livenessInterval). NOTE: // Liveness module mainnet -> https://etherscan.io/address/0x0454092516c9A4d636d3CAfA1e82161376C8a748 Liveness guard mainnet -> https://etherscan.io/address/0x24424336F04440b1c28685a38303aC33C9D14a25 1. call the safe.owners() 2. livenessGuard.lastLive(owner) 3. save the livenessInterval() 4. Ensure that the invariant is not broken -> (block.timestamp + BUFFER > lastLive(owner) + livenessInterval) == true