Skip to content

refactor: unify transaction validation logic between pool and evm#3463

Merged
klkvr merged 21 commits intomainfrom
klkvr/unify-pool-evm
Apr 8, 2026
Merged

refactor: unify transaction validation logic between pool and evm#3463
klkvr merged 21 commits intomainfrom
klkvr/unify-pool-evm

Conversation

@klkvr
Copy link
Copy Markdown
Member

@klkvr klkvr commented Apr 7, 2026

Based on #3461

Changes TempoTransactionValidator to fully delegate validation of transactions to TempoEvm.

This removes a lot of tests (mostly the ones that were covering validate_against_keychain). My assumption is that validator would now fully inherit EVM test coverage and if some scenarios are not covered there we should just migrate the tests

@klkvr klkvr changed the title Klkvr/unify pool evm refactor: unify transaction validation logic between pool and evm Apr 7, 2026
Base automatically changed from klkvr/refactor-load-fee-fields to main April 7, 2026 12:40
@klkvr klkvr force-pushed the klkvr/unify-pool-evm branch from 4e3a62a to 394a230 Compare April 7, 2026 14:57
Copy link
Copy Markdown
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of this makes sense

pedantic nit

Comment on lines +1579 to +1590
/// Context returned by [`TempoEvmHandler::validate_transaction`] with resolved
/// fee token and key expiry information for use by the transaction pool.
#[derive(Debug, Clone)]
pub struct ValidationContext {
/// The resolved fee token address used to pay for this transaction.
pub fee_token: Address,
/// The expiry timestamp of the access key used by this transaction.
/// Populated for keychain-signed transactions or transactions carrying a KeyAuthorization.
pub key_expiry: Option<u64>,
}

impl<DB, I> TempoEvmHandler<DB, I>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is out of order

@klkvr klkvr force-pushed the klkvr/unify-pool-evm branch from 4d5be66 to 09919d8 Compare April 7, 2026 16:18
@klkvr klkvr changed the base branch from main to klkvr/evm-validation-context April 7, 2026 16:19
@klkvr klkvr force-pushed the klkvr/unify-pool-evm branch from 09919d8 to ceaad9d Compare April 7, 2026 16:24
Base automatically changed from klkvr/evm-validation-context to main April 7, 2026 18:20
Copy link
Copy Markdown
Contributor

@0xKitsune 0xKitsune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, lgtm. Flagging that it looks like there were a few tests removed that are not covered in the evm crate.

Specifically, these have no EVM side equivalents:

  • Spending limits: rejecting txs that exceed the limit, zero remaining balance, or no limit set for the fee token being used
  • Access key expiry: rejecting expired keys, edge case where expiry equals current time
  • Key expiry getting cached so the pool can evict expired-key txs later
  • Rejecting txs where the fee payer is blacklisted
  • Key authorization chain_id matching the current chain
  • Recipient-scoped call rules rejecting undeployed targets
  • Duplicate token limits in key authorizations getting rejected

@klkvr klkvr enabled auto-merge April 8, 2026 00:19
@klkvr klkvr added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit d49f2f4 Apr 8, 2026
33 checks passed
@klkvr klkvr deleted the klkvr/unify-pool-evm branch April 8, 2026 00:40
decofe added a commit that referenced this pull request Apr 8, 2026
The unify-validation refactor (#3463) moved validate_against_keychain,
call_scope_allows_call, and validate_keychain_version out of the pool
validator. These tests now belong in the EVM validation layer.

Co-Authored-By: grandizzy <38490174+grandizzy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants