STR-3252: add bookkeeping to update tracked_balance field, tests#1845
STR-3252: add bookkeeping to update tracked_balance field, tests#1845delbonis wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df75333e10
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // accumulates this value and checks it against `extra_data.value_sent` | ||
| // in `process_chunks_on_acct`, so this subtraction stays bound to what | ||
| // the chunks actually emitted. | ||
| state.try_subtract_tracked_balance(*extra_data.value_sent())?; |
There was a problem hiding this comment.
Keep tracked-balance subtraction consistent with stored block state
Subtracting extra_data.value_sent here changes the state root produced by update processing, but the sequencer’s block assembly path still persists ExecBlockRecord.account_state without any corresponding output deduction (it only updates tip/queues in crates/alpen-ee/block-assembly/src/block.rs). bin/alpen-client/src/prover/spec_acct.rs then uses that persisted account_state().compute_state_root() as new_state, while this program now computes a lower post-state whenever chunk outputs carry value; for batches containing withdrawals/output messages, this creates a deterministic post-state root mismatch and breaks proof/update validation.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1845 +/- ##
===========================================
- Coverage 79.76% 65.67% -14.09%
===========================================
Files 674 668 -6
Lines 74805 74445 -360
===========================================
- Hits 59665 48891 -10774
- Misses 15140 25554 +10414
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 292 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Commit: 04b7265 SP1 Execution Results
|
Description
This PR adds bookkeeping to properly decrement the
tracked_balancefield ofEeAccountStatewhen we're processing an update.This requires adding a new extradata field. This is a narrow implementation of the recommendations of the ticket. This is really unfortunate, so I'm creating another PR that actually just removes this and the associated bookkeeping since it's only used as a sanity check and is not actually required for security.
Claude was used for a lot of the legwork.
Type of Change
Notes to Reviewers
Is this PR addressing any specification, design doc or external reference document?
If yes, please add relevant links:
Checklist
Related Issues