core: fix finalStateDB pointing to backupStateDB (block-stm)#2137
core: fix finalStateDB pointing to backupStateDB (block-stm)#2137pratikspatil024 merged 1 commit intodevelopfrom
Conversation
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
LGTM — straightforward one-line bugfix ensuring finalStateDB points to the caller-visible statedb rather than the backup copy during fee-delay retry.
Extended reasoning...
Overview
This PR changes a single line in core/parallel_state_processor.go. In the retry path triggered by shouldRerunWithoutFeeDelay, the code resets statedb content via *statedb = *backupStateDB and then re-assigns finalStateDB on each task. The bug was that finalStateDB was set to backupStateDB (the copy) instead of statedb (the original pointer). Since Settle() writes all final state mutations to finalStateDB, and the caller of Process() expects results to be reflected through the statedb parameter, this was incorrect.
Security risks
No new security risks introduced. This is a correctness fix — the previous code could cause the caller to not see the final state from a retried parallel execution, which is a consensus-critical bug. The fix restores the correct behavior matching the initial task creation where finalStateDB: statedb is set.
Level of scrutiny
While this touches consensus-critical parallel state processing code, the change is a single variable reference fix with clear intent. The same fix has already been merged to master (6b8a6cc). The correctness can be verified by tracing the data flow: tasks are initially created with finalStateDB: statedb, and this retry path should maintain the same invariant.
Other factors
No bugs were found by automated analysis. The PR description template is unfilled, but the commit message clearly describes the intent. The change is minimal and self-evidently correct from reading the surrounding code.
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #2137 +/- ##
===========================================
+ Coverage 51.50% 51.52% +0.02%
===========================================
Files 882 882
Lines 154081 154081
===========================================
+ Hits 79352 79394 +42
+ Misses 69552 69517 -35
+ Partials 5177 5170 -7
... and 17 files with indirect coverage changes
🚀 New features to boost your workflow:
|



Description
Please provide a detailed description of what was done in this PR
Changes
Breaking changes
Please complete this section if any breaking changes have been made, otherwise delete it
Nodes audience
In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)
Checklist
Cross repository changes
Testing
Manual tests
Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it
Additional comments
Please post additional comments in this section if you have them, otherwise delete it