Skip to content

TODOs#7880

Open
sstanculeanu wants to merge 12 commits into
feat/testnet-fixesfrom
todos
Open

TODOs#7880
sstanculeanu wants to merge 12 commits into
feat/testnet-fixesfrom
todos

Conversation

@sstanculeanu

@sstanculeanu sstanculeanu commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Reasoning behind the pull request

  • TODOs

Proposed changes

  • TODOs fixed/removed:
    • // TODO add also max estimated block gas capacity + // TODO add also max estimated block gas capacity - used gas must be lower than this -> implemented, now uses the block capacity from economics data
    • // TODO: check if miniblocks and txs are set in a deterministic way (check if there are map iterations that can generate non-deterministic results) -> checked with @ssd04 , should be safe to remove todo
    • // todo: extract the epoch change proposal execution result here -> fixed, now all execution results are checked to find the proper epoch changed proposed header
    • // TODO: analyse error handling here -> checked with @ssd04 , this is old code and should be safe as before
    • // TODO use the right object, not a disabled one -> fixed, integrated the real transactions processor
    • // TODO use the right information below -> fixed, now data is fetched from chain handler
    • // TODO adjust this method if needed for Supernova -> removed todo, execution state should be correctly loaded at bootstrap from the headers
    • // TODO: the trigger would need to be changed upon commit of a block with the epoch start results -> removed todo, already handled
    • // TODO: set proper finalized header in outport -> checked with @BeniaminDrasovean , proper data is already set
    • // TODO: maybe rename this to reflect last execution results -> removed todo, not necessarily needed
    • // todo: check empty mini blocks vs nil. Same for block.Body.MiniBlocks -> removed todo, GetMiniBlockHeaderHandlers and GetMiniBlocks already normalizez empty slice to nil
    • // TODO: sanity check use the verify execution results method -> fixed, added call to VerifyHeaderExecutionResults
    • // TODO: this account adapter may be required to be changed as the roothash should be the last execution result roothash -> fixed, now trie is recreated everywhere

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?

@sstanculeanu sstanculeanu self-assigned this Jun 15, 2026
@sstanculeanu sstanculeanu added the ignore-for-release-notes Do not include item in release notes label Jun 15, 2026
@sstanculeanu sstanculeanu changed the title fixed some todos TODOs Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.72840% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.60%. Comparing base (53da698) to head (c9f95e6).

Files with missing lines Patch % Lines
factory/processing/processComponentsHandler.go 0.00% 7 Missing and 1 partial ⚠️
...external/transactionAPI/apiTransactionProcessor.go 37.50% 5 Missing ⚠️
...ess/estimator/executionResultInclusionEstimator.go 66.66% 4 Missing and 1 partial ⚠️
epochStart/metachain/economics.go 77.77% 3 Missing and 1 partial ⚠️
...ode/chainSimulator/components/processComponents.go 0.00% 3 Missing ⚠️
node/external/transactionAPI/check.go 50.00% 1 Missing and 1 partial ⚠️
process/block/baseProcess.go 75.00% 1 Missing and 1 partial ⚠️
process/block/shardblockProposal.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           feat/testnet-fixes    #7880      +/-   ##
======================================================
- Coverage               77.62%   77.60%   -0.02%     
======================================================
  Files                     885      885              
  Lines                  125425   125495      +70     
======================================================
+ Hits                    97357    97395      +38     
- Misses                  21585    21614      +29     
- Partials                 6483     6486       +3     

☔ 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.

@sstanculeanu sstanculeanu marked this pull request as ready for review June 17, 2026 16:01

func (bp *baseProcessor) recreateTrieIfNeeded() error {
rootHash := bp.blockChain.GetCurrentBlockRootHash()
prevHeader := bp.blockChain.GetCurrentBlockHeader()

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.

maybe you can extract this code in a new function ?

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 removes a number of stale TODOs by implementing the missing logic and wiring, mainly around Supernova/headerV3 execution results handling, gas-capacity-aware inclusion estimation, and using real runtime components (chain handler + tx processor) in the external transaction API.

Changes:

  • Add a max block gas capacity cap to ExecutionResultInclusionEstimator and wire it from economics data in block processor creation.
  • Strengthen block proposal sanity checks by verifying header execution results, and update trie recreation to use the last execution result root hash.
  • Wire real ChainHandler and TransactionProcessor into the external transaction API (replacing disabled placeholders) and expand test coverage/stubs accordingly.

Reviewed changes

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

Show a summary per file
File Description
process/estimator/executionResultInclusionEstimator.go Add gas-capacity-aware inclusion limiting for execution results.
process/estimator/executionResultInclusionEstimator_test.go Update constructor calls; add test for gas-capacity cap.
process/block/shardblockProposal.go Verify header execution results during shard block proposal creation.
process/block/shardblockProposal_test.go Adjust proposal tests for headerV3 execution results verification and updated estimator ctor.
process/block/shardblock.go Remove outdated TODOs related to Supernova/outport/final block info.
process/block/metablockProposal.go Remove outdated epoch-start trigger TODO.
process/block/metablock.go Remove outdated Supernova TODO in commit path.
process/block/metablock_test.go Update estimator ctor call signature in meta tests.
process/block/export_test.go Update estimator ctor call signature in export tests.
process/block/baseProcess.go Recreate trie using last execution result root hash derived from previous header.
process/block/baseProcess_test.go Update chain handler stubs to match new trie recreation behavior and estimator ctor.
node/external/transactionAPI/check.go Validate new required args: ChainHandler and TxProcessor.
node/external/transactionAPI/apiTransactionProcessor.go Store/use real chain handler + tx processor for selection and block info.
node/external/transactionAPI/apiTransactionProcessor_test.go Extend mocks and add coverage for nil chain handler; update constructors.
node/external/transactionAPI/apiTransactionArgs.go Add ChainHandler and TxProcessor to API transaction processor args.
node/chainSimulator/components/processComponents.go Expose TransactionProcessor() from process components holder.
integrationTests/vm/staking/metaBlockProcessorCreator.go Update estimator ctor signature; minor formatting alignment fix.
integrationTests/testSyncNode.go Update estimator ctor signature; minor formatting alignment fix.
integrationTests/testProcessorNodeWithTestWebServer.go Provide chain handler + tx processor to API transaction processor in integration setup.
integrationTests/testProcessorNode.go Update estimator ctor signature; pass headers pool into epoch economics args.
integrationTests/testFullNode.go Update estimator ctor signature; pass headers pool into epoch economics args.
integrationTests/mock/processComponentsStub.go Add TransactionProcessor() to integration test process components stub.
factory/state/stateComponents.go Remove outdated TODO about account adapter root hash behavior.
factory/processing/processComponentsHandler.go Add nil-check and accessor for transaction processor in managed process components.
factory/processing/processComponents.go Carry transaction processor through processComponents struct.
factory/processing/blockProcessorCreator.go Compute and pass max gas capacity to inclusion estimator; pass headers pool to epoch economics; expose tx processor.
factory/mock/processComponentsStub.go Add TransactionProcessor() to factory mock.
factory/interface.go Extend ProcessComponentsHolder with TransactionProcessor().
factory/api/apiResolverFactory.go Wire real chain handler + tx processor into API transaction processor creation.
errors/errors.go Add ErrNilTransactionProcessor for component validation.
epochStart/metachain/epochStartData.go Remove stale TODO on error handling note.
epochStart/metachain/economics.go Add headers pool dependency and use it to find the epoch-change-proposed header via execution results.
epochStart/metachain/economics_test.go Add headers pool stub; test nil headers pool; extend v3 economics args coverage.
consensus/broadcast/shardChainMessenger.go Remove stale determinism TODO.
config/config.go Remove stale TODO in estimator config comment.

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

Comment on lines +609 to +611
maxBlockGasCapacity := pcf.coreData.EconomicsData().MaxGasLimitPerBlock(pcf.bootstrapComponents.ShardCoordinator().SelfId())
overestimationFactor := pcf.coreData.EconomicsData().BlockCapacityOverestimationFactor()
maxBlockGasCapacity = maxBlockGasCapacity * overestimationFactor / 100
Comment on lines +1198 to +1200
maxBlockGasCapacity := pcf.coreData.EconomicsData().MaxGasLimitPerBlock(pcf.bootstrapComponents.ShardCoordinator().SelfId())
overestimationFactor := pcf.coreData.EconomicsData().BlockCapacityOverestimationFactor()
maxBlockGasCapacity = maxBlockGasCapacity * overestimationFactor / 100
ProposedInRound: 0,
}
//second execution result finishes in round 4, allignment will take its finish time as base. third small enough to fit so all accepted
// second execution result finishes in round 4, allignment will take its finish time as base. third small enough to fit so all accepted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release-notes Do not include item in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants