Skip txs once set guardian detected#7648
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/supernova-async-exec #7648 +/- ##
==========================================================
Coverage 77.59% 77.59%
==========================================================
Files 877 877
Lines 121752 121799 +47
==========================================================
+ Hits 94476 94515 +39
- Misses 21008 21012 +4
- Partials 6268 6272 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request implements logic to skip transactions from a sender once a guarded SetGuardian transaction is detected during transaction selection. When a SetGuardian transaction that is co-signed by the active guardian is selected, it indicates an "instant" guardian change, and all subsequent transactions from that sender are skipped because they may be guarded by the old guardian.
Changes:
- Added
IsGuardedmethod to theSelectionSessioninterface to check if a transaction has a guardian signature - Added
TxVersionCheckerdependency throughout the transaction preprocessing pipeline to enable guardian checking - Implemented logic in transaction selection to set a flag when an instant SetGuardian transaction is detected and skip all subsequent transactions from that sender
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| txcache/virtualSelectionSession.go | Added isGuardedByActiveGuardian method to detect SetGuardian transactions with valid guardian signatures |
| txcache/transactionsHeapItem.go | Added hasPendingChangeGuardianTransaction field and logic to set it when instant guardian change is detected |
| txcache/selection.go | Added check to skip senders with pending guardian changes |
| txcache/interface.go | Added IsGuarded method to SelectionSession interface |
| txcache/transactionsHeapItem_test.go | Added tests for pending guardian detection logic |
| txcache/selection_test.go | Added integration test for transaction selection with guardian changes |
| testscommon/txcachemocks/selectionSessionMock.go | Added mock implementation for IsGuarded method |
| process/block/preprocess/selectionSession.go | Implemented IsGuarded method using TxVersionChecker |
| process/block/preprocess/selectionSession_test.go | Updated tests to include TxVersionChecker dependency |
| process/block/preprocess/transactions.go | Added TxVersionChecker dependency to transaction preprocessor |
| process/block/preprocess/transactions_test.go | Updated tests to include TxVersionChecker |
| process/factory/shard/preProcessorsContainerFactory.go | Added TxVersionChecker to shard preprocessor factory |
| process/factory/shard/preProcessorsContainerFactory_test.go | Updated tests to include TxVersionChecker |
| process/factory/metachain/preProcessorsContainerFactory.go | Added TxVersionChecker to metachain preprocessor factory |
| process/factory/metachain/preProcessorsContainerFactory_test.go | Updated tests to include TxVersionChecker |
| process/coordinator/process_test.go | Updated all tests to include TxVersionChecker dependency |
| process/coordinator/processProposal_test.go | Updated tests to include TxVersionChecker |
| process/block/shardblock_test.go | Updated tests to include TxVersionChecker |
| node/external/transactionAPI/check.go | Added validation for TxVersionChecker in API processor |
| node/external/transactionAPI/apiTransactionProcessor.go | Added TxVersionChecker to API transaction processor |
| node/external/transactionAPI/apiTransactionArgs.go | Added TxVersionChecker field to arguments struct |
| node/external/transactionAPI/apiTransactionProcessor_test.go | Updated tests to include TxVersionChecker |
| integrationTests/testProcessorNodeWithTestWebServer.go | Wired TxVersionChecker in integration tests |
| integrationTests/testProcessorNode.go | Wired TxVersionChecker in test processor node |
| integrationTests/chainSimulator/mempool/testutils_test.go | Updated to use TxVersionChecker from core components |
| genesis/process/shardGenesisBlockCreator.go | Wired TxVersionChecker in genesis block creator |
| genesis/process/metaGenesisBlockCreator.go | Wired TxVersionChecker in meta genesis block creator |
| factory/processing/blockProcessorCreator.go | Wired TxVersionChecker in block processor factory |
| factory/api/apiResolverFactory.go | Wired TxVersionChecker in API resolver factory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?