Repository navigation
Conversation
Contributor
|
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 |
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.
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