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

feat(executor): call hook with state changes after post block balance increments #13050

Merged
merged 6 commits into from
Dec 2, 2024

Conversation

fgimenez
Copy link
Member

@fgimenez fgimenez commented Dec 2, 2024

Closes #13024

Added function to create an EvmState from the post-block balance increments. This EvmState is used to call the state hook in the Ethereum and Optimism executors.

@github-actions github-actions bot added the A-execution Related to the Execution and EVM label Dec 2, 2024
Comment on lines 521 to 523
let transition_account = account
.increment_balance(balance_inc)
.ok_or(BlockValidationError::IncrementBalanceFailed)?;
Copy link
Member

Choose a reason for hiding this comment

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

balance was already incremented prior to this call. this does it 2nd time

Copy link
Member Author

Choose a reason for hiding this comment

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

@rkrasiuk very good catch thx! should be fixed in cc7bd76 also added a test to cover the issue, ptal

Copy link
Member

@rkrasiuk rkrasiuk left a comment

Choose a reason for hiding this comment

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

lgtm


balance_increments
.iter()
.filter(|(_, &balance)| balance != 0)
Copy link
Member

Choose a reason for hiding this comment

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

this shouldn't be possible but fine leaving as is for now

@shekhirin shekhirin added C-bug An unexpected or incorrect behavior C-enhancement New feature or request and removed C-bug An unexpected or incorrect behavior labels Dec 2, 2024
@fgimenez fgimenez added this pull request to the merge queue Dec 2, 2024
Merged via the queue into main with commit dd055a4 Dec 2, 2024
41 checks passed
@fgimenez fgimenez deleted the fgimenez/balance-increments-state-hook branch December 2, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-execution Related to the Execution and EVM C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executor should send state updates on post balance increments
3 participants