Skip to content
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

chore: handle all revm errors #14574

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions crates/rpc/rpc-eth-types/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,13 @@ impl From<InvalidTransaction> for RpcInvalidTransactionError {
// tx.gas < cost
Self::GasTooLow
}
InvalidTransaction::GasFloorMoreThanGasLimit => {
// Post prague EIP-7623 tx floor calldata gas cost > tx.gas_limit
// where floor gas is the minimum amount of gas that will be spent
// In other words, the tx's gas limit is lower that the minimum gas requirements of
// the tx's calldata
Self::GasTooLow
}
InvalidTransaction::RejectCallerWithCode => Self::SenderNoEOA,
InvalidTransaction::LackOfFundForMaxFee { fee, balance } => {
Self::InsufficientFunds { cost: *fee, balance: *balance }
Expand All @@ -561,18 +568,12 @@ impl From<InvalidTransaction> for RpcInvalidTransactionError {
InvalidTransaction::AuthorizationListNotSupported => {
Self::AuthorizationListNotSupported
}
InvalidTransaction::AuthorizationListInvalidFields => {
Self::AuthorizationListInvalidFields
}
#[allow(unreachable_patterns)]
err => {
error!(target: "rpc",
?err,
"unexpected transaction error"
);

Self::other(internal_rpc_err(format!("unexpected transaction error: {err}")))
}
InvalidTransaction::AuthorizationListInvalidFields |
InvalidTransaction::EmptyAuthorizationList => Self::AuthorizationListInvalidFields,
InvalidTransaction::Eip2930NotSupported |
InvalidTransaction::Eip1559NotSupported |
InvalidTransaction::Eip4844NotSupported |
InvalidTransaction::Eip7702NotSupported => Self::TxTypeNotSupported,
}
}
}
Expand Down
Loading