Skip to content

partial continuation during supernova drain window - #7983

Open
AdoAdoAdo wants to merge 2 commits into
refactor-contended-headers-gatefrom
transition-refinement
Open

partial continuation during supernova drain window#7983
AdoAdoAdo wants to merge 2 commits into
refactor-contended-headers-gatefrom
transition-refinement

Conversation

@AdoAdoAdo

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?

@AdoAdoAdo
AdoAdoAdo marked this pull request as ready for review August 24, 2026 15:05
@AdoAdoAdo
AdoAdoAdo requested a lite review from Copilot August 24, 2026 15:06

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 tightens and formalizes behavior during the Supernova “drain window” (epoch activated but round activation not yet reached) by restricting new work types and enforcing historical gas limits while still allowing safe continuation of already-started partial executions.

Changes:

  • Introduces process.GasProcessingPolicy and resolves it from the candidate header to apply legacy gas-limit overrides during the drain window.
  • Extends TransactionCoordinator and PreProcessor interfaces to propagate drain/partial-execution allowances and gas processing policy through block processing.
  • Adds Supernova drain-window validation (reject scheduled work / new partial execution), plus additional transition safety checks via ProcessedMiniBlocksTracker.HasUnfinishedMiniBlocks().

Reviewed changes

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

Show a summary per file
File Description
update/mock/transactionCoordinatorMock.go Updates mock signature for new coordinator parameters.
testscommon/transactionCoordinatorMock.go Updates common test mock signature for new coordinator parameters.
testscommon/processedMiniBlocksTrackerStub.go Adds HasUnfinishedMiniBlocks() stub method for tests.
testscommon/preprocMocks/preprocessorMock.go Extends preprocessor mock to accept GasProcessingPolicy.
process/interface.go Updates interfaces to pass drain/partial flags and GasProcessingPolicy.
process/gasProcessingPolicy.go Adds policy type + resolver to enforce drain-window legacy gas limits.
process/gasProcessingPolicy_test.go Tests drain-window gas policy resolution behavior.
process/errors.go Adds new drain-window-specific sentinel errors.
process/coordinator/process.go Applies drain-window checks and threads partial-exec allowance + gas policy to preprocessing.
process/coordinator/process_test.go Updates tests and adds coverage for drain-window partial continuation + policy propagation.
process/block/shardblockProposal_test.go Adds tests for blocking transition when tracker has unfinished work; removes obsolete helper test.
process/block/shardblock.go Computes drain-window status + gas policy during miniblock creation; propagates into coordinator calls; adds drain-rule checks in processing.
process/block/shardblock_test.go Adds drain-window behavior tests (reject new scheduled/new partial; allow processed) and scheduled-mode gating tests.
process/block/processedMb/processedMiniBlocks.go Implements HasUnfinishedMiniBlocks() on the real tracker.
process/block/processedMb/processedMiniBlocks_test.go Adds unit test coverage for HasUnfinishedMiniBlocks().
process/block/preprocess/validatorInfoPreProcessor.go Updates signature to accept GasProcessingPolicy (unused).
process/block/preprocess/validatorInfoPreProcessor_test.go Updates calls to include GasProcessingPolicy.
process/block/preprocess/transactions.go Resolves drain-window gas policy and enforces it in gas computations and miniblock processing.
process/block/preprocess/transactions_test.go Adds drain-window historical gas limit enforcement tests; updates existing calls for new signature.
process/block/preprocess/smartContractResults.go Resolves drain-window gas policy and applies it during SCR gas tracking and miniblock processing.
process/block/preprocess/smartContractResults_test.go Adds drain-window historical gas limit enforcement tests; updates existing calls for new signature.
process/block/preprocess/rewardTxPreProcessor.go Updates signature to accept GasProcessingPolicy (unused).
process/block/preprocess/rewardTxPreProcessor_test.go Updates calls to include GasProcessingPolicy.
process/block/preprocess/gasTracker.go Adds policy-aware gas limit checks (enforce legacy limit during drain window).
process/block/preprocess/gasTracker_test.go Adds test ensuring policy-enforced raw limit is respected after factor/epoch is latched.
process/block/preprocess/basePreProcess.go Centralizes “max gas limit used for dest-me txs” logic with policy override support.
process/block/preprocess/basePreProcess_test.go Adds unit test for policy-aware dest-me max gas limit selection.
process/block/metablock.go Updates coordinator call to include new parameters (partial-exec allowance + policy).
process/block/metablock_test.go Updates mocks to match new coordinator signature.
process/block/export_test.go Updates exported test helpers for new shardProcessor internals/signatures.
process/block/baseProcess.go Enhances Supernova transition blocking (counts non-final miniblocks, checks tracker unfinished work) and adds drain-rule enforcement.
process/block/baseProcess_test.go Adds test coverage for tracker-based transition blocking and for drain-window rule validation.
integrationTests/mock/transactionCoordinatorMock.go Updates integration-test mock for new coordinator parameters.
genesis/process/disabled/processedMiniBlocksTracker.go Adds disabled implementation for HasUnfinishedMiniBlocks().
factory/disabled/txCoordinator.go Updates disabled txCoordinator signature to include new params.
common/configParser_test.go Adds test asserting released config values for Supernova drain-related settings.
common/common.go Adds IsInSupernovaDrainWindowForEpochAndRound() helper.
common/common_test.go Adds unit tests for the new drain-window helper.
cmd/node/config/config.toml Updates process config-by-epoch for drain/transition behavior (adds pre-Supernova epoch config).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +2533 to +2534
allowScheduledMode: allowStartingPartialExecution,
allowStartingPartialExecution: allowStartingPartialExecution,
# ProcessConfigsByEpoch represents the configuration of process configuration parameters by epoch
ProcessConfigsByEpoch = [
{ EnableEpoch = 0, MaxMetaNoncesBehind = 15, MaxMetaNoncesBehindForGlobalStuck = 30, MaxShardNoncesBehind = 15 },
# TODO: this must be set to the pre-Supernova epoch
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.

2 participants