Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(forge): do not re-execute script on resume when possible #7361

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Mar 11, 2024

Motivation

Right now resuming a script requires re-executing it which is expensive and not always possible (i.e. when some transactions already landed and altered state)

We only need to re-execute it if there are any private keys which appeared first time during execution,

Solution

Move resume logic to CompiledState and only execute script if we are missing any signers from tx.froms.

This brings back --multi flag requirement when resuming multi-chain script

@klkvr klkvr requested review from DaniPopes and mattsse as code owners March 11, 2024 12:39
@klkvr klkvr force-pushed the klkvr/avoid-reexecute-on-resume branch from ac08278 to accb3b0 Compare March 11, 2024 12:49
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

great!
pending CI

@klkvr klkvr force-pushed the klkvr/avoid-reexecute-on-resume branch 2 times, most recently from 1329761 to ee7ab32 Compare March 12, 2024 01:53
@klkvr klkvr force-pushed the klkvr/avoid-reexecute-on-resume branch from ee7ab32 to d2c045c Compare March 12, 2024 13:06
Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm too, ci is being annoying and timing out

@klkvr klkvr merged commit f218563 into foundry-rs:master Mar 12, 2024
18 of 19 checks passed
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.

3 participants