Skip to content

Commit

Permalink
Fix arbitrum access list simulation (#3174)
Browse files Browse the repository at this point in the history
# Description
A PR on top of #3173

We observed that, on Arbitrum, access list estimations occasionally fail
due to solvers (the senders of simulated transactions) needing an
exceptionally high ETH balance.

The issue arises because Arbitrum’s unusually high block gas limit,
combined with an average gas price of 0.01 GWEI, results in a
requirement of approximately 12k ETH for solvers to execute these
simulations.

To address this, this PR reduces the block gas limit to a more
reasonable value, ensuring that the access list simulation logic can
function reliably without excessive ETH balance requirements.

# Changes
<!-- List of detailed changes (how the change is accomplished) -->

- [ ] Adjusted the transaction gas limit for access list estimation on
Arbitrum

## How to test
Not sure how to properly test this. It affects only Arbitrum. But we
will still be able to see the effects on the fix by observing the logs
and whether the simulation failures stopped.

<!--
## Related Issues

Fixes #
-->
  • Loading branch information
sunce86 authored Dec 24, 2024
1 parent 37300c4 commit 2a5c42a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion crates/driver/src/infra/blockchain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,24 @@ impl Ethereum {
access_list: Some(tx.access_list.into()),
// Specifically set high gas because some nodes don't pick a sensible value if omitted.
// And since we are only interested in access lists a very high value is fine.
gas: Some(self.block_gas_limit().0),
gas: Some(match self.inner.chain {
// Arbitrum has an exceptionally high block gas limit (1,125,899,906,842,624),
// making it unsuitable for this use case. To address this, we use a
// fixed gas limit of 100,000,000, which is sufficient
// for all solution types, while avoiding the "insufficient funds for gas * price +
// value" error that could occur when a large amount of ETH is
// needed to simulate the transaction, due to high transaction gas limit.
//
// If a new network is added, ensure its block gas limit is checked and handled
// appropriately to maintain compatibility with this logic.
Chain::ArbitrumOne => 100_000_000.into(),
Chain::Mainnet => self.block_gas_limit().0,
Chain::Goerli => self.block_gas_limit().0,
Chain::Gnosis => self.block_gas_limit().0,
Chain::Sepolia => self.block_gas_limit().0,
Chain::Base => self.block_gas_limit().0,
Chain::Hardhat => self.block_gas_limit().0,
}),
gas_price: self.simulation_gas_price().await,
..Default::default()
};
Expand Down

0 comments on commit 2a5c42a

Please sign in to comment.