Skip to content

fix(rpc): reject unsupported full state overrides#58

Open
sidhujag wants to merge 1 commit into
mainfrom
fix/state-override-full-state
Open

fix(rpc): reject unsupported full state overrides#58
sidhujag wants to merge 1 commit into
mainfrom
fix/state-override-full-state

Conversation

@sidhujag

@sidhujag sidhujag commented May 7, 2026

Copy link
Copy Markdown
Member

Avoid returning stale storage for AccountOverride.state by failing fast until the flat storage view can represent full account-storage replacement semantics.

Avoid returning stale storage for AccountOverride.state by failing fast until the flat storage view can represent full account-storage replacement semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>

@mickeyjoes mickeyjoes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review looks clean, but I am requesting changes because the PR is currently merge-conflicted against main (mergeStateStatus: DIRTY) and the main CI jobs for build/format/test were cancelled. Please rebase/merge latest main, resolve the conflicts, and rerun CI.

I did not find code-level issues in the patch. The approach is sound: keep sparse stateDiff support, reject full AccountOverride.state as invalid params instead of silently treating it as sparse storage, and preserve fallback reads for non-overridden slots.

Checks run locally on PR head:

  • cargo test -p zksync_os_storage_api state_override_view -- --nocapture -> 2 passed
  • cargo check -p zksync_os_rpc -> passed
  • git diff --check origin/main...HEAD -> passed

Optional follow-up, not blocking: after rebase, consider adding an RPC-level test that sends full state through eth_call and asserts the JSON-RPC error is invalid params, so the error mapping in lib/rpc/src/result.rs is covered end to end.

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.

2 participants