-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(rpc): add fee/value and balance to insufficient funds RPC error #10872
Conversation
crates/transaction-pool/src/error.rs
Outdated
)] | ||
Overdraft { | ||
/// Cost transaction is allowed to consume. See `reth_transaction_pool::PoolTransaction`. | ||
value_or_fee: U256, |
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.
this isn't quite accurate because this is the cost this tx requires.
imo we can keep overdraft as is, this provides sufficient context
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.
this isn't possible if we do the conversion from overdraft error to rpc error
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.
okay I looked at the issue again, looks like the Overdraft field is actually what we want here cost
, but InsufficientFund
only includes value or fee. which can be lower than balance, so this error could be confusing to users.
this should also be the expected cost.
Closes #10732. Closes #10464.
Adds fee/value and balance to error message for RPC error insufficient funds.
This doesn't report the exact same error message as geth now @AntonieDavid, if that doesn't suffice an issue to revm would need to be opened to add address and gas used to error variant
https://github.com/bluealloy/revm/blob/f57e3e639ee157c7e659e740bd175a7357003570/crates/primitives/src/result.rs#L334-L336
reth/crates/rpc/rpc-eth-types/src/error.rs
Line 479 in 817b152