Skip to content

Conversation

@BeniaminDrasovean
Copy link
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?

@mariusmihaic mariusmihaic self-requested a review November 26, 2025 14:52
mariusmihaic
mariusmihaic previously approved these changes Nov 27, 2025
@BeniaminDrasovean BeniaminDrasovean marked this pull request as ready for review November 27, 2025 13:06
@BeniaminDrasovean BeniaminDrasovean self-assigned this Nov 27, 2025
Copilot finished reviewing on behalf of BeniaminDrasovean November 27, 2025 13:11
Copy link
Contributor

Copilot AI left a comment

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 refactors the state accesses collector to support tracking state accesses per root hash rather than maintaining a single global collection. The refactoring enables better support for HeaderV3 blocks with multiple execution results, where each execution result has its own root hash and associated state accesses.

Key changes:

  • Modified the StateAccessesCollector interface to use root-hash-based methods: GetStateAccessesForRootHash(), CommitCollectedAccesses(rootHash), and RemoveStateAccessesForRootHash()
  • Moved state access storage timing from before commit to after commit in accountsDB.go, ensuring the root hash is available
  • Removed explicit Reset() calls from block processors, relying instead on targeted cleanup via RemoveStateAccessesForRootHash()

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
state/interface.go Updated StateAccessesCollector interface to replace GetCollectedAccesses() and Store() with root-hash-aware methods
state/stateAccesses/collector.go Added stateAccessesForBlock map to store accesses per root hash, implemented new interface methods with proper locking
state/stateAccesses/collector_test.go Updated tests to call CommitCollectedAccesses() before retrieving state accesses via GetStateAccessesForRootHash()
testscommon/state/stateChangesCollectorStub.go Updated stub to match new interface with root-hash parameters
state/disabled/disabledStateChangesCollector.go Updated disabled implementation with new interface methods
state/accountsDB.go Moved CommitCollectedAccesses() call to after root hash is computed in commit flow
state/export_test.go Updated test helper to accept root hash parameter
state/accountsDB_test.go Updated tests to commit before resetting state accesses collector
outport/process/outportDataProvider.go Added logic to retrieve and remove state accesses for each root hash (supports both regular headers and HeaderV3)
process/block/shardblock.go Removed explicit Reset() call as cleanup now happens in outport
process/block/metablock.go Removed explicit Reset() call as cleanup now happens in outport
go.mod / go.sum Updated mx-chain-core-go dependency to version with StateAccessesForBlock support

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

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 70.58824% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.59%. Comparing base (1b7b6f5) to head (d2869f9).
⚠️ Report is 1 commits behind head on feat/supernova-async-exec.

Files with missing lines Patch % Lines
outport/process/outportDataProvider.go 63.15% 7 Missing ⚠️
state/stateAccesses/collector.go 78.57% 4 Missing and 2 partials ⚠️
state/accountsDB.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           feat/supernova-async-exec    #7480      +/-   ##
=============================================================
- Coverage                      77.59%   77.59%   -0.01%     
=============================================================
  Files                            872      872              
  Lines                         119417   119454      +37     
=============================================================
+ Hits                           92663    92685      +22     
- Misses                         20682    20694      +12     
- Partials                        6072     6075       +3     

☔ View full report in Codecov by Sentry.
📢 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.

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.

3 participants