Skip to content

fix(op-revm): system tx not enveloped#2807

Merged
rakita merged 2 commits intobluealloy:mainfrom
emhane:test-op-system-call
Jul 28, 2025
Merged

fix(op-revm): system tx not enveloped#2807
rakita merged 2 commits intobluealloy:mainfrom
emhane:test-op-system-call

Conversation

@emhane
Copy link
Contributor

@emhane emhane commented Jul 25, 2025

Ref #2189

Bug: system tx not enveloped, triggering panic "all not deposit tx have enveloped tx" in handler.
Fix: sets enveloped tx equal to Some(Bytes::default())

Adds test covering OpEvm::transact_system_call_with_caller, increasing coverage of op-revm/src/api/exec.rs from 59% to 79%.

Comment on lines -92 to +100
OpTransaction::new(TX::new_system_tx_with_caller(
let mut tx = OpTransaction::new(TX::new_system_tx_with_caller(
caller,
system_contract_address,
data,
))
));

tx.enveloped_tx = Some(Bytes::default());

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.

I'm not sure if we need to be checking if this is pre-regolith here actually. I didn't find out how revm performs the actual eip2718 encoding since it seems alloy's impl can't be used here as revm has its own transaction trait ? @rakita

Copy link
Member

Choose a reason for hiding this comment

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

Revm does not perform eip2718 encoding, it is a field.

Calling replay on system "tx" is an undefined behaviour (as fields for this tx are undefined), so having empty bytes for envelop seems appropriate.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 25, 2025

CodSpeed Performance Report

Merging #2807 will not alter performance

Comparing emhane:test-op-system-call (f2f2da7) with main (1477307)

Summary

✅ 171 untouched benchmarks

@rakita rakita merged commit 80e09f6 into bluealloy:main Jul 28, 2025
30 checks passed
This was referenced Jul 28, 2025
lwedge99 pushed a commit to sentioxyz/revm that referenced this pull request Sep 16, 2025
* Fix bug, system tx not enveloped and add test

* Fix lint
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 21, 2026
* Fix bug, system tx not enveloped and add test

* Fix lint
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