Skip to content

fix: get delay for advancing time from the proposal instead of constant#495

Merged
ecPablo merged 1 commit intomainfrom
ecpablo/fork-test-fix-hardcoded-time
Oct 7, 2025
Merged

fix: get delay for advancing time from the proposal instead of constant#495
ecPablo merged 1 commit intomainfrom
ecpablo/fork-test-fix-hardcoded-time

Conversation

@ecPablo
Copy link
Contributor

@ecPablo ecPablo commented Oct 6, 2025

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.

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2025

🦋 Changeset detected

Latest commit: d2bd5e6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@ecPablo ecPablo marked this pull request as ready for review October 6, 2025 22:33
@ecPablo ecPablo requested a review from a team as a code owner October 6, 2025 22:33
Copilot AI review requested due to automatic review settings October 6, 2025 22:33
@ecPablo ecPablo requested a review from a team as a code owner October 6, 2025 22:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves time advancement logic in the Chainlink deployments framework by replacing a hardcoded time delay constant with dynamic retrieval from proposal configuration.

  • Removed the hardcoded defaultAdvanceTime constant (36000 seconds/10 hours)
  • Updated time advancement to use cfg.timelockProposal.Delay.Seconds() for more accurate proposal-specific timing
  • Added documentation in changeset noting the switch from constant to proposal-based delay

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
engine/cld/legacy/cli/mcmsv2/mcms_v2.go Removed hardcoded time constant and updated time advancement to use proposal delay
.changeset/pretty-days-draw.md Added changeset documentation for the delay calculation change

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.
@ecPablo ecPablo added this pull request to the merge queue Oct 7, 2025
Merged via the queue into main with commit 126609e Oct 7, 2025
14 checks passed
@ecPablo ecPablo deleted the ecpablo/fork-test-fix-hardcoded-time branch October 7, 2025 13:28
github-merge-queue bot pushed a commit that referenced this pull request Oct 7, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## chainlink-deployments-framework@0.55.0

### Minor Changes

-
[#492](#492)
[`7243af8`](7243af8)
Thanks [@jkongie](https://github.com/jkongie)! - update aptos dep to
v1.9.1

-
[#474](#474)
[`fdcf28d`](fdcf28d)
Thanks [@ecPablo](https://github.com/ecPablo)! - add predecessors and
opcount calculation logic to proposalutils package.

### Patch Changes

-
[#496](#496)
[`fea372c`](fea372c)
Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - fix:
update db controller to accept context

-
[#498](#498)
[`ce51cbe`](ce51cbe)
Thanks [@gustavogama-cll](https://github.com/gustavogama-cll)! - fix:
anvil env should check for addresses from DataStore as well

-
[#495](#495)
[`126609e`](126609e)
Thanks [@ecPablo](https://github.com/ecPablo)! - get delay for advancing
time from the proposal instead of constant value

-
[#497](#497)
[`976d232`](976d232)
Thanks [@graham-chainlink](https://github.com/graham-chainlink)! -
fix(catalog/memory): remove dependency on testing.T

---------

Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants