-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Latest State TransactionValidator implementation #1289
Comments
I can take this. |
@mattsse just to cross check my understanding.
we have to fetch the latest state of the sender account and verify if the current_balance >= transaction_amount and if txn_nonce matches with last_txn_nonce+1. Are there any more checks that Iam missing ?
How do we fetch the latest state of Account. I couldn't find any class with name AccountProvider ? Is the expectation to implement this class as well ? |
this is not fully implemented yet, but we abstract everything over the traits so all impls should be generic over the traits.
not necessarily, we need to fetch current balance and nonce which is then used by the pool to update internals. |
@mattsse for what type should be the trait |
It should be something like pub struct EthTransactionValidator<Client: AccountPorivider> {
/// This type fetches account info from the db
client: Client,
/// whether shanghai is enabled.
shanghai: bool,
} |
Describe the feature
the transaction pool requires a
TransactionValidator
reth/crates/transaction-pool/src/validate.rs
Line 30 in afb6671
which is supposed to validate the transaction against protocol specs and the latest state.
It returns an outcome that includes the latest nonce and balance
reth/crates/transaction-pool/src/validate.rs
Lines 15 to 19 in afb6671
TODO
AccountProvider
and implements basic transaction checksAdditional context
No response
The text was updated successfully, but these errors were encountered: