Skip to content

Fix nonce synchronization issues in EVM deployments by adding slow flag to forge#647

Merged
evgeniko merged 4 commits intomainfrom
forge_slow
Jul 9, 2025
Merged

Fix nonce synchronization issues in EVM deployments by adding slow flag to forge#647
evgeniko merged 4 commits intomainfrom
forge_slow

Conversation

@evgeniko
Copy link
Copy Markdown
Contributor

EVM deployments were failing with nonce errors on certain networks (e.g. Mezo) due to forge sending transactions too quickly without waiting for confirmation between transactions.
Example error:
server returned an error response: error code -32000: invalid nonce; got 3, expected 2: invalid sequence: invalid sequence

Added --slow flag to forge script commands in both deployEvm and upgradeEvm functions. This flag forces forge to wait for transaction confirmation before sending the next one, ensuring proper nonce synchronization.

@evgeniko evgeniko requested review from dvgui and kcsongor June 30, 2025 13:40
dvgui
dvgui previously approved these changes Jun 30, 2025
Copy link
Copy Markdown
Contributor

@kcsongor kcsongor left a comment

Choose a reason for hiding this comment

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

If this issue only comes up for cetain chain, we should only add it for those chains, in order to not unnecessarily slow down deployments for other chains. AFAIK the fast-path works reliably everywhere else, right?

@nik-suri
Copy link
Copy Markdown
Contributor

nik-suri commented Jul 2, 2025

@evgeniko adding on to what @kcsongor said -- could we solve this by exposing the --slow flag as an option so CLI users can apply it on a case-by-case basis whenever needed?

@kcsongor
Copy link
Copy Markdown
Contributor

kcsongor commented Jul 2, 2025

I agree a --slow flag could make sense but I would argue it will be worse UX than just automatically applying it to chains that we know need it, because the error message is quite cryptic and it breaks the flow.

@evgeniko
Copy link
Copy Markdown
Contributor Author

evgeniko commented Jul 2, 2025

Added helper function that add slow flag only if Mezo is used as a hardcoded value.

@evgeniko evgeniko requested review from dvgui and kcsongor July 3, 2025 08:58
@nik-suri nik-suri requested a review from nvsriram July 9, 2025 18:06
@evgeniko evgeniko merged commit 1162f8d into main Jul 9, 2025
9 checks passed
@evgeniko evgeniko deleted the forge_slow branch July 9, 2025 19:11
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