fix(directory): bound revocation candidate state - #71
Open
mj-deving wants to merge 3 commits into
Open
Conversation
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.
What
Why
Value-based marker discovery correctly avoids relying on an impossible StorageProgram-name prefix, but any chain participant can publish artifacts with a revocation-like shape. Invalid candidates cannot revoke a listing because publication still requires full RB-4 tuple, signer, hash, and signature verification. They could nevertheless grow per-listing scan state and repeated verification work without bound.
This change bounds that untrusted discovery state without weakening RB-4 validation or acceptance. Previously verified locators are the explicit exception because pruning must not make an already established revocation disappear.
Among unverified locators, current scan observations are retained before prior persisted candidates. Within each group, the first distinct locators in scan iteration order survive. A valid marker outside that 16-candidate window is not evaluated. Its publisher can anchor a fresh marker to re-enter discovery, but continued overflow can exclude that marker again. Once a marker passes RB-4, it is persisted in the protected set and later pruning cannot remove it.
Verification
At head
c8c99409d5a3263d75b67f2c2a66133022ec890e:bunx tsx --test test/verification.test.ts: 19 tests passed, including serialized restart and stale-state recovery;bun run test: 150 tests passed;bun run typecheck: passed;bun run build: passed; the local build emitted the expected warning becauseNEXT_PUBLIC_DIRECTORY_URLwas intentionally unset.No live Directory registration, deployment, chain anchor, or payment was performed.
Closes #67.