Skip to content

docs: Add Rust-Solidity size validation alignment documentation#13

Merged
Mehd1b merged 1 commit into
devfrom
docs/align-solidity-rust-action-size-bounds
Jan 25, 2026
Merged

docs: Add Rust-Solidity size validation alignment documentation#13
Mehd1b merged 1 commit into
devfrom
docs/align-solidity-rust-action-size-bounds

Conversation

@Mehd1b

@Mehd1b Mehd1b commented Jan 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Add detailed comments to KernelOutputParser.sol clarifying that MAX_SINGLE_ACTION_BYTES bounds action_len (the ActionV1 bytes), NOT the full wire encoding including the 4-byte length prefix
  • Create contracts/docs/binary-format.md with complete wire format specification
  • Simplify contracts/README.md and link to detailed docs

Context

Investigation confirmed that the Rust and Solidity implementations are already byte-for-byte aligned. Both check action_len (the value read from the 4-byte prefix) against MAX_SINGLE_ACTION_BYTES = 16424.

This PR adds documentation to make this alignment explicit and prevent future confusion.

Test plan

  • No code changes, documentation only
  • Verified Rust implementation in kernel-core/src/types.rs and codec.rs
  • Comments accurately describe the wire format and validation semantics

…ment

- Add detailed comments to KernelOutputParser.sol explaining that
  MAX_SINGLE_ACTION_BYTES bounds action_len (ActionV1 bytes), NOT the
  full wire encoding including the 4-byte length prefix
- Create contracts/docs/binary-format.md with complete wire format spec
- Simplify contracts/README.md and link to detailed docs

This ensures the Solidity size validation is clearly documented as
byte-for-byte aligned with the Rust implementation in kernel-core.
@Mehd1b
Mehd1b merged commit 80636a3 into dev Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant