Skip to content

HIGH-004 - Fix cleanup on consensus reached and rename#7696

Merged
sstanculeanu merged 1 commit into
ai-audit-findingsfrom
supernova-async-exec-fix-findings
Feb 11, 2026
Merged

HIGH-004 - Fix cleanup on consensus reached and rename#7696
sstanculeanu merged 1 commit into
ai-audit-findingsfrom
supernova-async-exec-fix-findings

Conversation

@AdoAdoAdo

@AdoAdoAdo AdoAdoAdo commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Reasoning behind the pull request

This PR aligns naming around the async header/body storage by renaming “BlocksQueue” to “BlocksCache” across constructors/tests, and ensures async-execution state is cleaned when consensus is reached for HeaderV3 blocks.

Proposed changes

  • Rename ArgsExecutionManager.BlocksQueue to BlocksCache and update call sites (unit tests, integration tests, factory wiring).
  • Rename the test mock BlocksQueueMock to BlocksCacheMock and remove an unused eviction-subscriber mock.
  • Extend CleanOnConsensusReached to also evict cached header/body pairs at nonce+1 and add coverage for the new behavior + V3 path.

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 requested a review from Copilot February 11, 2026 11:47
@AdoAdoAdo AdoAdoAdo changed the title fixes Fix cleanup on consensus reached and rename Feb 11, 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

This PR aligns naming around the async header/body storage by renaming “BlocksQueue” to “BlocksCache” across constructors/tests, and ensures async-execution state is cleaned when consensus is reached for HeaderV3 blocks.

Changes:

  • Rename ArgsExecutionManager.BlocksQueue to BlocksCache and update call sites (unit tests, integration tests, factory wiring).
  • Rename the test mock BlocksQueueMock to BlocksCacheMock and remove an unused eviction-subscriber mock.
  • Extend CleanOnConsensusReached to also evict cached header/body pairs at nonce+1 and add coverage for the new behavior + V3 path.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
testscommon/processMocks/queue/blocksQueueEvictionSubscriberMock.go Removes an unused queue eviction subscriber mock (file deleted).
testscommon/processMocks/blocksCacheMock.go Renames the mock type from BlocksQueueMock to BlocksCacheMock.
process/block/shardblockProposal_test.go Updates execution manager args to use BlocksCache.
process/block/metablock_test.go Updates execution manager args to use BlocksCache.
process/block/export_test.go Renames local variable to blocksCache and wires it to both execution manager + headers executor.
process/block/baseProcess_test.go Renames local variable to blocksCache and wires it via BlocksCache.
process/block/baseProcessHeaderV3_test.go Adds a unit test asserting V3 path calls CleanOnConsensusReached.
process/block/baseProcess.go Calls executionManager.CleanOnConsensusReached() in the HeaderV3 branch before setting current header.
process/asyncExecution/headersExecutor_test.go Uses blocksCache naming and swaps mock to BlocksCacheMock.
process/asyncExecution/executionManager/executionManager_test.go Updates to BlocksCache args/errors and adds coverage for CleanOnConsensusReached evicting cache.
process/asyncExecution/executionManager/executionManager.go Renames arg field to BlocksCache; CleanOnConsensusReached now also evicts cached blocks at nonce+1.
process/asyncExecution/executionManager/errors.go Renames error from ErrNilBlocksQueue to ErrNilBlocksCache.
process/asyncExecution/cache/headerBodyCache_test.go Renames test name from queue terminology to cache terminology.
integrationTests/vm/staking/metaBlockProcessorCreator.go Wires BlocksCache into execution manager and headers executor.
integrationTests/testSyncNode.go Updates execution manager args to use BlocksCache.
integrationTests/testProcessorNode.go Updates execution manager args to use BlocksCache.
integrationTests/testFullNode.go Updates execution manager args to use BlocksCache.
factory/processing/processComponents.go Updates factory wiring to create/use blocksCache and pass it via BlocksCache.

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

@AdoAdoAdo AdoAdoAdo changed the title Fix cleanup on consensus reached and rename HIGH-004 - Fix cleanup on consensus reached and rename Feb 11, 2026
@AdoAdoAdo AdoAdoAdo marked this pull request as ready for review February 11, 2026 11:57
@sstanculeanu sstanculeanu merged commit 650b6d8 into ai-audit-findings Feb 11, 2026
13 checks passed
@sstanculeanu sstanculeanu deleted the supernova-async-exec-fix-findings branch February 11, 2026 14:58
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