-
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
feat(rpc): improve error message for nonce too low #10511
Conversation
make sure to run lint with |
More descriptive line for error nonce too low Co-authored-by: Emilia Hane <emiliaha95@gmail.com>
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.
one more suggestion
@@ -494,7 +503,7 @@ impl From<reth_primitives::InvalidTransactionError> for RpcInvalidTransactionErr | |||
// txpool (e.g. `eth_sendRawTransaction`) to their corresponding RPC | |||
match err { | |||
InvalidTransactionError::InsufficientFunds { .. } => Self::InsufficientFunds, | |||
InvalidTransactionError::NonceNotConsistent => Self::NonceTooLow, | |||
InvalidTransactionError::NonceNotConsistent => Self::NonceTooLow { tx: 0, state: 0}, |
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.
I think we can also add these fields to the NonceNotConsistent
error variant
reth/crates/transaction-pool/src/validate/eth.rs
Lines 338 to 344 in 29058ad
// Checks for nonce | |
if transaction.nonce() < account.nonce { | |
return TransactionValidationOutcome::Invalid( | |
transaction, | |
InvalidTransactionError::NonceNotConsistent.into(), | |
) | |
} |
EVMError::Transaction(_) => EthApiError::InvalidTransaction( | ||
RpcInvalidTransactionError::NonceTooLow { tx: 0, state: 0 } | ||
), |
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 doesn't look right, why this change?
…into Improve_rpc_errors @q he commit.
error.rs & eth.rs |
why was this closed @i-sangh ? this was on track and almost ready |
I was indeed trying to figure it out. But I'm getting errors n errors as
try to proceed.
…On Wed, Aug 28, 2024, 1:30 PM Matthias Seitz ***@***.***> wrote:
why was this closed @i-sangh <https://github.com/i-sangh> ? this was on
track and almost ready
—
Reply to this email directly, view it on GitHub
<#10511 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJ6YPWUIBFQZFW4WSSATWXTZTV7TRAVCNFSM6AAAAABNCSAVXSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJUGYYDIOBTHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Happy to create a new branch and continue work on on this one @mattsse |
ref #10464. closes #10498.
The current error wasn't very helpful: nonce too low
So ideally it should now be:
nonce too low: next nonce 72, tx nonce 71