Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/pretty-days-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink-deployments-framework": patch
---

get delay for advancing time from the proposal instead of constant value
4 changes: 2 additions & 2 deletions engine/cld/legacy/cli/mcmsv2/mcms_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const (
proposalKindFlag = "proposalKind"
indexFlag = "index"
forkFlag = "fork"
defaultAdvanceTime = 36000 // In seconds - defaulting to 10 hours
defaultProposalValidity = 72 * time.Hour
)

Expand Down Expand Up @@ -666,7 +665,8 @@ func buildExecuteForkCommand(lggr logger.Logger, domain cldf_domain.Domain, prop
}
lggr.Info("MCMs execute() success")
lggr.Info("Waiting for the chain to be mined before executing timelock chain command")
if err = anvilClient.EVMIncreaseTime(defaultAdvanceTime); err != nil {

if err = anvilClient.EVMIncreaseTime(uint64(cfg.timelockProposal.Delay.Seconds())); err != nil {
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converting time.Duration to uint64 via Seconds() may lose precision for sub-second delays and could truncate fractional seconds. Consider using a more precise conversion or validating that the delay is appropriate for the EVMIncreaseTime API.

Suggested change
if err = anvilClient.EVMIncreaseTime(uint64(cfg.timelockProposal.Delay.Seconds())); err != nil {
// Round up to the nearest whole second to avoid truncating sub-second delays
delaySeconds := uint64((cfg.timelockProposal.Delay + time.Second - 1) / time.Second)
if err = anvilClient.EVMIncreaseTime(delaySeconds); err != nil {

Copilot uses AI. Check for mistakes.
return fmt.Errorf("failed to increase time: %w", err)
}
if err = anvilClient.AnvilMine([]interface{}{1}); err != nil {
Expand Down