Skip to content

Skip txs once set guardian detected#7648

Merged
sstanculeanu merged 15 commits into
feat/supernova-async-execfrom
fix-txs-once-set-guardian-detected
Feb 3, 2026
Merged

Skip txs once set guardian detected#7648
sstanculeanu merged 15 commits into
feat/supernova-async-execfrom
fix-txs-once-set-guardian-detected

Conversation

@sstanculeanu

Copy link
Copy Markdown
Collaborator

Reasoning behind the pull request

  • once a change guardian transaction is detected, do not select other transactions

Proposed changes

  • added new check on skip condition

Testing procedure

  • with feat branch

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@codecov

codecov Bot commented Jan 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.36364% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.59%. Comparing base (c635e8b) to head (3c2683a).

Files with missing lines Patch % Lines
process/block/preprocess/selectionSession.go 50.00% 5 Missing ⚠️
process/block/preprocess/transactions.go 77.77% 1 Missing and 1 partial ⚠️
...factory/metachain/preProcessorsContainerFactory.go 50.00% 1 Missing and 1 partial ⚠️
...ess/factory/shard/preProcessorsContainerFactory.go 50.00% 1 Missing and 1 partial ⚠️
txcache/virtualSelectionSession.go 77.77% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

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.

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 IsGuarded method to the SelectionSession interface to check if a transaction has a guardian signature
  • Added TxVersionChecker dependency 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.

@sstanculeanu sstanculeanu changed the title Fix txs once set guardian detected Skip txs once set guardian detected Feb 2, 2026

Copilot AI left a comment

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.

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.

@ssd04 ssd04 self-requested a review February 3, 2026 11:33
@sstanculeanu sstanculeanu merged commit cc56131 into feat/supernova-async-exec Feb 3, 2026
8 of 9 checks passed
@sstanculeanu sstanculeanu deleted the fix-txs-once-set-guardian-detected branch February 3, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants