Repository navigation
fix(genvm): serve latest-finalized storage reads from finalized state 🐛 - #1792
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/run-e2e all Frozen landing cut: #1792 alone, head |
|
E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally. |
|
/merge-train |
|
The request is recorded and waiting for processing. Follow the E2E and merge checks for progress. Do not post a duplicate command. |
danieljrc888
left a comment
There was a problem hiding this comment.
Reviewed: LATEST_FINALIZED reads are served from the finalized state with status-keyed caches; unit tests and full E2E (run-39627496386) are green on this exact head.
|
/merge-train |
|
The request is recorded and waiting for processing. Follow the E2E and merge checks for progress. Do not post a duplicate command. |
Fixes #1791
Problem and outcome
A cross-contract
view(state=LATEST_FINAL)/LATEST_FINALIZEDmakes GenVM call hoststorage_readwith mode1.Host.storage_readhadassert type != StorageView.LATEST_FINALIZED; theAssertionErrorescaped the host loop, andrun_genvm_hosttreated it as a transient failure, retrying with exponential backoff (5s, 10s, 20s, …) until the 600s budget ran out:gen_callhangs for 600s and returns-32603 Internal error(behind Cloudflare: 524 after ~125s)CONSENSUS_LEADER_EXEC_TIMEOUT/Leader execution exceeded 600.000sThe prd image (
v0.121.24) andv0.123-devboth contain the assert.Now
LATEST_FINALIZEDreads are served from the contract'sfinalizedstate. Slots without a finalized value (including contracts that are not finalized yet, or have no finalized bucket) read as zeroes.DEFAULT/LATEST_DECIDEDreads are unchanged.Implementation and validation
StateProxy.storage_read_finalized: defaults to zeroes, for proxies with no finalized state such as_StateProxyNone_SnapshotViewimplements it overstates["finalized"]. The decode caches are now keyed by state status, so accepted and finalized reads of the same slot can't alias, and writes don't leak into the finalized viewtests/unit/test_storage_read_latest_finalized.py: red onv0.123-dev(theAssertionError), green with the fix. Fulltests/unit/suite passesLocal stack, with a minimal source and caller contract (not the reporter's code):
v0.121.24(prd)read_default,read_latest_non_finalv0.121.24(prd)read_latest_final-32603after 600.2s; 7 GenVM attempts, eachAssertionErrorinhost_loopread_latest_finalset_markeraccepted, not finalizedconsume_latest_finalwriteMAJORITY_AGREE, leaderSUCCESS, 15sNot in scope
HostExceptionraised from a host callback still turns into retries until the time budget runs outLATEST_DECIDED: still follows the run'sstate_status, whichread_contract_majorrelies on