QA: Verify Token-2022 (T2022) on Anvil ↔ Solana ↔ Terra Classic #97

Closed
opened 2026-04-01 14:44:45 +00:00 by PlasticDigits · 8 comments
PlasticDigits commented 2026-04-01 14:44:45 +00:00 (Migrated from gitlab.com)

Scope

Verify the Token-2022 (T2022) QA token path after a full make start-qa bring-up (branch feat/solana-integration).

Background

  • The Docker Solana test validator clones the Token-2022 program (TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb) alongside wSOL.
  • npm run qa:full-token-setup deploys T2022 on Anvil + Anvil1 (ERC20), Terra (CW20), and Solana (SPL Token-2022 mint), registers bridge mappings, and merges ANVIL_*_T2022, TERRA_T2022, SOLANA_T2022 into .deploy/local.env plus VITE_*_T2022 via the QA write scripts.

Checklist

  1. Pull latest feat/solana-integration and run make start-qa on the QA host (or confirm a recent successful run).
  2. With .deploy/local.env sourced, run ./scripts/qa/verify-qa-onchain.sh and confirm ANVIL_T2022, ANVIL1_T2022, TERRA_T2022, and SOLANA_T2022 checks pass.
  3. Manual transfer smoke: select T2022 from the bridge token list and exercise at least one path across Anvil ↔ Solana ↔ Terra Classic (deposit/withdraw as applicable per direction).
  4. Confirm Settings → Faucet does not expose T2022 (by design: cl8y_faucet registers classic SPL mints only). Fund Token-2022 ATAs manually or via script if Solana-side balance is needed.

Docs

  • scripts/qa/README.md — Token-2022 / T2022 section and faucet note.
## Scope Verify the **Token-2022 (T2022)** QA token path after a full `make start-qa` bring-up (branch `feat/solana-integration`). ## Background - The Docker Solana test validator clones the Token-2022 program (`TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb`) alongside wSOL. - `npm run qa:full-token-setup` deploys **T2022** on Anvil + Anvil1 (ERC20), Terra (CW20), and Solana (SPL Token-2022 mint), registers bridge mappings, and merges `ANVIL_*_T2022`, `TERRA_T2022`, `SOLANA_T2022` into `.deploy/local.env` plus `VITE_*_T2022` via the QA write scripts. ## Checklist 1. Pull latest `feat/solana-integration` and run `make start-qa` on the QA host (or confirm a recent successful run). 2. With `.deploy/local.env` sourced, run `./scripts/qa/verify-qa-onchain.sh` and confirm **ANVIL_T2022**, **ANVIL1_T2022**, **TERRA_T2022**, and **SOLANA_T2022** checks pass. 3. Manual transfer smoke: select **T2022** from the bridge token list and exercise at least one path across **Anvil ↔ Solana ↔ Terra Classic** (deposit/withdraw as applicable per direction). 4. Confirm **Settings → Faucet** does **not** expose T2022 (by design: `cl8y_faucet` registers classic SPL mints only). Fund Token-2022 ATAs manually or via script if Solana-side balance is needed. ## Docs - `scripts/qa/README.md` — Token-2022 / T2022 section and faucet note.
PlasticDigits commented 2026-04-01 14:44:45 +00:00 (Migrated from gitlab.com)

assigned to @Brouie

assigned to @Brouie
Brouie commented 2026-04-04 02:22:39 +00:00 (Migrated from gitlab.com)

T2022 (TTWT) onchain verification on 84c8df3:

verify-qa-onchain.sh: all T2022 checks pass (ANVIL_T2022, ANVIL1_T2022, TERRA_T2022, SOLANA_T2022).

frontend Verify page: 24/24 pass across all 4 chains:

  • Anvil: registered, dest mappings to Anvil1/Terra/Solana, incoming decimals from all chains
  • Anvil1: same as Anvil
  • LocalTerra: dest mappings to Anvil/Anvil1, incoming mappings from Anvil/Anvil1
  • Solana: Terra bridge dest+incoming mappings, TokenMapping PDAs for Anvil/Anvil1/Terra, bridge SPL vault exists

faucet correctly does NOT list TTWT (by design -- cl8y_faucet registers classic SPL only). confirmed.

smoke transfer not done yet -- need to fund TTWT manually on Solana (spl-token mint requires keypair inside container). can test EVM->Solana TTWT if Anvil faucet claim works.

T2022 (TTWT) onchain verification on 84c8df3: verify-qa-onchain.sh: all T2022 checks pass (ANVIL_T2022, ANVIL1_T2022, TERRA_T2022, SOLANA_T2022). frontend Verify page: 24/24 pass across all 4 chains: - Anvil: registered, dest mappings to Anvil1/Terra/Solana, incoming decimals from all chains - Anvil1: same as Anvil - LocalTerra: dest mappings to Anvil/Anvil1, incoming mappings from Anvil/Anvil1 - Solana: Terra bridge dest+incoming mappings, TokenMapping PDAs for Anvil/Anvil1/Terra, bridge SPL vault exists faucet correctly does NOT list TTWT (by design -- cl8y_faucet registers classic SPL only). confirmed. smoke transfer not done yet -- need to fund TTWT manually on Solana (spl-token mint requires keypair inside container). can test EVM->Solana TTWT if Anvil faucet claim works.
Brouie commented 2026-04-20 04:14:53 +00:00 (Migrated from gitlab.com)

@PlasticDigits Tried to run make start-qa today to complete the T2022 smoke transfer (only outstanding item from 4/4 verification).

Stack failed during Solana deploy with DeclaredProgramIdMismatch (Anchor Error 4100):

Program 74o1KKwuUvtrf6ozbjmVrARnoHpQ4WjsQ647TCTKe1mW invoke [1]
Program log: AnchorError occurred. Error Code: DeclaredProgramIdMismatch. Error Number: 4100. Error Message: The declared program id does not match the actual program id.
Program 74o1KKwuUvtrf6ozbjmVrARnoHpQ4WjsQ647TCTKe1mW failed: custom program error: 0x1004
Error creating IDL account: RPC response error -32002
make[1]: *** [Makefile:357: deploy-solana] Error 1

Likely stale keypair or build artifact after the server reboot. Can you take a look or give me steps to reset the Solana localnet state? T2022 smoke blocked until start-qa completes.

@PlasticDigits Tried to run make start-qa today to complete the T2022 smoke transfer (only outstanding item from 4/4 verification). Stack failed during Solana deploy with DeclaredProgramIdMismatch (Anchor Error 4100): ``` Program 74o1KKwuUvtrf6ozbjmVrARnoHpQ4WjsQ647TCTKe1mW invoke [1] Program log: AnchorError occurred. Error Code: DeclaredProgramIdMismatch. Error Number: 4100. Error Message: The declared program id does not match the actual program id. Program 74o1KKwuUvtrf6ozbjmVrARnoHpQ4WjsQ647TCTKe1mW failed: custom program error: 0x1004 Error creating IDL account: RPC response error -32002 make[1]: *** [Makefile:357: deploy-solana] Error 1 ``` Likely stale keypair or build artifact after the server reboot. Can you take a look or give me steps to reset the Solana localnet state? T2022 smoke blocked until start-qa completes.
Brouie commented 2026-04-20 05:02:20 +00:00 (Migrated from gitlab.com)

mentioned in issue #96

mentioned in issue #96
PlasticDigits commented 2026-04-20 05:59:37 +00:00 (Migrated from gitlab.com)

Investigation: DeclaredProgramIdMismatch (Anchor 4100) vs T2022 smoke

The Solana deploy failure is not explained by “reset localnet only.” The built bridge binary embeds declare_id!("4XX8ndYXupw4Sb4SsRgAPTmBJJjfZbg8rWjj87iKEhVt") in programs/cl8y-bridge, but anchor deploy signs with whatever keypair scripts/solana/anchor-deploy-localnet.sh resolves (CL8Y_BRIDGE_PROGRAM_KEYPAIR_PATH → keys/private/cl8y_bridge-keypair.json → keys/localnet/cl8y_bridge-keypair.json).

The program id in the error log (74o1KKwuUvtrf6ozbjmVrARnoHpQ4WjsQ647TCTKe1mW) matches the pubkey of the committed fallback keys/localnet/cl8y_bridge-keypair.json, which does not match declare_id! / Anchor.toml. If keys/private/cl8y_bridge-keypair.json is missing on the QA host (fresh clone, wiped volume, never copied), deploy falls through to that fallback and Anchor correctly raises DeclaredProgramIdMismatch.

Unblock: restore or point CL8Y_BRIDGE_PROGRAM_KEYPAIR_PATH at the bridge keypair whose pubkey is 4XX8ndYXupw4Sb4SsRgAPTmBJJjfZbg8rWjj87iKEhVt, then rerun make start-qa. Resetting Docker/Solana ledger may still help for a clean validator, but it does not fix the ID mismatch without the correct keypair.

T2022 smoke remains the last checklist item once start-qa completes; Solana TTWT funding is still manual (faucet excludes T2022 by design).

Repo follow-up (optional): align or document the keys/localnet bridge fallback so it cannot diverge from declare_id!, or require keys/private explicitly—otherwise clones without the private keypair hit the same 4100.

Leaving this issue open until the manual T2022 transfer smoke is done.

## Investigation: `DeclaredProgramIdMismatch` (Anchor 4100) vs T2022 smoke The Solana deploy failure is **not** explained by “reset localnet only.” The built bridge binary embeds `declare_id!("4XX8ndYXupw4Sb4SsRgAPTmBJJjfZbg8rWjj87iKEhVt")` in `programs/cl8y-bridge`, but `anchor deploy` signs with whatever keypair `scripts/solana/anchor-deploy-localnet.sh` resolves (`CL8Y_BRIDGE_PROGRAM_KEYPAIR_PATH` → `keys/private/cl8y_bridge-keypair.json` → `keys/localnet/cl8y_bridge-keypair.json`). The program id in the error log (`74o1KKwuUvtrf6ozbjmVrARnoHpQ4WjsQ647TCTKe1mW`) matches the **pubkey of the committed fallback** `keys/localnet/cl8y_bridge-keypair.json`, which **does not** match `declare_id!` / `Anchor.toml`. If `keys/private/cl8y_bridge-keypair.json` is missing on the QA host (fresh clone, wiped volume, never copied), deploy falls through to that fallback and Anchor correctly raises **DeclaredProgramIdMismatch**. **Unblock:** restore or point `CL8Y_BRIDGE_PROGRAM_KEYPAIR_PATH` at the bridge keypair whose pubkey is `4XX8ndYXupw4Sb4SsRgAPTmBJJjfZbg8rWjj87iKEhVt`, then rerun `make start-qa`. Resetting Docker/Solana ledger may still help for a clean validator, but it does not fix the ID mismatch without the correct keypair. **T2022 smoke** remains the last checklist item once `start-qa` completes; Solana TTWT funding is still manual (faucet excludes T2022 by design). **Repo follow-up (optional):** align or document the `keys/localnet` bridge fallback so it cannot diverge from `declare_id!`, or require `keys/private` explicitly—otherwise clones without the private keypair hit the same 4100. Leaving this issue **open** until the manual T2022 transfer smoke is done.
PlasticDigits commented 2026-04-20 06:02:30 +00:00 (Migrated from gitlab.com)

We will need a new test flow for t2022 transfers. Token 2022 are less popular but do need to be verified, so this can wait.

We will need a new test flow for t2022 transfers. Token 2022 are less popular but do need to be verified, so this can wait.
Brouie commented 2026-04-20 09:15:53 +00:00 (Migrated from gitlab.com)

Thanks for the investigation. Confirms what I saw -- declare_id! 4XX8ndYXupw4Sb4SsRgAPTmBJJjfZbg8rWjj87iKEhVt didn't match the fallback keypair's pubkey (74o1KKwuUvtrf6ozbjmVrARnoHpQ4WjsQ647TCTKe1mW) that Anchor tried to deploy with.

To unblock on QA server: I'll need keys/private/cl8y_bridge-keypair.json copied over (current keys/private/ is empty after the server provision). Can you share that via secure channel when convenient, or set CL8Y_BRIDGE_PROGRAM_KEYPAIR_PATH to point at an existing path that has the correct keypair?

Agreed on the repo follow-up suggestion -- either align keys/localnet fallback with declare_id! or require keys/private explicitly with a clear error. Worth filing as its own issue.

Will tackle T2022 smoke once start-qa completes with the correct keypair. Issue stays open.

Thanks for the investigation. Confirms what I saw -- declare_id! 4XX8ndYXupw4Sb4SsRgAPTmBJJjfZbg8rWjj87iKEhVt didn't match the fallback keypair's pubkey (74o1KKwuUvtrf6ozbjmVrARnoHpQ4WjsQ647TCTKe1mW) that Anchor tried to deploy with. **To unblock on QA server:** I'll need keys/private/cl8y_bridge-keypair.json copied over (current keys/private/ is empty after the server provision). Can you share that via secure channel when convenient, or set CL8Y_BRIDGE_PROGRAM_KEYPAIR_PATH to point at an existing path that has the correct keypair? Agreed on the **repo follow-up suggestion** -- either align keys/localnet fallback with declare_id! or require keys/private explicitly with a clear error. Worth filing as its own issue. Will tackle T2022 smoke once start-qa completes with the correct keypair. Issue stays open.
Brouie commented 2026-04-21 05:20:06 +00:00 (Migrated from gitlab.com)

mentioned in issue #111

mentioned in issue #111
Brouie (Migrated from gitlab.com) closed this issue 2026-04-21 05:23:18 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-bridge-monorepo#97
No description provided.