Skip to content

fix(sync): report only genuinely locked accounts in sync summary - #2340

Draft
igamigo wants to merge 1 commit into
nextfrom
igamigo-fix-acc-update
Draft

fix(sync): report only genuinely locked accounts in sync summary#2340
igamigo wants to merge 1 commit into
nextfrom
igamigo-fix-acc-update

Conversation

@igamigo

@igamigo igamigo commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

TODO: I will close this and open an issue that explains this + other fixes

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