Skip to content

Commit

Permalink
dont' recover signer in a hot loop (#212)
Browse files Browse the repository at this point in the history
## 📝 Summary

This is pretty serious regression that I've missed while reviewing
external PR on one of the reth upgrades.

We need to be careful to not allow something like that slip in the
future.

## 💡 Motivation and Context

calling recover_signer verifies transaction signature every time we try
to executing something in the vm.

---

## ✅ I have completed the following steps:

* [ ] Run `make lint`
* [ ] Run `make test`
* [ ] Added tests (if applicable)
  • Loading branch information
dvush authored Oct 9, 2024
1 parent 66613c9 commit f60a4ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/rbuilder/src/building/order_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ impl<'a, 'b, Tracer: SimulationTracer> PartialBlockFork<'a, 'b, Tracer> {
}

let mut tx_env = TxEnv::default();
let tx_signed = tx_with_blobs.internal_tx_unsecure().clone().into_signed();
tx_signed.fill_tx_env(&mut tx_env, tx_signed.recover_signer().unwrap());
let tx_signed = tx_with_blobs.internal_tx_unsecure();
tx_signed.fill_tx_env(&mut tx_env, tx_signed.signer());

let env = Env {
cfg: ctx.initialized_cfg.cfg_env.clone(),
Expand Down

0 comments on commit f60a4ec

Please sign in to comment.