fix(rpc): reject unsupported full state overrides#58
Conversation
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
left a comment
There was a problem hiding this comment.
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 passedcargo check -p zksync_os_rpc-> passedgit 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.
Avoid returning stale storage for AccountOverride.state by failing fast until the flat storage view can represent full account-storage replacement semantics.