Skip to content

test(compat): replay the next upgrade from mainnet events 1.8.0 - #170

Merged
0xdevcollins merged 2 commits into
testnetfrom
chore/storage-replay-from-1.8.0
Oct 18, 2026
Merged

0xdevcollins merged 2 commits into
testnetfrom
chore/storage-replay-from-1.8.0

Conversation

@0xdevcollins

Copy link
Copy Markdown
Collaborator

Mainnet runs events 1.8.0 and profile 1.2.1 since the 17 October upgrade. The storage replay still started from 1.7.0 and 1.2.0. This PR moves it to the new baseline, so the next mainnet upgrade (events 2.1.0) is checked against real mainnet state.

Fixtures:

  • mainnet-events-1.8.0.wasm (acf70ca0…) and mainnet-profile-1.2.1.wasm (8a8a1208…): the live code, fetched by hash with stellar contract fetch. They replace the 1.7.0 and 1.2.0 files.
  • mainnet-state.json: contract data at ledger 65,003,455 (protocol 29, 2,295 entries), the first archive checkpoint after the upgrade. Running ./scripts/capture-mainnet-compat-snapshot.sh again with no ledger argument reproduces it byte for byte.

Replay changes (contracts/compatibility/src/lib.rs):

  • Upgrades events only, from 1.8.0 to this tree's 2.1.0. The profile here is still the deployed 1.2.1, so it is not upgraded.
  • Checks that the deployed build queues the proposal 17,280 ledgers out and refuses an early apply_upgrade with UpgradeTimelockNotElapsed.
  • Advances the ledger, then pauses, applies, runs migrate_events, migrates and unpauses, following runbook Section 4.
  • Fails at the start if contracts/profile no longer reports 1.2.1, so a profile change has to add its own upgrade to the replay.
  • Drops the pre-1.7.0 record assertions, since mainnet converted those records.
  • Unchanged: every event, its winners and their reputation must read the same before and after the upgrade, and the grant scenarios (including the milestone split) run on the upgraded contract.

Also updated: docs/storage-compatibility.md describes the new baseline and the refresh steps, and BACKLOG.md records the refresh as done.

This PR and #169 both edit BACKLOG.md and docs/storage-compatibility.md. Whichever merges second needs a small conflict fix.

Checked locally:

  • cargo fmt --check and cargo clippy --locked --all-targets -D warnings pass.
  • cargo test --workspace: 337 events and 60 profile tests pass.
  • ./scripts/test-storage-compat.sh passes.

Mainnet now runs events 1.8.0 and profile 1.2.1, so the storage replay
starts from those builds. The wasm fixtures are the live code fetched by
hash, and mainnet-state.json is ledger 65,003,455, the first archive
checkpoint after the upgrade. A second capture of that ledger produced the
same file.

The replay now upgrades events only, 1.8.0 to this tree's 2.1.0, because
the profile here is still the deployed 1.2.1. It checks that the deployed
build refuses an apply before its 17,280-ledger timelock, advances the
ledger, then pauses, applies, migrates and unpauses as the runbook does. The
test fails at the start if contracts/profile no longer reports 1.2.1, so a
profile change cannot ship without being replayed. The pre-1.7.0 record
checks are gone because mainnet converted those records.
@almanax-ai

almanax-ai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Plan expired

Your subscription has expired. Please renew your subscription to continue using CI/CD integration and other features.

…ay-from-1.8.0

# Conflicts:
#	BACKLOG.md
#	docs/storage-compatibility.md
@0xdevcollins
0xdevcollins merged commit 5b6defb into testnet Oct 18, 2026
3 checks passed
@0xdevcollins
0xdevcollins deleted the chore/storage-replay-from-1.8.0 branch October 18, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant