partial continuation during supernova drain window - #7983
Open
AdoAdoAdo wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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.GasProcessingPolicyand resolves it from the candidate header to apply legacy gas-limit overrides during the drain window. - Extends
TransactionCoordinatorandPreProcessorinterfaces 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?