fix(sync): report only genuinely locked accounts in sync summary - #2340
Draft
igamigo wants to merge 1 commit into
Draft
fix(sync): report only genuinely locked accounts in sync summary#2340igamigo wants to merge 1 commit into
igamigo wants to merge 1 commit into
Conversation
`SyncSummary::locked_accounts` listed every private account whose network commitment diverged from the local state. The store locks such an account only when the diverging commitment is absent from local history; a commitment that is already in history is stale network data and leaves the account usable. The summary therefore reported locks that never happened, which `miden-client-cli sync` printed verbatim as its "Locked accounts" count. `Client::sync_chain` now reads the lock status back after the update is applied and reports only the accounts that this sync locked, excluding those already locked beforehand. Adds a `sqlite-store` test covering the negative branch of the conditional lock, which had no coverage. Also consolidates the account-sync outcomes so they cannot be dropped in transit: `AccountUpdates` records the superseded local states alongside the public and mismatched-private updates, and `account_state_sync` discards the affected transactions itself rather than returning them for its caller to forward. Removes the unused duplicate `AccountUpdates` in `store::account`; `store` re-exports the `sync` type, so the path still resolves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO: I will close this and open an issue that explains this + other fixes