-
Notifications
You must be signed in to change notification settings - Fork 2k
bump(revm
: step 1): bump revm
to 21.0.0
release
#10183
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
base: master
Are you sure you want to change the base?
Conversation
ade941f
to
fc6b765
Compare
4e3f71d
to
7e2b0ea
Compare
7e2b0ea
to
4b4da4a
Compare
revm
to 21.0.0
releaserevm
: step 1): bump revm
to 21.0.0
release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okiee,
some things required workarounds but overall this lgtm even though the total diff is quite large
is_system_transaction: *is_system_tx, | ||
}; | ||
|
||
OpTransaction { base, deposit, enveloped_tx: None } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this we need to always set to the encoded2718 value
or maybe not, depdning on how this will be executed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is currently handled downstream
foundry/crates/anvil/src/eth/backend/mem/mod.rs
Lines 1120 to 1123 in 78c94f7
if env.is_optimism { | |
env.tx.enveloped_tx = | |
Some(alloy_rlp::encode(&tx.pending_transaction.transaction.transaction).into()); | |
} |
foundry/crates/anvil/src/eth/backend/executor.rs
Lines 249 to 257 in 78c94f7
fn env_for(&self, tx: &PendingTransaction) -> Env { | |
let mut tx_env = tx.to_revm_tx_env(); | |
if self.optimism { | |
tx_env.enveloped_tx = Some(alloy_rlp::encode(&tx.transaction.transaction).into()); | |
} | |
Env::new(self.cfg_env.clone(), self.block_env.clone(), tx_env, self.optimism) | |
} |
This field was also previously None
enveloped_tx: None, |
crates/cast/src/cmd/call.rs
Outdated
@@ -267,7 +267,7 @@ impl CallArgs { | |||
let tx_kind = tx.inner.to.expect("set by builder"); | |||
|
|||
if let Some(access_list) = tx.inner.access_list { | |||
executor.env_mut().tx.access_list = access_list.0 | |||
executor.env_mut().tx.access_list = access_list; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we also need to set the tx type here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 9a4fb2b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's great, left couple of nits and some questions if we could decouple more from op?
… is present and tx type is legacy
…e environment less error prone
Stacked PRs:
revm
: step 2): bumpalloy
+revm
+alloy-evm
+ other deps to latest #10454revm
: step 3): reintroduce precompile injection #10508Benchmarks
forge test
revm 23 @
ec4ffd3)Conclusion: on average at least 12% faster!
Notes:
1024
from256
for all testsdeadline
totype(uint64).max - 1
on all cases, now enforced (see breaking changes)Benchmarks
anvil
mem and cpu
ref #7940 (comment)
https://github.com/PhilippLgh/anvil-perf
ref #4399 (comment)
https://github.com/mshakeg/anvil-backtester
ref #6017 (comment)) - blocksToMine: 10, nullSwapsPerBlock: 2000, totalTxs: 40000, 3 runs
run2: 4.605
run3: 4.626
run2: 4.672
run3: 4.676
(more is better)
run2: 8686.210640608035
run3: 8646.779074794638
run2: 8561.643835616438
run3: 8554.31993156544
(less is better)
run2: 0.115125
run3: 0.11565
run2: 0.1168
run3: 0.1169
https://github.com/xmtp/xmtpd
ref #10122 (comment)
29.907s
29.856s
29.867s
29.890s
29.988s
29.771s
30.017s
29.769s
Known breaking changes ❗⚠️
Revm now operates on
u64
for the following fields:chain id
tx.gas_price
block.basefee
block.number
block.timestamp
Thereforce we must constrain the input we accept to up
u64::max
for the following cheatcodes:vm.chainId
vm.fee
vm.roll
vm.txGasPrice
vm.warp
vm.setBlockhash
These cheatcodes will raise an error if a value >
u64::max
is passed.Because of these Revm fields changing the Anvil state files are known to currently break, this can possibly be handled in a follow-up where we flexibly read from old state files but write in the new form. This is not currently handled in this PR.
Closes
Closes: #10367
Follow ups that will become unlocked, to check
Verify bug(cast
): trace printer returns "broken" gas value around0x1
precompile #10276 has been fixedCustomPrintTracer
to use Revm'sTracerEip3155
#10329forge bind
): generated contract bindings are incompatible with alloy-rs0.14.0
#10321prague hardfork
): add support for EIP-2935, currently missing #10357 (relies on alloy-evm)PR Checklist