Skip to content

fix(gateway): the pointer store is bound to the deployment it was verified on - #2620

Merged
thiras merged 1 commit into
mainfrom
fix/pointer-store-deployment
Oct 25, 2026
Merged

thiras merged 1 commit into
mainfrom
fix/pointer-store-deployment

Conversation

@thiras

@thiras thiras commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2614, from its Copilot review (#2614 (comment)).

A gateway restarted with the same --data-dir but another --chain-id or --publisher-registry-address loaded the previous deployment's pointers and served their bundles, although nobody on the new deployment signed for them: Pointers::load checked neither. Namespace ids repeat across chains and redeploys, so that is stale authorization, not a cosmetic mismatch.

Fix. Each stored record carries the chain id and the registry the owner was read on; Pointers::load(dir, chain_id, registry) refuses a record from another deployment with an error naming both and telling the operator to use another data dir or remove the pointers. The appendix and the CHANGELOG entry for #2614 say so.

Tests. a_store_from_another_deployment_is_refused (same deployment reloads; another chain or another registry fails). Gates: clippy --workspace --all-targets --all-features -D warnings, cargo doc with warnings denied, cargo nextest run -p decdn-cli -p decdn-common, markdownlint; gateway_pointer and gateway_public anvil e2es pass locally.

No store written by #2614 is deployed anywhere (pre-mainnet, redeploy not migrate), so there is no reader of the old record shape to keep.

🤖 Generated with Claude Code

…ified on

Each record carries the chain id and registry the owner was read on, and the
gateway refuses to start on a store written for another: namespace ids repeat
across chains and redeploys, so a data dir moved between them must not serve
pointers nobody there signed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 24, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The scoped fix consistently persists and validates deployment identity, covers both mismatch cases, and has no identified blocking issues.

No open issues 🎉

What changed in this PR

Binds persisted gateway namespace pointers to the deployment that verified them, preventing stale authorization when a data directory is reused with another chain or registry.

Changes:

  • Persist the chain ID and registry address with each pointer and reject mismatches at startup.
  • Pass the resolved deployment into the store and add regression coverage for both mismatch cases.
  • Document deployment binding and startup refusal behavior.
File Description
crates/​cli/​src/​commands/​gateway/​tests.rs Supplies deployment identity in gateway test setup.
crates/​cli/​src/​commands/​gateway/​pointer/​tests.rs Tests deployment mismatches and updates store fixtures.
crates/​cli/​src/​commands/​gateway/​pointer.rs Persists deployment identity and validates it during loading.
crates/​cli/​src/​commands/​gateway.rs Passes the resolved chain and registry to the store.
CHANGELOG.md Describes deployment-bound pointer persistence.
adr/​appendix-gateway.md Documents startup rejection of foreign-deployment records.

Review effort: Balanced

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main 38353ea fix/pointer-store-de... 9f8070b +/-
77% 77% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@thiras
thiras merged commit 8201798 into main Oct 25, 2026
35 checks passed
@thiras
thiras deleted the fix/pointer-store-deployment branch October 25, 2026 15:29
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.

2 participants