fix(overlay-topics): read the uora anchor output exactly - #512
Draft
mo-jaber wants to merge 1 commit into
Draft
Conversation
readUoraAnchor reads the script's chunks instead of PushDrop.decode, refusing a locking key push that is not 33 bytes, a drop tail that is not exactly the drops the fields need, and a field carrying a control character, as the format's reference reader does. No published anchor uses any of these shapes. The shared fixture gains the uncompressedKey and malformedTail vectors that pin the first two, and the suite covers each refusal and the admission path.
|
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.



Program and scope
tm_uora_dppread anchors through the genericPushDropdecoder, which admits a 65-byte uncompressed locking key push (attribution still matched after re-compression, so the acceptance was invisible), never validates the drop tail, and passes control characters as text. The format's reference reader refuses all three, and admission rules are version-sensitive across index deployments: a lenient instance would disagree with its peers about topic membership. No published anchor uses any of these shapes, so the tightening refuses nothing real.Impact
Affected packages/services and intended patch versions (publication occurs only through the release workflow after approval):
@bsv/overlay-topics, patch. No export, type or schema changes; the exportedreadUoraAnchornow throws on the three shapes above, and the topic manager therefore admits fewer outputs. Admission is the trust boundary touched, and it only tightens. The package changelog carries the entry.Verification
98734b07c:pnpm --filter '@bsv/overlay-topics^...' run buildthenpnpm --filter @bsv/overlay-topics build, clean;pnpm --filter @bsv/overlay-topics lint, zero warnings;pnpm exec prettier --checkon the four changed files, clean;pnpm --filter @bsv/overlay-topics test:coverage: 44 suites, 541 tests passed, 1 todo.fixtures/anchor-v3.jsonuncompressedKeyandmalformedTail, copied verbatim into the shared fixture; the reference reader and the consuming application's copy refuse the same bytes.anchorFormat.tsreports 98.24% statements, 97.14% branches, 100% functions, 98.91% lines; the one uncovered line is the pre-existingtoUTF8throw path intext.Security and dependencies
Quality Gate passedverdict alone is not merge evidenceDependency evidence
None: no dependency changed.