Repository navigation
fix(contracts): snapshot-contracts refuses a version the network does not run - #763
Conversation
…oof does not name The guard compared sdk.version() with a floor. The SDK only ratchets upward, so an SDK seeded or pinned above the network would still write a snapshot at its own version, raising every reader's stored version. The version now comes from the proved answer's metadata and must equal the SDK's. The read moves into takeSnapshot so a fake SDK can test the refusal. Closes #748 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
The fake SDK now ratchets during getManyWithProof as the real one does, so reading the version before the read fails the testnet case. A pinned SDK and a contract missing from the answer are covered too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #748.
Problem
827ae9c unpinned the SDK, but the guard only checked
sdk.version() >= 14. The SDK ratchets its version upward and never down, so an SDK seeded or pinned above the network (a future SDK default, or a pin added back) would still write a snapshot at its own version. The web app raises every visitor's stored SDK version to the snapshot's, and nothing lowers it again. Nothing tested the guard.Fix
getManyWithProof(...).metadata.protocolVersion). It must equalsdk.version()and be at leastPROTOCOL_VERSION; otherwise nothing is written.takeSnapshot, and the check intosnapshotVersion. Tests run them against a fake SDK. The case where the SDK is at 15 and mainnet is at 14 is refused; the old guard let it through.Verified
node --test forge-contracts/scripts/snapshot-contracts.test.mjs: 6/6 pass.--outset to a scratch file matches the committed snapshots byte for byte: mainnet at 14 and testnet at 15.Compat: no committed snapshot changes. The web app and dg are untouched.
🤖 Generated with Claude Code
Summary by CodeRabbit