avoid root hash overwrite - #7961
Conversation
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 samerootHashwas already committed. - Ensure
Reset()clearslastCollectedRootHash/lastCommitHasStateChangesto 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.
…ge-cases add header hash support to block proposal state management
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?