Repository navigation
Step 0.2/0.3: program swaps with the real buffer addresses - #2
Merged
Merged
Conversation
…fers The release patch from cookiechain/cookie-upgrade-plan (plans/4.1/release/0001-cookie-program-swaps.patch at 2d4d665), applied unchanged on top of C1: - Cookie token trigger CDJ9yJcfcJ2QkHaYhseA7jtihbhmNsBK46tZAJGsN9Xg, declared in feature-set/src/cookie.rs and chained into FEATURE_NAMES. - Token: loader v2 to upgradeable p-token 1.0.0 when the trigger goes live. - Stake: loader v2 to upgradeable stake 4.0.0 with SIMD-0196, then stake 5.0.0 with the v5 feature, read from Cookie buffers instead of upstream's. - Every swap refuses a buffer whose code does not match the expected hash. - One swap per program per boundary. Buffer addresses are still placeholders here; the next commit sets them. Co-Authored-By: n4pless <noobieless@tutanota.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan step 0.2 created the buffer keypairs on 10 Nov 2026 (offline; the key files are not in this repository). Their addresses replace the placeholders, so cookie_release_buffers_configured now passes: - token (p-token 1.0.0): 7anfKyfCz8krv8Jvmg9DLAjS9WvzfDY2XfBJZyLyoYBF - stake (stake 4.0.0): djJonZTCuwfU9hkuntGjLZeXf6bziS76PuwDJUfxqHm - stake v5 (stake 5.0.0): BYeWRbFpEi8wf5UCXypQJ9CvHh3UrfggqF6MYy1UuLCx The buffers themselves are written at step 0.7. Until then nothing exists at these addresses and the release behaves like 4.1.2. Also: the program files the tests read are ignored by git (a .gitignore inside cookie_programs/), and a missing file now says how to download it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Step 0.7 is done (10 Nov 2026). This settles the "write the buffers early" question, so the lamport-griefing window is closed. The faucet paid 3.58 COOK in rent plus about 0.003 COOK in fees. Each buffer was downloaded back and compared byte for byte with the release file before its authority was handed over.
Nothing reads these until steps 1–3, and only the multisig can now change or close them. |
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.
Upgrade plan Step 0.2 (buffer keypairs) and Step 0.3 items 1–3 (release code with the real buffer addresses, tests green). Base:
cookie/4.1.2with C1 merged (1f47903).Commits
51dbc0b4.1 program swaps is Sense'splans/4.1/release/0001-cookie-program-swaps.patchfrom cookie-upgrade-plan2d4d665, applied unchanged. It contains the token triggerCDJ9yJcf…, the token/stake/stake-v5 swaps from Cookie buffers, hash checks, one swap per program per boundary, and the COOKIE-TOUCHPOINTS rows.e797bedStep 0.2 is the only new change:declare_id!s inruntime/src/bank/builtins/core_bpf_migration/cookie.rsnow hold the real addresses. The doc comment there now says step 0.2; it wrongly said 0.1.cookie_programs/.gitignorekeeps the downloaded.sofiles out of git.unwrap.Buffer addresses (consensus constants)
token_buffer7anfKyfCz8krv8Jvmg9DLAjS9WvzfDY2XfBJZyLyoYBFstake_bufferdjJonZTCuwfU9hkuntGjLZeXf6bziS76PuwDJUfxqHmstake_v5_bufferBYeWRbFpEi8wf5UCXypQJ9CvHh3UrfggqF6MYy1UuLCxThe keypairs were made offline on 10 Nov 2026. Wesley holds them in two places off any server, and they are not in this repo.
Proof we hold the keys. Each key signed
Cookie 4.1 <name> <address>. Anyone can check this without the key:A typo in a consensus constant would need a new release, which is why this proof matters.
Tests (WSL, rust 1.95.0)
First download the program files:
plans/4.1/scripts/fetch_programs.sh runtime/src/bank/builtins/core_bpf_migration/cookie_programs. All three hashes match.cargo test -p solana-runtime --lib cookie -- --include-ignoredcookie_release_buffers_configured, which now passes (it is the placeholder check)cargo test -p solana-runtime --lib core_bpf_migrationcargo test -p agave-feature-set --features agave-unstable-apicargo clippy -p solana-runtime --lib --tests -- -D warningscargo clippy -p agave-feature-set --features agave-unstable-api --tests -- -D warningscargo +nightly fmt -p solana-runtime -p agave-feature-set -- --checkcargo +nightly fmt --all --checkreports diffs only insyscalls/. Those files are upstream and unchanged here; the diffs come from a newer nightly rustfmt, and the merged base shows them too.One thing to decide: write the buffers early
In 4.1.2,
solana program write-buffercreates the buffer with the systemCreateAccount. That refuses an address that already holds any lamports (AccountAlreadyInUse). Once these addresses are known, anyone could send 1 lamport to one of them and make the normal command fail.This is not fatal. System
AllocateandAssignonly need the buffer key's signature, so a small script could still build the buffer. Even so, the simple fix is to do step 0.7 soon after this merges, before the release reaches operators. The plan already allows this: nothing reads a buffer before its step, and the only ordering rule is "written before the step that uses it". Cost is about 3.6 COOK of rent, and the buffer authority then moves to vault 3.After merge
cookie/4.1.2with this PR, instead of applying the patch file. Record step 0.2 as done with these addresses.🤖 Generated with Claude Code