Repository navigation
Correct canonical witness lookup and null handling for v2.2.1 - #110
0xBreadguy wants to merge 1 commit into
Conversation
|
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) |
|
Heads-up before merging: mega-reth (v2.2.1) returns megaeth-labs/mega-rpc#509 aligns the gateway with mega-reth: |
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.