Correct canonical witness lookup and null handling for v2.2.1 - #110
Open
0xBreadguy wants to merge 1 commit into
Open
0xBreadguy wants to merge 1 commit into
0xBreadguy wants to merge 1 commit into
Conversation
Member
Author
|
Did this as part of the latest security advisory (p0). The callout was verified and then I had this PR submitted by my agent (using Astra). Did it to be helpful, but need the team to validate. If this just creates noise I'll confine PRs to my own working sections (e.g. tokenlist) |
0xBreadguy
marked this pull request as ready for review
September 19, 2026 00:48
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
The witness guide and RPC reference describe number-only requests as returning the first stored witness and tell clients to treat missing witnesses as errors. In mega-reth v2.2.1, number-only requests resolve the local canonical hash, return only a matching witness, and return
result: nullif the canonical hash or matching witness is unavailable.-32603for internal failures; remove the missing-witness error-message matching advice.nulland RPC errors before decoding.Addresses F-001. Verified against megaeth-labs/dist-docs#55, megaeth-labs/mega-reth#2026, and the executable handler in
v2.2.1/crates/megaeth/rpc/src/witness.rs. The handler's old selection-priority comment still mentions the fallback, but its implementation and regression test explicitly remove it. Missing-witnessnullis an existing response contract; the release change removes the unknown-canonical first-row fallback.Validation
git diff --checkpasses.