feat(proofs): axiomatize mapping-slot collision-resistance - #2361
Merged
Conversation
Add solidityMappingSlot_injective: distinct (base, key) ABI pairs map to distinct Solidity slots. This is keccak collision-resistance on the 64-byte mapping preimage, not injectivity of keccak256 on all ByteArrays. Prove writeMap_aligned_preserves_mappingCoherent from that axiom. Document the trust boundary. C5 step 4 is not axiom-free complete.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_8e964919-ab6d-4f44-9705-d922eea63cc4) |
Contributor
| \n### CI Failure Hints\n\nFailed jobs: `build`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n``` |
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.
Summary
solidityMappingSlot_injective:keccak256(abi.encode(key, base))does not collide on distinct(base, key)pairswriteMap_aligned_preserves_mappingCoherent(global aligned address-map write)AXIOMS.md,check_axioms.py, and Layer-2 docsync (Layer 2 stays 0 axioms)writeSlotall-keys remains openTest Plan
lake build Compiler.Proofs.Storage.MappingCoherencemake checkRelated
C5 step 4 increment. Issue 2330 stays open.
Note
Medium Risk
Adds a cryptographic collision-resistance axiom used by global mapping-coherence preservation; a collision on the ABI mapping preimage family would falsify that theorem, though finite certificate paths remain axiom-free.
Overview
Reintroduces a single documented project axiom,
solidityMappingSlot_injective, for collision-resistance ofkeccak256(abi.encode(key, base))on distinct(base, key)pairs — not injectivity of keccak on arbitrary byte strings. The mapping-slot range property stays a proved theorem via the kernel Keccak engine.On top of that axiom, the PR adds
solidityMappingSlot_ne, nestedabstractNestedMappingSlot_injective/_ne, and mapping-coherence lemmas (addressToWord_injective, distinctStorageKey.map*⇒ distinct derived slots). It proves global preservation of address-keyedMappingCoherentunder alignedwriteMap+writeSlot(writeMap_aligned_preserves_mappingCoherent). Finite-list / certificate-based preservation inMappingCoherenceOnis unchanged and still does not need the axiom.Trust and CI:
AXIOMS.md,AUDIT.md,TRUST_ASSUMPTIONS.md,docs/ROADMAP.md,verification_status.json,llms.txt, andscripts/check_axioms.py/docsync.pynow record 1 active axiom (Layer 2 compilation proofs remain 0 axioms).PrintAxiomsregisters the new theorems.Docs explicitly state C5 step 4 is not axiom-free complete; lone
writeSlotall-keysMappingCoherentpreservation stays open.Reviewed by Cursor Bugbot for commit 7ff15db. Bugbot is set up for automated code reviews on this repo. Configure here.