docs(stateless): add mega_getBlockWitness RPC reference page#45
Conversation
|
Good addition — technically thorough, well-structured reference page. One nit flagged inline (two sentences on one line at the lookup-modes intro paragraph). Everything else looks correct: frontmatter present, SUMMARY.md updated, relative links use |
|
Good reference page overall — the lookup mode table, decoding pipeline, and struct field breakdowns are exactly the right level of detail for this audience. Three style fixes needed before merge:
|
|
Reviewed. Three previously open threads are resolved — the heading is sentence case, the bold sentence and the following sentence are on separate lines, and the errors-section prose is active voice. One new issue filed inline: Content quality is solid: frontmatter is present, page is wired into |
|
Reviewed. Three earlier threads have been resolved (heading case, one-sentence-per-line, active voice) and the One remaining issue:
Content, structure, and formatting otherwise look good — detailed reference with correct struct layouts, accurate source links, and proper GitBook syntax. |
|
@claude I tried in mac book M4, it works with base64 -d or --decode both |
|
Claude finished @flyq's task in 41s —— View job Tasks
Thanks for testing that, @flyq — good to know. On modern macOS (Apple Silicon / recent OS versions), The current file already uses All previous concerns are now resolved:
The PR looks good to merge. Content is technically accurate, well-structured, and follows the stateless layer conventions. |
- Rename docs/stateless/ -> docs/node/ to broaden the layer for node-operator content - Rename stateless-validator.md -> stateless-validation.md - Rename get-block-witness.md -> witness.md - Hide internal OP-stack lookup mode (parentHash, attributesHash) from public docs - Wrap request examples in GitBook tabs - Anchor-link payload tuple to SaltWitness/MptWitness sections - Add use statements + crate-attribution hint to decoding snippet - Reorder Errors before Decoding pipeline under Response
|
The PR description lists three lookup modes, but the page only documents two. The Concretely, these fields need to be added to the request schema:
The Lookup modes table should gain a third row, and the Examples section should include a |
Troublor
left a comment
There was a problem hiding this comment.
I directly edited the files.
ReviewDirectory rename ( New page One outstanding issue — the existing unresolved thread on the opening line:
Missing indefinite article — should be "defines a |
|
@claude blockNumber + parentHash + attributesHash is not supported public |
|
Claude finished @flyq's task in 33s —— View job Tasks
Thanks for clarifying, @flyq — understood, That resolves the last open thread. All review concerns are now closed:
The PR is ready to merge. |
|
@claude Witnesses are immutable once written: the upstream RPC layer sets |
|
Claude finished @nnsgmsone's task in 52s —— View job Tasks
你说得对。 该声明是之前 review 中 Claude 建议的,但这个建议是错误的——它假设了一个不存在的上游缓存行为。 Fix applied to - Witnesses are immutable once written: the upstream RPC layer sets `Cache-Control: public, max-age=31536000, immutable`, so clients can cache successful responses indefinitely.
+ Witnesses are immutable once written: the same block number and hash will always return the same witness.
+ Do not rely on HTTP caching — the endpoint currently returns `Cache-Control: no-store`.The immutability of the witness data itself is still true (same block + hash → same witness), but the HTTP caching behavior is now accurately documented. |
The endpoint returns Cache-Control: no-store, not the immutable public cache headers previously documented. Co-authored-by: nnsgmsone <nnsgmsone@users.noreply.github.com>
@flyq 这个是不是不符合你的预期呢?你的预期是要cache吗? |
|
Claude finished @nnsgmsone's task in 29s —— View job Tasks
@flyq — the earlier fix (from the previous job run) already corrected the documentation to match the observed behavior: Current doc (line ~102 of
@nnsgmsone's question is whether the
No code changes were made in this task — this is a clarifying question for @flyq to confirm the intended caching behavior. |
@nnsgmsone 赞,这个确实之前是参考文档写的,但是不符合后来 mega-rpc 对这个方法对实现。我更新一下。实际情况是没有基于 POST 的缓存(也不应该有) |
|
Claude finished @flyq's task in 1m 3s —— View job Tasks
The previous job had already corrected the false - Do not rely on HTTP caching — the endpoint currently returns `Cache-Control: no-store`.
+ Do not rely on HTTP caching — the endpoint returns `Cache-Control: no-store`.Dropping "currently" removes the implication that HTTP caching might be added later. The sentence now reads as the stable, intended design. |
Cache-Control: no-store is the intended permanent behavior for POST endpoints, not a temporary state. Co-authored-by: liquan.eth <flyq@users.noreply.github.com>
|
All six previous threads are resolved. One remaining issue flagged inline: the Otherwise the PR looks good — the |
|
All prior review threads have been addressed and resolved. Summary of changes:
The page intentionally documents two lookup modes (not three as the PR description originally stated); that was discussed and the thread resolved. LGTM. |
Summary
docs/stateless/get-block-witness.mddocumenting themega_getBlockWitnessJSON-RPC method served atmainnet.megaeth.com/rpc: endpoint, request schema with the three lookup modes (blockNumber + blockHashpreferred /blockNumber + parentHash + attributesHashfor OP-stack derivation /blockNumber-only with an explicit warning that the backend prefix-lists keys and may return a non-canonical witness), response envelope (v0:<base64>), decoding pipeline (base64 → zstd → bincode-legacy), and error code reference.SaltWitness,SaltKey(24-bit bucket / 40-bit slot bit layout + unpack formula),SaltValue(94-byte length-prefixed encoding withAccount/Storage/BucketMetaflavors),SaltProof, andMptWitness— each shown as the upstream Rust struct with afile:linesource link.docs/SUMMARY.md, with a back-link fromdocs/stateless/stateless-validator.md's Related pages section.Test plan
salt/src/proof/salt_witness.rs#L46,salt/src/types.rs#L198,salt/src/types.rs#L274,salt/src/proof/prover.rs#L103,stateless-core/src/withdrawals.rs#L49) and verify they land on the expected struct definitions.curl ... | jq | base64 -d | zstd -d > witness.bincodeexample against a real mainnet block and confirm the resulting file decodes into(SaltWitness, MptWitness)via bincode-legacy.