chore: handle all revm errors (#14574)

This commit is contained in:
Matthias Seitz
2025-02-19 02:28:39 +01:00
committed by GitHub
parent 3570f6b2f3
commit cec1c11ece

View File

@ -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 }
@ -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,
}
}
}