Repository navigation
fix: reject mismatched numbered block headers - #5
Draft
1932819331hy-debug wants to merge 1 commit into
Draft
1932819331hy-debug wants to merge 1 commit into
1932819331hy-debug wants to merge 1 commit into
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.
Summary
Check that a numbered block request receives that block before using its timestamp. This protects the start, sample boundary, and actual end timestamp used by
checkSchedule.Numeric requests and hexadecimal tags share the check. Matching zero-height requests, hex digits in either case, named tags, missing-block errors, and the existing quantity validation retain their behavior. The change consists of the RPC guard, library regressions, and offline CLI regressions with their fixture.
Evidence
13184ff111532c172f37d54d59f00e7eea6b9a23, the 17 library regressions have 11 passes and 6 assertion failures. The four CLI regressions separately have 2 passes and 2 assertion failures: wrong end headers incorrectly exit 0 in both JSON and text modes.After:
npm testpasses 44/44, including all 23 original tests, 17 library regressions, and four CLI regressions. The actual CLI now exits 2 without success output in both modes; matching-header controls still succeed.The tests execute the complete public functions and actual CLI process with injected transport and native JSON decoding. All execution used Node 24.22.1. No dependencies were added or installed. Real RPC providers, hosted CI, Node 18/20/22, other operating systems, npx installation, and actual GitHub Action execution remain unverified. Build, lint, and typecheck scripts are not configured.
This is a reproducible source-contract repair, not a reported production incident or completion of a maintainer-assigned issue. AI assistance was used for implementation, testing, and review.
Merge Danger
Door: Two-way. A local response-validation change with no migration.
Blast Radius: RPC.
A well-formed header with the wrong requested height now fails instead of entering a schedule report. Named tags keep their existing behavior. This does not validate block hashes, chain identity, or consensus.