Repository navigation
fix(gateway): the pointer store is bound to the deployment it was verified on - #2620
Merged
Merged
Conversation
…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]>
There was a problem hiding this comment.
🟢 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
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.
Follow-up to #2614, from its Copilot review (#2614 (comment)).
A gateway restarted with the same
--data-dirbut another--chain-idor--publisher-registry-addressloaded the previous deployment's pointers and served their bundles, although nobody on the new deployment signed for them:Pointers::loadchecked 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 docwith warnings denied,cargo nextest run -p decdn-cli -p decdn-common, markdownlint;gateway_pointerandgateway_publicanvil 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