timelockdelay

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsetTimelockDelayUnverified = errors.New("timelock delay unset and unable to resolve from on-chain minDelay")

ErrUnsetTimelockDelayUnverified indicates a schedule proposal has no delay set and on-chain minDelay could not be read for every timelock chain.

Functions

func CorrectTimelockDelays

func CorrectTimelockDelays(
	ctx context.Context,
	lggr logger.Logger,
	blockChains chain.BlockChains,
	proposals []mcms.TimelockProposal,
) error

CorrectTimelockDelays updates schedule proposal delays using on-chain minDelay from blockChains. Unset or too-low delays are bumped to the max on-chain minDelay across timelock chains when minDelay can be read for every timelock chain. An unset delay fails the call if any chain cannot be read or on-chain minDelay is zero. An explicitly set delay is left unchanged when on-chain minDelay cannot be verified.

func CorrectTimelockDelaysWithLookup

func CorrectTimelockDelaysWithLookup(
	ctx context.Context,
	lggr logger.Logger,
	proposals []mcms.TimelockProposal,
	lookup MinDelayLookup,
) error

CorrectTimelockDelaysWithLookup is like CorrectTimelockDelays but accepts a custom lookup (for tests).

func MaxMinDelay

func MaxMinDelay(chainDelays []ChainDelay) mcmstypes.Duration

MaxMinDelay returns the largest minDelay across chains.

Types

type ChainDelay

type ChainDelay struct {
	Selector uint64
	MinDelay mcmstypes.Duration
}

ChainDelay captures on-chain minDelay for one timelock chain.

func ReadChainMinDelays

func ReadChainMinDelays(
	ctx context.Context,
	blockChains chain.BlockChains,
	proposal *mcms.TimelockProposal,
) ([]ChainDelay, []string)

ReadChainMinDelays reads on-chain minDelay for each timelock address in the proposal. Returns per-chain delays and verify error messages for chains that could not be read.

type MinDelayLookup

type MinDelayLookup func(
	ctx context.Context,
	proposal *mcms.TimelockProposal,
	chainSelector uint64,
	timelockAddress string,
) (mcmstypes.Duration, error)

MinDelayLookup reads on-chain minDelay for one timelock chain entry.

Jump to

Keyboard shortcuts

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