Skip to content

fix: enforce abi formats#3

Closed
kp2pml30 wants to merge 0 commit into
v0.3-devfrom
pr/v0.3/fix/enforce-limits
Closed

fix: enforce abi formats#3
kp2pml30 wants to merge 0 commit into
v0.3-devfrom
pr/v0.3/fix/enforce-limits

Conversation

@kp2pml30

Copy link
Copy Markdown
Member

Auto-opened executor mirror of genlayerlabs/genvm-manager#6.

Carries the executor-side work for that manager PR. Auto-closed as merged when the manager PR lands (its pr/v0.3/fix/enforce-limits branch is moved onto v0.3-dev).

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fd4de838-e2f1-4838-8042-056a7282b793

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr/v0.3/fix/enforce-limits

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kp2pml30

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 22 minutes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens executor- and SDK-side ABI validation to ensure calldata and leader-proposed non-deterministic results are well-formed, deterministically interpreted, and safe to hash/compare across nodes (closing “byte-different but semantically equivalent” and “garbage leader output” avenues). It also updates integration fixtures to match the stricter rules and adds fuzz + unit coverage around the new validators.

Changes:

  • Enforce stricter entry calldata shapes (deploy vs call) and update message emission types to use abi::entry::{MainCallData, MainDeployData} rather than loose Value/Maybe<Value>.
  • Add total, non-panicking validation/parsing for leader-proposed nondet results, including derived-namespace remapping and detail-stripping for leader publication.
  • Add/adjust integration tests, unit tests, fuzz targets/corpora, and a pre-commit hook to keep Rust source comments citation-free.

Reviewed changes

Copilot reviewed 130 out of 205 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/integration/web/request_status/request_status.jsonnet Removes explicit JSON calldata to rely on the enforced ABI/defaults.
tests/integration/web/request_status/request_status.0.stdout Updates expected outcome to Return(null) under new ABI enforcement.
tests/integration/web/get_webpage_wait_js/get_webpage_wait_js.jsonnet Removes explicit JSON calldata to rely on the enforced ABI/defaults.
tests/integration/web/get_webpage_wait_js/get_webpage_wait_js.0.stdout Updates expected outcome to Return(null) under new ABI enforcement.
tests/integration/runner/register_malformed_charge/register_malformed_charge.py Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/register_malformed_charge/register_malformed_charge.jsonnet Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/register_ladder/register_ladder.py Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/register_ladder/register_ladder.jsonnet Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/nondet_inherit_custom/nondet_inherit_custom.py Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/nondet_inherit_custom/nondet_inherit_custom.jsonnet Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/nondet_custom_runner/nondet_custom_runner.py Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/no_flowback/no_flowback.py Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/no_flowback/no_flowback.jsonnet Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/runner/load_arith/load_arith.jsonnet Removes ADR citation wording in comments to satisfy new source-text policy.
tests/integration/nondet-consensus/malicious-leader/ret/ret.zk395p.stdout Adds fixture for leader-proposed nondet return variant.
tests/integration/nondet-consensus/malicious-leader/ret/ret.y2hgax.stdout Adds fixture for leader surplus-output case.
tests/integration/nondet-consensus/malicious-leader/ret/ret.tkryxe.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.rf2yq1.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.qg88x4.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.q7j6m9.stdout Adds fixture for malformed leader vm_error code.
tests/integration/nondet-consensus/malicious-leader/ret/ret.q2bhfw.stdout Adds fixture for valid leader-proposed return.
tests/integration/nondet-consensus/malicious-leader/ret/ret.mkdxq9.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.jsonnet Adds malicious-leader ret test wrapper.
tests/integration/nondet-consensus/malicious-leader/ret/ret.hh9tce.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.gatqf1.stdout Adds fixture for malformed vm_error code (non-canonical).
tests/integration/nondet-consensus/malicious-leader/ret/ret.fwxcex.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.ece46b.stdout Adds fixture for absent leader nondet output.
tests/integration/nondet-consensus/malicious-leader/ret/ret.bw2cm8.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.bccnkg.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.48n4pv.stdout Adds fixture for malformed raw leader payload.
tests/integration/nondet-consensus/malicious-leader/ret/ret.3r3m4s.stdout Adds fixture for malformed vm_error code.
tests/integration/nondet-consensus/malicious-leader/malicious-leader.py Adds malicious contract to exercise leader-output validation paths.
tests/integration/nondet-consensus/malicious-leader/_malicious-leader.jsonnet Generates malicious leader test matrix and calldata encoding.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_vm_error.jsonnet Adds targeted leader vm_error malformation test.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_vm_error.0.stdout Adds baseline stdout fixture.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_vm_error.0_0.stdout Adds validator-disagreement stdout fixture.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_return.jsonnet Adds targeted leader return malformation test.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_return.0.stdout Adds baseline stdout fixture.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_return.0_0.stdout Adds validator-disagreement stdout fixture.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_code.jsonnet Adds unknown result-code byte test.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_code.0.stdout Adds baseline stdout fixture.
tests/integration/nondet-consensus/leader_errors/malformed_leader_result_code.0_0.stdout Adds validator-disagreement stdout fixture.
tests/integration/nondet-consensus/leader_errors/leader_no_nondet.0_0.stdout Extends fixture to include disagreement line.
tests/integration/message/undefined_receive/undefined_receive.jsonnet Removes explicit JSON calldata to rely on the enforced ABI/defaults.
tests/integration/message/undefined_method/undefined_method.jsonnet Removes explicit JSON calldata to rely on the enforced ABI/defaults.
tests/integration/message/undefined_method_payable/undefined_method_payable.jsonnet Removes explicit JSON calldata to rely on the enforced ABI/defaults.
tests/integration/message/undefined_all/undefined_all.jsonnet Removes explicit JSON calldata to rely on the enforced ABI/defaults.
tests/integration/message/send_message_on/send_message_on.jsonnet Removes explicit JSON calldata to rely on the enforced ABI/defaults.
tests/integration/message/send_message_on/send_message_on.0.stdout Updates expected outcome to Return(null) under new ABI enforcement.
tests/integration/message/method/method_init_wrong_name.0.stdout Updates expected error to malformed_entry for init method-name presence.
support/scripts/check-source-text.py Adds pre-commit guard for citation-free/plain source text (Rust-focused).
flake.nix Wires the new check-source-text hook into pre-commit configuration.
executor/tests/entry_data.rs Adds executor-side tests for entry calldata validation rules.
executor/src/wasi/genlayer_sdk/tests.rs Adds comprehensive unit coverage for leader-result validation and publish/accept invariants.
executor/src/wasi/genlayer_sdk/run.rs Implements leader-result parsing/validation, detail stripping, and refactors run_nondet flow.
executor/src/wasi/genlayer_sdk/mod.rs Re-exports pure leader-result helpers for fuzzing without exposing run.
executor/src/wasi/genlayer_sdk/message.rs Tightens calldata typing for post/deploy/call paths and simplifies call-key derivation.
executor/src/runners/ustar.rs Normalizes comment punctuation to ASCII equivalents.
executor/src/runners/mod.rs Normalizes comment punctuation and removes ADR citations.
executor/src/runners/cache.rs Normalizes comment punctuation and removes ADR citations.
executor/src/rt/vm/storage.rs Normalizes comment punctuation and removes ADR citations.
executor/src/rt/vm/mod.rs Adds RunOk::duplicate() helper to clone without preserving VMError causes.
executor/src/rt/supervisor/mod.rs Removes leader/sync helper methods and adjusts commentary around weak caches and nondet processing.
executor/src/rt/supervisor/actions.rs Normalizes comment punctuation and removes ADR citations in load/grant logic docs.
executor/src/rt/mod.rs Replaces is_sync: bool with RunMode enum to clarify execution role.
executor/src/rt/fees.rs Normalizes comment punctuation to ASCII equivalents.
executor/src/rt/errors.rs Adds leader-derived error helpers and pending-ABI conversion utilities.
executor/src/lib.rs Enforces entry calldata shape early; adds detection of surplus leader nondet results.
executor/src/host/mod.rs Adapts emission conversion by re-encoding typed calldata back into raw bytes for the host interface.
executor/src/exe/run.rs Sets RunMode based on CLI flags and presence/absence of leader result set.
executor/src/domain.rs Updates domain emission types to use typed entry calldata structures.
executor/fuzz/leader-result.rs Adds AFL fuzz target for leader-result parsing invariants.
executor/fuzz/inputs-leader-result/fa36c783a6543e9e9e14b855bfcfbe31258577dc5bbf12a07e2cdc99b724692b Adds fuzz corpus seed for derived-namespace input.
executor/fuzz/inputs-leader-result/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 Adds empty fuzz corpus seed.
executor/fuzz/inputs-leader-result/c79b932e1e1da3c0e098e5ad2c422937eb904a76cf61d83975a74a68fbb04b99 Adds fuzz corpus seed for framed invalid payload.
executor/fuzz/inputs-leader-result/b4ecc3ce1f2adc8e5531ccc3595644a9affa17e509b9d02789b6431747a082c9 Adds fuzz corpus seed for detail-carrying vm_error proposal.
executor/fuzz/inputs-leader-result/a8d5dd63fba471ebcb1f3e8f7c1e1879b7152a6e7298a91ce119a63400ade7c5 Adds fuzz corpus seed for framed invalid payload.
executor/fuzz/inputs-leader-result/a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222 Adds fuzz corpus seed for framed invalid payload.
executor/fuzz/inputs-leader-result/9dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2 Adds fuzz corpus seed for framed invalid payload.
executor/fuzz/inputs-leader-result/5d85d1119929372bac9015063884c5833f47acf619ff00908da54fe7e1f2be40 Adds fuzz corpus seed for non-canonical exit_code.
executor/fuzz/inputs-leader-result/4b3a43f592f577fcfcb5b0e1f42bec5182c9edc414e1f667528f56e7cf0be11d Adds fuzz corpus seed for invalid bytes.
executor/fuzz/inputs-leader-result/13f314ccf2adc27ffff30349d3c5e7bd649ae2c7249e1c9e2fb1e34adc87fefb Adds fuzz corpus seed for valid vm_error proposal.
executor/fuzz/inputs-leader-result/0f48c861976db0f6f07dcc7537906b509a3072b38fe86b4bbef9cb221830c1c0 Adds fuzz corpus seed for derived-namespace collision attempt.
executor/fuzz/inputs-entry-data/f814b25a129a538cefd85429cc739032b99d72db1d4aa0a73b7f24823d6352a1 Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/eeefadc8ae302e23ceb58d6af4301808167c10da2dfb4715381cccaad984d797 Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/e77b9a9ae9e30b0dbdb6f510a264ef9de781501d7b6b92ae89eb059c5ab743db Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 Adds empty fuzz corpus seed.
executor/fuzz/inputs-entry-data/d31dd70d03390fbf31b413e7a275cd1ac1dd8e9ac8ce37536e09c8de33330524 Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/ca358758f6d27e6cf45272937977a748fd88391db679ceda7dc7bf1f005ee879 Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/ca2fd00fa001190744c15c317643ab092e7048ce086a243e2be9437c898de1bb Adds fuzz corpus seed for invalid bytes.
executor/fuzz/inputs-entry-data/c555eab45d08845ae9f10d452a99bfcb06f74a50b988fe7e48dd323789b88ee3 Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/76704c60eb803693bdc27108368e17df96a445bea56812057f06b6ac4fd11be8 Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/67586e98fad27da0b9968bc039a1ef34c939b9b8e523a8bef89d478608c5ecf6 Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/4d6c69e3a6fc216383ddfa2854639aa42b4c01dbe54d567accd2c0ba534ef87a Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/0a2e30346fbc127d7714860d725afa64f6968a2d510e43b74c3fadd36255dc2d Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/inputs-entry-data/06b966d36452c702f0635295dd916184a3c02c05d583c8c918833616102d184e Adds fuzz corpus seed for entry-data decoding.
executor/fuzz/entry-data.rs Adds AFL fuzz target to ensure ABI validators match a materializing reference implementation.
executor/crates/sdk-rs/tests/gl_call_custom_runners.rs Updates comments to remove ADR citations and normalize punctuation.
executor/crates/sdk-rs/tests/gl_call_balance_fees.rs Updates typed calldata fields and maintains old-encoding default expectations.
executor/crates/sdk-rs/src/storage/tree_map.rs Normalizes comment punctuation to ASCII equivalents.
executor/crates/sdk-rs/src/abi/gl_call.rs Switches gl_call message calldata fields to typed entry calldata structs.
executor/crates/sdk-rs/src/abi/entry.rs Introduces MainCallData/MainDeployData and removes serde-based message encode/decode in favor of calldata codec.
executor/crates/sdk-rs/src/abi/consts.rs Adds trie prefix helpers and generated VmError::is_valid_ validation function.
executor/crates/sdk-rs/src/abi/arb.rs Normalizes comment punctuation to ASCII equivalents.
executor/crates/common/tests/fees_abi.rs Normalizes section header comments to ASCII equivalents.
executor/crates/common/tests/expr.rs Normalizes comment punctuation to ASCII equivalents.
executor/crates/common/src/public_abi_pending.rs Adds pending-ABI vm_error trie and helpers used for leader-derived outcomes.
executor/crates/common/src/host_fns.rs Adds VmErrorDetail::is_valid_ validation helper.
executor/crates/common/src/expr/value.rs Normalizes comment punctuation to ASCII equivalents.
executor/crates/common/src/debug_mode.rs Normalizes comment punctuation to ASCII equivalents.
executor/crates/common/src/bytes32.rs Replaces Unicode ellipsis with ASCII ....
executor/crates/calldata/tests/unparsed.rs Normalizes test section headers to ASCII equivalents.
executor/crates/calldata/tests/option_as_absence.rs Adds tests for the new #[calldata(option_as_absence)] behavior.
executor/crates/calldata/tests/derive_internally_tagged.rs Normalizes comment punctuation and section headers to ASCII equivalents.
executor/crates/calldata/tests/derive_internally_tagged_am_name.rs Normalizes comment punctuation and section headers to ASCII equivalents.
executor/crates/calldata/tests/derive_decode.rs Normalizes test section headers to ASCII equivalents.
executor/crates/calldata/tests/derive_decode_excess_fields.rs Normalizes test section headers to ASCII equivalents.
executor/crates/calldata/src/codec/mod.rs Adds HasDeserializer to unify validation from bytes vs Value.
executor/crates/calldata/src/codec/de/value.rs Adds constructors for value deserializers and normalizes comments.
executor/crates/calldata/src/codec/de/unparsed.rs Adds Raw helpers and Maybe::kind() for cheap kind inspection.
executor/crates/calldata/src/codec/de/mod.rs Normalizes comments and clarifies Maybe decode semantics.
executor/crates/calldata/src/codec/de/bin.rs Normalizes module doc comment punctuation.
executor/crates/calldata/src/bin.rs Normalizes comments describing map-key ordering rules.
executor/crates/calldata-derive/src/lib.rs Adds unit tests for attribute-guard behavior (option_as_absence).
executor/crates/calldata-derive/src/encode.rs Implements option_as_absence encoding semantics (omit key and adjust map length).
executor/crates/calldata-derive/src/decode/tagged.rs Normalizes comments and clarifies streaming decode behavior.
executor/crates/calldata-derive/src/decode.rs Implements option_as_absence decoding semantics (absence -> None, no FieldMissing).
executor/crates/calldata-derive/src/attrs.rs Adds parsing + guardrails for the new option_as_absence attribute.
executor/codegen/data/public-abi-pending.json Introduces pending public-ABI trie data for derived vm_error outcomes.
executor/Cargo.toml Adds fuzz examples and enables arbitrary feature for calldata fuzzing.
executor/.ya-test-config.json Adds AFL build flag configuration slot.
.genvm-tool.py Adjusts codegen registration behavior for support-only vs full lines.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

match self {
Maybe::Materialized(value) => value.kind(),
Maybe::Checked(raw) => {
let byt = raw.0[0];
Comment on lines +63 to +67
print(
'\nSource text must be plain ASCII and free of ADR/issue citations; '
'add `check-source-text: off` in a comment to skip a file.',
file=sys.stderr,
)
@kp2pml30 kp2pml30 closed this Jul 24, 2026
@kp2pml30
kp2pml30 force-pushed the pr/v0.3/fix/enforce-limits branch from 5bbaf36 to 7c50d3d Compare July 24, 2026 13:19
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.

2 participants