Skip to content

[BLOCKER] Deployed program has a declare_id mismatch — no on-chain settlement works (rebuild + redeploy + init_config) #236

@mehmethayirli

Description

@mehmethayirli

Problem

The program deployed at 5hstj5grBUL1BeSaPLYpgkD6n3ALasmbseRvKRFfCVNT (devnet) rejects every instruction with AnchorError 4100 — DeclaredProgramIdMismatch. As a result no real on-chain settlement has ever executed: getProgramAccounts(5hstj5gr…) returns 0 accounts (no Config, no JobEscrow, no ClaimListing). Every job in the app is DB/demo only (pda: none).

Root cause

Anchor's declare_id! guard runs at the start of every instruction and compares the program's baked-in id against the address it is executing at. The on-chain bytecode was built/deployed with a different declared id than 5hstj5gr…. The source is already correct (declare_id!("5hstj5gr…"), the IDL address, and Anchor.toml all match), so the deployed .so is simply stale — a clean rebuild from current source fixes the mismatch.

Evidence: a SystemProgram.transfer from the same keypair/RPC in the same script succeeds, so signing/RPC are fine — only the covenant program rejects.

Impact

Blocks the entire real on-chain lifecycle regardless of app code: create_job, accept_job, submit_work, finalize_payment, cancel_job, list_claim, buy_claim. C-014, C-015, C-018, C-019, C-081, C-083 cannot run on-chain, and the devnet-proof task #235 is blocked.

Fix — upgrade authority only

The program's upgrade authority is Gy5cU3bNH1DKsff6rp91H1BmtEfwspziR52WfmMVfbPZ; only that key can perform this.

  1. anchor build from current source (verifiable build preferred — see docs/VERIFIABLE_BUILD.md).
  2. anchor upgrade / solana program deploy the fresh .so to 5hstj5gr…, signed by the upgrade authority.
  3. Run init_config (arbitrators, fee, windows) — none exists yet.
  4. Verify: getProgramAccounts is non-zero, and app/scripts/hire-smoke.ts (funded poster → real create_job/accept/submit) prints valid Explorer links.

The app-side orchestration for the real hire (lib/hire-onchain.ts, unit-tested) is already in place and will execute the moment the program is redeployed — no app changes needed for this fix.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions