fix: gate sdk 27 storage compatibility - #102
Conversation
Quota reachedYour plan allows 300 CI/CD file units per month. You've used 299 and this scan would add 36 more (total: 335). |
📝 WalkthroughWalkthroughThis PR pins Rust and Stellar tooling, adds SDK 23-to-27 storage compatibility fixtures and tests, preserves legacy operation-marker reads, strengthens coordinated mainnet upgrade guards, and integrates reproducible builds and validation into CI and deployment documentation. ChangesSDK 27 upgrade readiness
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
deploy_mainnet.sh (1)
417-427: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the unused
assert_pending_events_versionhelper.This helper is only defined once in
deploy_mainnet.sh; all events-event version checks go throughassert_pending_events_upgrade, which also validateswasm_hash. Removing it avoids stale dead code that only checksnew_version.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy_mainnet.sh` around lines 417 - 427, Remove the unused assert_pending_events_version function from deploy_mainnet.sh, leaving assert_pending_events_upgrade as the sole helper for pending events upgrade validation, including wasm_hash checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AGENTS.md`:
- Around line 9-12: Add the text language tag to the Markdown fenced code block
containing the plugin commands in AGENTS.md, preserving both commands unchanged.
In `@contracts/compatibility/src/lib.rs`:
- Around line 383-386: The payout compatibility tests only verify recipient
deltas, leaving fee accrual untested. In contracts/compatibility/src/lib.rs
lines 383-386, capture fee_account’s balance before the grant and crowdfunding
payouts and assert the expected FEE_BPS fee delta alongside each recipient
assertion; in lines 522-523, do the same for the 50/50 prize split alongside
winner and second_winner assertions. Cover the single-position, multi-position,
and sweep variants while reusing the existing payout balance snapshots.
In `@docs/mainnet-deploy-runbook.md`:
- Line 488: Clarify the timelock guidance so the event check aborts when an
event already exists or returns any result other than EventNotFound; only
EventNotFound permits proceeding. Preserve the existing requirements to avoid
unpausing either contract, investigate ambiguous RPC errors, publish both ledger
values, and wait for the later availability ledger.
In `@docs/sdk27-compatibility-fixtures.md`:
- Around line 28-30: Update the paragraph describing the mainnet WASM files to
refer readers to the manifest for the contract IDs instead of claiming they
appear above, while preserving the existing statement about matching deployed
SHA-256 hashes.
In `@scripts/test-sdk27-compat.sh`:
- Around line 27-106: Update the SDK 27 compatibility flow around the stellar
version check and subsequent contract metadata/build commands so it can run
without an ambient stellar binary on PATH. Reuse the repository’s setup action
or local tool installation for CI, or provide the expected version through the
existing CI mock path, while preserving the current version validation and cargo
test behavior.
---
Nitpick comments:
In `@deploy_mainnet.sh`:
- Around line 417-427: Remove the unused assert_pending_events_version function
from deploy_mainnet.sh, leaving assert_pending_events_upgrade as the sole helper
for pending events upgrade validation, including wasm_hash checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7be80978-241e-4cf8-82d4-79c278da6fa0
⛔ Files ignored due to path filters (6)
Cargo.lockis excluded by!**/*.lockcontracts/compatibility/fixtures/events-1.3.0-sdk23.wasmis excluded by!**/*.wasmcontracts/compatibility/fixtures/events-1.5.0-sdk27.wasmis excluded by!**/*.wasmcontracts/compatibility/fixtures/mainnet-events-1.1.0-sdk23.wasmis excluded by!**/*.wasmcontracts/compatibility/fixtures/mainnet-profile-1.1.0-sdk23.wasmis excluded by!**/*.wasmcontracts/compatibility/fixtures/profile-1.2.0-sdk27.wasmis excluded by!**/*.wasm
📒 Files selected for processing (30)
.github/actions/setup-rust-stellar/action.yml.github/workflows/rustfmt.yml.github/workflows/verify-build.yml.gitignoreAGENTS.mdBACKLOG.mdcontracts/compatibility/Cargo.tomlcontracts/compatibility/fixtures/mainnet-state-63617727.jsoncontracts/compatibility/fixtures/manifest.jsoncontracts/compatibility/src/lib.rscontracts/compatibility/test_snapshots/exact_mainnet_snapshot_survives_h6_upgrade_to_sdk27.1.jsoncontracts/compatibility/test_snapshots/sdk23_pre27_prize_and_cancellation_keys_work_after_upgrade.1.jsoncontracts/compatibility/test_snapshots/sdk23_v110_rows_survive_h6_upgrade_to_sdk27.1.jsoncontracts/events/src/storage.rscontracts/events/src/tests/bounty_pillar.rscontracts/events/src/tests/escrow_fee_math.rscontracts/events/src/tests/hackathon_pillar.rscontracts/profile/src/storage.rsdeploy_and_upgrade.shdeploy_mainnet.shdocs/DEPLOYMENT.mddocs/contract-ops-runbook.mddocs/mainnet-deploy-runbook.mddocs/sdk27-compatibility-fixtures.mdscripts/capture-mainnet-compat-snapshot.shscripts/deploy/deploy.shscripts/deploy_and_upgrade.shscripts/test-mainnet-upgrade-guards.shscripts/test-sdk27-compat.shscripts/testdata/mock-stellar
💤 Files with no reviewable changes (1)
- contracts/events/src/tests/escrow_fee_math.rs
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/verify-build.yml (1)
56-62: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winSyntax-check every changed deployment script.
The current checks omit
deploy_and_upgrade.sh,scripts/deploy/deploy.sh, andscripts/deploy_and_upgrade.sh, although they are part of this pinned-build/deployment layer. A Bash syntax regression in those release paths could pass this workflow.Proposed addition
bash -n deploy_mainnet.sh + bash -n deploy_and_upgrade.sh bash -n scripts/capture-mainnet-compat-snapshot.sh + bash -n scripts/deploy/deploy.sh + bash -n scripts/deploy_and_upgrade.sh bash -n scripts/test-sdk27-compat.sh🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/verify-build.yml around lines 56 - 62, Update the “Check release script syntax” step in the workflow to also run bash -n against deploy_and_upgrade.sh, scripts/deploy/deploy.sh, and scripts/deploy_and_upgrade.sh, while preserving the existing syntax checks for all currently listed deployment scripts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/verify-build.yml:
- Around line 56-62: Update the “Check release script syntax” step in the
workflow to also run bash -n against deploy_and_upgrade.sh,
scripts/deploy/deploy.sh, and scripts/deploy_and_upgrade.sh, while preserving
the existing syntax checks for all currently listed deployment scripts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bb24301f-6c42-4739-b833-0588e1356163
⛔ Files ignored due to path filters (2)
contracts/compatibility/fixtures/events-1.5.0-sdk27.wasmis excluded by!**/*.wasmcontracts/compatibility/fixtures/profile-1.2.0-sdk27.wasmis excluded by!**/*.wasm
📒 Files selected for processing (11)
.github/workflows/verify-build.ymlAGENTS.mdcontracts/compatibility/fixtures/manifest.jsoncontracts/compatibility/src/lib.rscontracts/compatibility/test_snapshots/exact_mainnet_snapshot_survives_h6_upgrade_to_sdk27.1.jsoncontracts/compatibility/test_snapshots/sdk23_pre27_prize_and_cancellation_keys_work_after_upgrade.1.jsoncontracts/compatibility/test_snapshots/sdk23_v110_rows_survive_h6_upgrade_to_sdk27.1.jsondeploy_mainnet.shdocs/mainnet-deploy-runbook.mddocs/sdk27-compatibility-fixtures.mdscripts/test-sdk27-compat.sh
🚧 Files skipped from review as they are similar to previous changes (9)
- contracts/compatibility/fixtures/manifest.json
- docs/sdk27-compatibility-fixtures.md
- scripts/test-sdk27-compat.sh
- contracts/compatibility/test_snapshots/sdk23_pre27_prize_and_cancellation_keys_work_after_upgrade.1.json
- contracts/compatibility/src/lib.rs
- AGENTS.md
- contracts/compatibility/test_snapshots/sdk23_v110_rows_survive_h6_upgrade_to_sdk27.1.json
- docs/mainnet-deploy-runbook.md
- deploy_mainnet.sh
|
Solid work, this closes #91. Verified the key bits:
One blocker: this reverses the snapshot rule and blinds the scanner. Fix before merge:
Heads up: I didn't line-by-line the 698-line Close. The fix and fixtures are exactly right. |
38a40d7 to
f620ae7
Compare
f620ae7 to
de91a52
Compare
|
Addressed the requested changes:
The rebased GitHub build and rustfmt checks pass. Almanax still reports neutral because the account has used 299 of 300 monthly units and this scan requires 7. It will need to be rerun after quota is available. |
Summary
OpSeen(BytesN<32>)replay markers without weakening caller-namespaced writes.Verification
cargo test --release— 290 passed./scripts/test-sdk27-compat.sh— 3 passed./scripts/test-mainnet-upgrade-guards.sh— 45 passedstellar contract build --locked— passedtestnetwith fix(profile,events): replace saturating_add with checked_add + typed errors #101:31b27e9d5fe554e0710161dd9387693e166bdd755d985a9771b1ed71b9e28321d2d025d0f7c2c29e6dbd95401841cf62b8b61be608c48615cffb5934050890c0No mainnet transaction was submitted. Mainnet application remains gated by the deployment runbook and multisig prerequisites.
Closes #91