mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: handle all revm errors (#14574)
This commit is contained in:
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user