-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(anvil): add option to disable pool balance checks in EVM configuration #11242
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
feat(anvil): add option to disable pool balance checks in EVM configuration #11242
Conversation
Works great, thx! |
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.
looks good, ty! Minor nit, for clarity I suggest grouping these validations like
if !self.disable_pool_balance_checks {
if tx.gas_limit() < MIN_TRANSACTION_GAS as u64 {
...
}
// Check gas limit, iff block gas limit is set.
if !env.evm_env.cfg_env.disable_block_gas_limit
&& tx.gas_limit() > env.evm_env.block_env.gas_limit
{
...
}
if env.evm_env.cfg_env.spec >= SpecId::LONDON {
...
}
let max_cost = tx.max_cost();
let value = tx.value();
match &tx.transaction {
TypedTransaction::Deposit(deposit_tx) => {
...
or even extract them in a different fn and call smth like
if self.disable_pool_balance_checks {
self.validate_balance(tx);
}
adcf5e2
to
0fb2377
Compare
You are right, I grouped the balance checks for clarity 👍 |
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.
lgtm, thank you!
…ration (foundry-rs#11242) * feat(anvil): add option to disable pool balance checks in EVM configuration * test(anvil): add test for transaction pool behavior with disabled balance checks * fix: group pool balance checks for clarity * fix: make clippy happy again :)
Motivation
Close #11239
Solution
Add option to disable pool balance checks in EVM configuration.
PR Checklist