Repository navigation
Conversation
…CALL Admit storage reads, storage writes and logs after a closed value-free CALL when every CEI barrier and reentrancy window in the body is a closed transport (onlyClosedCallStateWindows via eraseClosedInteractions), building directly on #2934 (Refs #2911). - Verity/Core/Model/ByteCallStorageFrames.lean: CallKeepsCallerStorage hypothesis, persistent/transient post-call frame lemmas, and inertCallee satisfiability witness. - Trust surface: admitted functions carry reentrancyTrusted, allowPostInteractionWrites (when CEI is violated), and the unchecked solidity_post_call_state_access obligation. - Synthetic smoke checks (PostCallStateAccessChecks, CallbackTransferSequenceModel, PostCallWriteSequenceModel, PostCallEventSequenceModel), differential script (check_post_call_state_access.py), and updated rejection controls.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| \n### CI Failure Hints\n\nFailed jobs: `build-audits`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n``` |
|
Needs changes. Review of #2940 (Th0rgal, draft) at head SummaryThe semantics are sound. Post-call statements run against
The gaps are in evidence and labelling:
Findings (severity-ordered)
What I ran vs readRan:
Read only:
|
|
Hi @Th0rgal, Ben asked us to help land this one, so we'll push fix commits for the review findings above directly on top of your branch (our own commits only: nothing of yours is rewritten or force-pushed). Each push gets a fresh review and a verdict on its exact head. If you're pushing too, just let us know and we'll rebase our part. |
|
Thanks @fricoben! We're actively addressing all review findings from your review and will push fix commits directly on top of this branch (no force-push / no history rewrite, unless a clean rebase is needed after an earlier PR in the stack merges). Let's coordinate here so we don't duplicate effort. |
…tate access - Add real A/B/C re-entrant callback coverage (source EVM, Denote, compiled model) for SyntheticPostCallWrite, SyntheticCallbackTransfer, and SyntheticPostCallEvent in check_reentrant_callback.py using ReentrantCallbackHook / ReentrantCallResponderMocks (extended to 0..3 args, inert NO_CALLBACK, and read-only PURE_WORD view responder), pinning all four re-entry outcomes and no-callback negative controls. - Wire post-call-state-access into scripts/solidity_differential/suite.py (and EXPECTED_CAMPAIGN_CHECKS in test_solidity_differential.py) alongside reentrant-callback. - Add located negative controls for disallowed post-call shapes (call-then-codehash, value-call-then-write, delegatecall-then-write, second-call-value) to check_reentrant_callback_rejections.py, document Import.lean's post-call onlyClosedCallStateWindows check as defense in depth, and add four mutation anchors in check_memory_call_mutations.py (denote-yul-call-commit-world, reentrant-callback-commit-world, transport-erase-closed-interactions, transport-only-closed-call-state-windows). - Introduce a dedicated reentrancyAdversarial disposition on FunctionSpec (reported as reentrancy_adversarial in collectStaticOptOuts, accepted by validateReentrancyDisposition) instead of overloading reentrancyTrusted on the post-CALL path. - Extend CallKeepsCallerStorage in ByteCallStorageFrames.lean to frame storageArray alongside caller-owned storageWords (with executeChecked_storageArray_of_callKeepsCallerStorage). - Expand PostCallStateAccess.sol and A/B/C plans to exercise sequential calls (twoPingsThenCount), post-call require (pingThenRequire), bounded loop call+write (pingLoop), post-call address(this).balance (pingThenBalance), post-call typed view call (pingThenView), and try/catch storage reads (tryNotifyRead).
…post-call-state-access # Conflicts: # Compiler/SolidityImport/Import.lean # scripts/check_importer_name_selection.py
There was a problem hiding this comment.
OpenCodeReview first-pass review
🟡 Scout triage + 0/4 paquet(s) reviewés sémantiquement. 8 finding(s) (1 high / 7 medium); les hunks hors paquets restent à couvrir par un humain ou Codex.
Paquets non couverts par la review sémantique
- Compiler/SolidityImport/ReentrantCallResponderMocks.lean — error (Command failed: ocr review --from 2f421e6 --to 6286155 --format json --audience agent --rule /home/ubuntu/actions-runner-verity-ocr/_work/_temp/ocr-tools/rules.json --concurr)
- scripts/solidity_differential/check_reentrant_callback.py — error (Command failed: ocr review --from 2f421e6 --to 6286155 --format json --audience agent --rule /home/ubuntu/actions-runner-verity-ocr/_work/_temp/ocr-tools/rules.json --concurr)
- Verity/Core/Model/ByteCallStorageFrames.lean — error (Command failed: ocr review --from 2f421e6 --to 6286155 --format json --audience agent --rule /home/ubuntu/actions-runner-verity-ocr/_work/_temp/ocr-tools/rules.json --concurr)
- Contracts/SolidityImportSmoke/PostCallWriteSequenceModel.lean — error (Command failed: ocr review --from 2f421e6 --to 6286155 --format json --audience agent --rule /home/ubuntu/actions-runner-verity-ocr/_work/_temp/ocr-tools/rules.json --concurr)
📝 3 groupe(s) de paquets au-delà du budget n'ont eu que le triage scout.
Large Lean diff routed to bounded packet review: 13 Lean file(s), 1936 changed supported line(s). Scout triage fallback_deterministic; strong packet review required. Full-file OCR was not attempted.
✅ Posted 8 inline comment(s).
OCR pilot metrics & packet coverage
OCR pilot metrics
- Routing: large-lean-hotspots (router-v11)
- Changed files: 26 supported / 26 total; Lean 13, trust docs 1, workflow/scripts 9, contracts 2, docs 1
- Changed lines: 1936 supported; thresholds large Lean >=3 files or >800 lines
- OCR: status scout_triage; comments 8; files 7; tokens 0; tool calls 0; warnings 1; duration 673s
- Largest changed files: scripts/solidity_differential/check_reentrant_callback.py (+381/-70), Contracts/SolidityImportSmoke/PostCallStateAccessChecks.lean (+284/-0), Compiler/SolidityImport/ReentrantCallResponderMocks.lean (+135/-69), scripts/solidity_differential/check_post_call_state_access.py (+198/-0), Contracts/SolidityImportSmoke/PostCallStateAccess.sol (+143/-0)
Packet coverage
- Packet review: enabled; selected 8/8 packet(s)
- Scout: configured; status fallback_deterministic; model reviewer_scout
- Scout lenses: provenance, verification-independence, environment-determinism, proof-soundness; rubric items checked 3
- Scout provider HTTP status: 502
- Scout provider error: <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]--> <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]--> <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]--> <head> <title>thomas.md | 502: Bad gateway</title> <meta charset="UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="I
- Strong review: required; status blocked_packet_input
- Residual risk: Triaged top 8 deterministically ranked packet(s); remaining changed hunks/files require Codex or human proof review, and selected packets still need strong reviewer analysis.
- Strong packet-review blocker: Selected packets require semantic review; see packet review outcomes for actual coverage.
- Covered packets:
- Compiler/SolidityImport/ReentrantCallResponderMocks.lean:136 score 111 — theorem/public statement changed, public declaration/signature changed
- scripts/solidity_differential/check_reentrant_callback.py:144 score 89 — theorem/public statement changed, public declaration/signature changed
- Verity/Core/Model/ByteCallStorageFrames.lean:1 score 80 — public declaration/signature changed, changed imports
- Contracts/SolidityImportSmoke/PostCallWriteSequenceModel.lean:1 score 78 — public declaration/signature changed, changed imports
- Contracts/SolidityImportSmoke/PostCallEventSequenceModel.lean:1 score 78 — public declaration/signature changed, changed imports
- Contracts/SolidityImportSmoke/CallbackTransferSequenceModel.lean:1 score 78 — public declaration/signature changed, changed imports
- scripts/solidity_differential/check_post_call_state_access.py:1 score 73 — public declaration/signature changed, changed imports
- Compiler/SolidityImport/ReentrantCallResponderMocks.lean:9 score 62 — public declaration/signature changed
Pilot mode: advisory only. Codex Review remains the merge gate.
| · exact respond_staticcall_valid model oracle accounts request world hstatic | ||
| · cases respond model oracle accounts request world <;> | ||
| simp [Response.valid, hstatic] } } | ||
| environmentAt model oracle accounts gas emptyAccounts 1 |
There was a problem hiding this comment.
🟡 OCR scout — question de triage (non-review) [high]
Question de couverture pour le reviewer humain/Codex — pas une review sémantique finale ni une approbation.
Why flagged: theorem/public statement changed, public declaration/signature changed; 140 changed line(s) near Compiler/SolidityImport/ReentrantCallResponderMocks.lean:136. Signals: theorem/public statement changed, public declaration/signature changed.
Added-line sample:
- L136:
/-- Run the model's public entry point named by the payload selector in the callback frame, - L137:
using ′nestedCalls′ for any nested byte calls inside the callback. ′none′ is an instrumentation - L138:
failure. -/ - L140:
(callee : Nat) (calldata : Bytes) (nestedCalls : ByteCallEnvironment := {}) : - L141:
Option FrameResult :=
| 'scope': 'value-free CALLs whose callee re-enters the caller once (trailing and ' | ||
| 'post-CALL state access): source EVM / Denote / compiled model, plus ' | ||
| 'no-callback negative controls'}) | ||
| print(f'reentrant callback A/B/C agree ({", ".join(passed)}): {output}') |
There was a problem hiding this comment.
🟡 OCR scout — question de triage (non-review) [medium]
Question de couverture pour le reviewer humain/Codex — pas une review sémantique finale ni une approbation.
Why flagged: theorem/public statement changed, public declaration/signature changed; 367 changed line(s) near scripts/solidity_differential/check_reentrant_callback.py:144. Signals: theorem/public statement changed, public declaration/signature changed.
Added-line sample:
- L144:
"""The hook constructor's writes: selector, argument count, arg0..arg2 and flags.""" - L149:
def slot_word(row, account, slot): - L150:
"""Storage word at ′(account, slot)′ after one transaction, as a route observed it.""" - L151:
for owner, key, value in row['storage']: - L152:
if owner.lower() == account.lower() and int(key, 16) == slot:
| theorem callKeepsCallerStorage_inertCallee : CallKeepsCallerStorage inertCallee := | ||
| fun _ _ _ => ⟨fun _ _ => rfl, rfl⟩ | ||
|
|
||
| end Compiler.CompilationModel.Denote |
There was a problem hiding this comment.
🟡 OCR scout — question de triage (non-review) [medium]
Question de couverture pour le reviewer humain/Codex — pas une review sémantique finale ni une approbation.
Why flagged: public declaration/signature changed, changed imports; 98 changed line(s) near Verity/Core/Model/ByteCallStorageFrames.lean:1. Signals: public declaration/signature changed, changed imports.
Added-line sample:
- L1:
import Verity.Core - L2:
import Verity.Core.Model.ByteExternalCall - L3:
(empty) - L4:
/-! - L5:
# Caller-storage hypothesis for code after a byte ′CALL′
| SolidityImportSmoke.PostCallWriteSequenceModel.oracle args | ||
| (configure := Compiler.CompilationModel.SolidityImport.ReentrantCallResponderMocks.configure | ||
| SolidityImportSmoke.PostCallWriteSequenceModel.model | ||
| SolidityImportSmoke.PostCallWriteSequenceModel.oracle) |
There was a problem hiding this comment.
🟡 OCR scout — question de triage (non-review) [medium]
Question de couverture pour le reviewer humain/Codex — pas une review sémantique finale ni une approbation.
Why flagged: public declaration/signature changed, changed imports; 48 changed line(s) near Contracts/SolidityImportSmoke/PostCallWriteSequenceModel.lean:1. Signals: public declaration/signature changed, changed imports.
Added-line sample:
- L1:
import Compiler.SolidityImport.Import - L2:
import Compiler.SolidityImport.Differential - L3:
import Compiler.SolidityImport.SequenceRunner - L4:
import Compiler.SolidityImport.ReentrantCallResponderMocks - L5:
import Compiler.CompilationModel
| SolidityImportSmoke.PostCallEventSequenceModel.oracle args | ||
| (configure := Compiler.CompilationModel.SolidityImport.ReentrantCallResponderMocks.configure | ||
| SolidityImportSmoke.PostCallEventSequenceModel.model | ||
| SolidityImportSmoke.PostCallEventSequenceModel.oracle) |
There was a problem hiding this comment.
🟡 OCR scout — question de triage (non-review) [medium]
Question de couverture pour le reviewer humain/Codex — pas une review sémantique finale ni une approbation.
Why flagged: public declaration/signature changed, changed imports; 43 changed line(s) near Contracts/SolidityImportSmoke/PostCallEventSequenceModel.lean:1. Signals: public declaration/signature changed, changed imports.
Added-line sample:
- L1:
import Compiler.SolidityImport.Import - L2:
import Compiler.SolidityImport.Differential - L3:
import Compiler.SolidityImport.SequenceRunner - L4:
import Compiler.SolidityImport.ReentrantCallResponderMocks - L5:
import Compiler.CompilationModel
| SolidityImportSmoke.CallbackTransferSequenceModel.oracle args | ||
| (configure := Compiler.CompilationModel.SolidityImport.ReentrantCallResponderMocks.configure | ||
| SolidityImportSmoke.CallbackTransferSequenceModel.model | ||
| SolidityImportSmoke.CallbackTransferSequenceModel.oracle) |
There was a problem hiding this comment.
🟡 OCR scout — question de triage (non-review) [medium]
Question de couverture pour le reviewer humain/Codex — pas une review sémantique finale ni une approbation.
Why flagged: public declaration/signature changed, changed imports; 42 changed line(s) near Contracts/SolidityImportSmoke/CallbackTransferSequenceModel.lean:1. Signals: public declaration/signature changed, changed imports.
Added-line sample:
- L1:
import Compiler.SolidityImport.Import - L2:
import Compiler.SolidityImport.Differential - L3:
import Compiler.SolidityImport.SequenceRunner - L4:
import Compiler.SolidityImport.ReentrantCallResponderMocks - L5:
import Compiler.CompilationModel
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| sys.exit(main()) |
There was a problem hiding this comment.
🟡 OCR scout — question de triage (non-review) [medium]
Question de couverture pour le reviewer humain/Codex — pas une review sémantique finale ni une approbation.
Why flagged: public declaration/signature changed, changed imports; 198 changed line(s) near scripts/solidity_differential/check_post_call_state_access.py:1. Signals: public declaration/signature changed, changed imports.
Added-line sample:
- L1:
"""Imported storage reads, storage writes and logs after a closed CALL through source EVM, Denote and compiled model. - L2:
(empty) - L3:
′PostCallStateAccess.sol′ holds three synthetic contracts whose effects follow an - L4:
interaction: ′SyntheticPostCallWrite′ reads and writes storage, runs follow-up closed - L5:
calls, checks ′require′ over storage, loops over a closed call + write, reads
| let words := (List.range count).flatMap fun argIndex => | ||
| (List.range 32).map fun byteIndex => | ||
| UInt8.ofNat (slotValue world account (2 + argIndex) / 2 ^ (8 * (31 - byteIndex)) % 256) | ||
| selector ++ words |
There was a problem hiding this comment.
🟡 OCR scout — question de triage (non-review) [medium]
Question de couverture pour le reviewer humain/Codex — pas une review sémantique finale ni une approbation.
Why flagged: public declaration/signature changed; 64 changed line(s) near Compiler/SolidityImport/ReentrantCallResponderMocks.lean:9. Signals: public declaration/signature changed.
Added-line sample:
- L9:
slot 1 the argument count (0..3), slots 2..4 the argument words, slot 5 the flags, and slot 6 - L12:
Flags: - L13:
* bit 0 (′1′): revert with no data after a successful callback (or inert call). - L14:
* bit 1 (′2′): inert callee (increment the counter without calling back, then return or revert). - L15:
* bit 2 (′4′): read-only view responder (write no storage, return ′arg0′ as 32 bytes; answers
|
All review findings from @fricoben are addressed and non-draft CI is 100% green on exact head |
Summary
CALLwhen every CEI barrier and reentrancy window in the function body is a closed transport (onlyClosedCallStateWindows, viaeraseClosedInteractions), building directly on#2934(Refs#2911).Verity/Core/Model/ByteCallStorageFrames.leanwith the callee hypothesisDenote.CallKeepsCallerStorage, persistent/transient post-call frame lemmas, and theinertCalleesatisfiability witness (never assumed by imported models).reentrancyTrusted,allowPostInteractionWrites(when the unerased body violates CEI), and the unchecked obligationsolidity_post_call_state_access.PostCallStateAccess.sol,PostCallStateAccessChecks.lean,CallbackTransferSequenceModel.lean,PostCallWriteSequenceModel.lean,PostCallEventSequenceModel.lean), differential driver (check_post_call_state_access.py), and updatecheck_reentrant_callback_rejections.py,check_extcodehash_rejections.py,check_interface_static_call_rejections.py,docs/SOLIDITY_IMPORT.md, anddocs/TRUST_ASSUMPTIONS.md.Scope
main.#2934(#2911PR-1); synthetic fixtures only.Verification Receipts (Head
11e252100337463ae2377d97644cb9a2af15fed6)lake build Verity.Core.Model.ByteCallStorageFrames Compiler.SolidityImport.TransportBarriers Compiler.SolidityImport.Import Contracts.SolidityImportSmoke.PostCallStateAccessChecks Contracts.SolidityImportSmoke.InterfaceVoidCallTrustChecks Contracts.SolidityImportSmoke.CallbackTransferSequenceModel Contracts.SolidityImportSmoke.PostCallWriteSequenceModel Contracts.SolidityImportSmoke.PostCallEventSequenceModel: PASS (129 jobs,0 sorry/0 axiom/0 native_decidein diff).python3 scripts/solidity_differential/check_reentrant_callback_rejections.py: PASS (12/12 cases).python3 scripts/check_proof_length.py: PASS (0 proofs over 50 lines).make check(all lints, axioms, trust-surface registry, docs sync, macro health, storage layout, andpython3 -m unittest discover -s scripts -p 'test_*.py'): PASS (1025 tests OK).python3 scripts/check_importer_name_selection.py: PASS (48 importer files).