Skip to content

avoid root hash overwrite - #7961

Merged
AdoAdoAdo merged 11 commits into
feat/testnet-fixesfrom
fix-state-accesses-root-hash-overwrite
Aug 18, 2026
Merged

avoid root hash overwrite#7961
AdoAdoAdo merged 11 commits into
feat/testnet-fixesfrom
fix-state-accesses-root-hash-overwrite

Conversation

@BeniaminDrasovean

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?

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.68%. Comparing base (f082d88) to head (e157263).
⚠️ Report is 12 commits behind head on feat/testnet-fixes.

Files with missing lines Patch % Lines
state/stateAccesses/collector.go 84.37% 7 Missing and 3 partials ⚠️
state/errors.go 0.00% 9 Missing ⚠️
process/block/baseProcess.go 64.70% 5 Missing and 1 partial ⚠️
outport/process/outportDataProvider.go 80.00% 3 Missing ⚠️
factory/processing/processComponents.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           feat/testnet-fixes    #7961    +/-   ##
====================================================
  Coverage               77.68%   77.68%            
====================================================
  Files                     893      893            
  Lines                  129503   129612   +109     
====================================================
+ Hits                   100601   100691    +90     
- Misses                  22316    22330    +14     
- Partials                 6586     6591     +5     

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

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 adjusts the state accesses collector to avoid overwriting already-collected state accesses when CommitCollectedAccesses() is called multiple times with the same rootHash (e.g., repeated commits producing an identical root).

Changes:

  • Prevent overwriting stateAccessesForBlock[rootHash] if the same rootHash was already committed.
  • Ensure Reset() clears lastCollectedRootHash / lastCommitHasStateChanges to avoid unintended follow-up removals.
  • Add test coverage for “same root hash commit” behavior and for reset semantics after a duplicate-root commit.

Reviewed changes

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

File Description
state/stateAccesses/collector.go Adds duplicate-root detection to avoid map overwrite; resets internal “last commit” bookkeeping.
state/stateAccesses/collector_test.go Adds tests ensuring duplicate root commits don’t overwrite prior accesses and that reset doesn’t remove prior-root data.

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

Base automatically changed from feat/recon-by-meta to feat/testnet-fixes August 14, 2026 13:46
raduchis
raduchis previously approved these changes Aug 14, 2026
ssd04
ssd04 previously approved these changes Aug 18, 2026
…ge-cases

add header hash support to block proposal state management
@AdoAdoAdo
AdoAdoAdo dismissed stale reviews from ssd04 and raduchis via e157263 August 18, 2026 14:19
@AdoAdoAdo
AdoAdoAdo merged commit 1d9bd07 into feat/testnet-fixes Aug 18, 2026
11 checks passed
@AdoAdoAdo
AdoAdoAdo deleted the fix-state-accesses-root-hash-overwrite branch August 18, 2026 15:08
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.

5 participants