Skip to content

Disable outgoing txs supernova transition#7873

Merged
BeniaminDrasovean merged 6 commits into
feat/testnet-fixesfrom
disable-outgoing-txs-supernova-transition
Jun 17, 2026
Merged

Disable outgoing txs supernova transition#7873
BeniaminDrasovean merged 6 commits into
feat/testnet-fixesfrom
disable-outgoing-txs-supernova-transition

Conversation

@BeniaminDrasovean

Copy link
Copy Markdown
Contributor

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:

  • 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 Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.58%. Comparing base (70698ac) to head (a4a32cd).

Files with missing lines Patch % Lines
process/coordinator/process.go 86.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           feat/testnet-fixes    #7873      +/-   ##
======================================================
- Coverage               77.58%   77.58%   -0.01%     
======================================================
  Files                     884      884              
  Lines                  125259   125274      +15     
======================================================
+ Hits                    97182    97192      +10     
- Misses                  21627    21630       +3     
- Partials                 6450     6452       +2     

☔ View full report in Codecov by Harness.
📢 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 PR introduces a Supernova-transition guard in the transaction coordinator so that blocks containing outgoing transaction miniblocks are rejected while Supernova is epoch-enabled but round-enabled is still off (i.e., during the transition window). This aligns block processing/validation behavior with the existing block production behavior that already disables outgoing txs until Supernova round activation.

Changes:

  • Added a new sentinel error (process.ErrOutgoingTxsDisabled) to signal outgoing tx miniblocks are disallowed during the transition.
  • Added coordinator-side enforcement in ProcessBlockTransaction() to reject forbidden outgoing transaction miniblocks during the transition (for non-v3 headers).
  • Added unit tests to ensure TxBlock miniblocks are rejected and post-process miniblocks (e.g. SCR) are still allowed in the transition.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
process/errors.go Adds ErrOutgoingTxsDisabled error used to signal forbidden outgoing tx miniblocks during transition.
process/coordinator/process.go Enforces rejection of forbidden outgoing tx miniblocks during Supernova transition; adds helper predicates.
process/coordinator/process_test.go Adds coverage for rejecting TxBlock outgoing miniblocks and allowing post-process miniblocks during transition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread process/coordinator/process.go
Comment on lines +2051 to +2095
func TestTransactionCoordinator_ProcessBlockTransactionRejectsForbiddenOutgoingTxMiniBlocksDuringSupernovaTransition(t *testing.T) {
t.Parallel()

argsTransactionCoordinator := createMockTransactionCoordinatorArguments()
argsTransactionCoordinator.EnableEpochsHandler = &enableEpochsHandlerMock.EnableEpochsHandlerStub{
IsFlagEnabledInEpochCalled: func(flag core.EnableEpochFlag, epoch uint32) bool {
return flag == common.SupernovaFlag && epoch == 7
},
}
argsTransactionCoordinator.EnableRoundsHandler = &testscommon.EnableRoundsHandlerStub{
IsFlagEnabledInRoundCalled: func(flag common.EnableRoundFlag, round uint64) bool {
return false
},
}

tc, err := NewTransactionCoordinator(argsTransactionCoordinator)
require.NoError(t, err)

haveTime := func() time.Duration {
return time.Second
}

selfShardID := tc.shardCoordinator.SelfId()
receiverShardID := (selfShardID + 1) % tc.shardCoordinator.NumberOfShards()
miniBlock := &block.MiniBlock{
SenderShardID: selfShardID,
ReceiverShardID: receiverShardID,
Type: block.TxBlock,
TxHashes: [][]byte{txHash},
}
miniBlockHash, err := core.CalculateHash(tc.marshalizer, tc.hasher, miniBlock)
require.NoError(t, err)

body := &block.Body{MiniBlocks: []*block.MiniBlock{miniBlock}}
header := &block.Header{
Epoch: 7,
Round: 41,
MiniBlockHeaders: []block.MiniBlockHeader{
{Hash: miniBlockHash, TxCount: 1, ReceiverShardID: receiverShardID},
},
}

err = tc.ProcessBlockTransaction(header, body, haveTime)
require.ErrorIs(t, err, process.ErrOutgoingTxsDisabled)
}

@BeniaminDrasovean BeniaminDrasovean Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

miiu96
miiu96 previously approved these changes Jun 9, 2026
Comment thread process/coordinator/process.go Outdated
if mb.SenderShardID != selfShardID {
continue
}
if mb.Type == block.TxBlock {

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.

A check should still be added for invalid block, to allow the entire bandwidth to be used to finalize floating miniblocks in that window.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@BeniaminDrasovean BeniaminDrasovean merged commit 5fe5960 into feat/testnet-fixes Jun 17, 2026
11 checks passed
@BeniaminDrasovean BeniaminDrasovean deleted the disable-outgoing-txs-supernova-transition branch June 17, 2026 10:38
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.

4 participants