Skip to content

test(op-revm): Adds caller nonce assertion to op-revm intergation tests#2815

Merged
rakita merged 4 commits intobluealloy:mainfrom
emhane:op-nonce-check-in-tests
Jul 29, 2025
Merged

test(op-revm): Adds caller nonce assertion to op-revm intergation tests#2815
rakita merged 4 commits intobluealloy:mainfrom
emhane:op-nonce-check-in-tests

Conversation

@emhane
Copy link
Contributor

@emhane emhane commented Jul 28, 2025

Ref #2189, #2805

  • Adds handler test to verify unchanged nonce for tx with insufficient balance
  • Asserts caller nonce post-execution for existing op-revm integration tests

Comment on lines +1187 to +1190
assert_eq!(
output.state.get(&Address::ZERO).map(|a| a.info.nonce),
Some(0)
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

double checking that this the expected behaviour for system call?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, system call does not touch caller to beneficiary account

Copy link
Contributor Author

@emhane emhane Jul 29, 2025

Choose a reason for hiding this comment

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

if caller account wouldn't be touched, then it should be None like for deposit, not Some(0). adding an assertion here to verifying that caller has not been marked as touched, the test fails.

assert!(!output.state.get(&Address::ZERO).unwrap().is_touched());

Copy link
Member

Choose a reason for hiding this comment

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

Ah this is touched after .replay. If you check account after system_call, it will not be touched.

Although I see expectation for replay to behave the same as system call, but this would make things complex and not performant. The intention for replay is to be removed somewhere in the future and for users to rely on .transact(tx).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true! that replay statement isn't necessary there. thanks.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 28, 2025

CodSpeed Performance Report

Merging #2815 will not alter performance

Comparing emhane:op-nonce-check-in-tests (2b2aeff) with main (f2d73c4)

Summary

✅ 171 untouched benchmarks

@rakita
Copy link
Member

rakita commented Jul 28, 2025

No need to check the nonce every time with assert as it is checked/saved inside json fixture.

This PR should order it so it will be easier to diff in github: #2813

@emhane emhane force-pushed the op-nonce-check-in-tests branch from c1f8e01 to 13f2736 Compare July 29, 2025 14:33
@rakita rakita merged commit df46793 into bluealloy:main Jul 29, 2025
30 checks passed
@emhane emhane deleted the op-nonce-check-in-tests branch July 29, 2025 15:47
This was referenced Sep 8, 2025
lwedge99 pushed a commit to sentioxyz/revm that referenced this pull request Sep 16, 2025
…ts (bluealloy#2815)

* Adds handler test for verifying unchanged nonce on balance too low revert

* Fix system call test

* fixup! Fix merge conflicts
This was referenced Oct 15, 2025
@github-actions github-actions bot mentioned this pull request Oct 30, 2025
This was referenced Nov 12, 2025
This was referenced Dec 23, 2025
@github-actions github-actions bot mentioned this pull request Jan 15, 2026
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 21, 2026
…ts (bluealloy/revm#2815)

* Adds handler test for verifying unchanged nonce on balance too low revert

* Fix system call test

* fixup! Fix merge conflicts
@github-actions github-actions bot mentioned this pull request Mar 3, 2026
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.

2 participants