Skip to content

Save account revert fix#7883

Open
BeniaminDrasovean wants to merge 6 commits into
feat/testnet-fixesfrom
save-account-revert-fix
Open

Save account revert fix#7883
BeniaminDrasovean wants to merge 6 commits into
feat/testnet-fixesfrom
save-account-revert-fix

Conversation

@BeniaminDrasovean

@BeniaminDrasovean BeniaminDrasovean commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Reasoning behind the pull request

  • This branch improves the atomicity of account state updates. Previously, saving an account could modify several data-trie or code entries before encountering an error. Although SaveAccount returned an error, some earlier changes could remain applied, leaving the in-memory state inconsistent with the account journal.

Proposed changes

  • Partially applied data-trie updates are rolled back when saving fails.
  • Code changes are journaled before reference counts are modified.
  • Reverting code restores the exact previous state instead of relying on inverse reference-count operations.
  • Retrying a failed snapshot revert does not execute already completed journal entries again.

Testing procedure

  • Normal tests + import-db

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?

@BeniaminDrasovean BeniaminDrasovean self-assigned this Jun 18, 2026
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.58%. Comparing base (4d94bfb) to head (bbb8f17).
⚠️ Report is 10 commits behind head on feat/testnet-fixes.

Files with missing lines Patch % Lines
state/trackableDataTrie/trackableDataTrie.go 86.36% 2 Missing and 1 partial ⚠️
state/accountsDB.go 97.50% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           feat/testnet-fixes    #7883      +/-   ##
======================================================
+ Coverage               77.57%   77.58%   +0.01%     
======================================================
  Files                     884      884              
  Lines                  125210   125223      +13     
======================================================
+ Hits                    97130    97158      +28     
- Misses                  21628    21630       +2     
+ Partials                 6452     6435      -17     

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

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.

1 participant