Skip to content

Commit 126609e

Browse files
authored
fix: get delay for advancing time from the proposal instead of constant (#495)
This pull request updates how the time delay for advancing the blockchain is determined in the Chainlink deployments framework. Instead of using a hardcoded constant, the delay is now dynamically retrieved from the proposal configuration, improving flexibility and accuracy. **Improvements to time advancement logic:** * The default constant `defaultAdvanceTime` was removed from `mcms_v2.go`, so time advancement no longer relies on a fixed value. * The code now uses the delay specified in `cfg.timelockProposal.Delay` when calling `anvilClient.EVMIncreaseTime`, ensuring the time advancement matches the proposal's requirements. **Documentation update:** * The `.changeset/pretty-days-draw.md` file documents this change, noting that the delay for advancing time is now obtained from the proposal rather than a constant value.
1 parent ce51cbe commit 126609e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/pretty-days-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink-deployments-framework": patch
3+
---
4+
5+
get delay for advancing time from the proposal instead of constant value

engine/cld/legacy/cli/mcmsv2/mcms_v2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const (
5151
proposalKindFlag = "proposalKind"
5252
indexFlag = "index"
5353
forkFlag = "fork"
54-
defaultAdvanceTime = 36000 // In seconds - defaulting to 10 hours
5554
defaultProposalValidity = 72 * time.Hour
5655
)
5756

@@ -666,7 +665,8 @@ func buildExecuteForkCommand(lggr logger.Logger, domain cldf_domain.Domain, prop
666665
}
667666
lggr.Info("MCMs execute() success")
668667
lggr.Info("Waiting for the chain to be mined before executing timelock chain command")
669-
if err = anvilClient.EVMIncreaseTime(defaultAdvanceTime); err != nil {
668+
669+
if err = anvilClient.EVMIncreaseTime(uint64(cfg.timelockProposal.Delay.Seconds())); err != nil {
670670
return fmt.Errorf("failed to increase time: %w", err)
671671
}
672672
if err = anvilClient.AnvilMine([]interface{}{1}); err != nil {

0 commit comments

Comments
 (0)