Skip to content

fix(manager): document the calldata types a host has to encode - #51

Merged
kp2pml30 merged 1 commit into
genlayerlabs:feat/manager-socket-trainfrom
HusseinAdeiza:feat/schema-wire-types
Oct 6, 2026
Merged

kp2pml30 merged 1 commit into
genlayerlabs:feat/manager-socket-trainfrom
HusseinAdeiza:feat/schema-wire-types

Conversation

@HusseinAdeiza

Copy link
Copy Markdown
Contributor

What

manager-api.yaml documents chain_id, value and every bucket_totals value as type: string, "as big integer string". All three are BigInt on the wire (abi_stub.rs:56, run.rs:974).

That is not cosmetic. impl Decode for num_bigint::BigInt implements visit_bigint/visit_bigint_owned alone, so a host that follows the schema and calldata-encodes "1" reaches the default visit_str and the frame is rejected as malformed_frame. The in-tree client never hits it because it ignores the schema too: manager-socket/test.py:32 sends 'chain_id': 0 and an Address(...), not the strings the schema asks for.

So this corrects the three declarations, and extends the parity test past field names to types so the next drift fails in CI.

Address keeps type: string — that is how a host spells one — but the component now says it travels as an address value, since Decode for Address implements visit_address alone.

required I checked and it needs no change: the 11 required names are a subset of the 24 fields, and the 13 optional ones all carry #[calldata(default = ...)].

Verification

documented_type extracted verbatim into a standalone crate and run against both revisions of the schema:

== before.yaml
  FAIL GenvmRunRequest.bucket_totals values: documented "string", expected "integer"
  FAIL MessageData.chain_id: documented "string", expected "integer"
  FAIL MessageData.value: documented "string", expected "integer"
  3 assertion(s) fail
== after.yaml
  all schema type assertions hold

cargo fmt -p genvm-modules -- --check is clean. I could not run cargo test or the pre-commit pipeline: implementation/build.rs needs LSQLITE3_PREBUILT or LSQLITE3_SRC, which the nix dev shell supplies and there is no nix store on this host. Both commands are what CI runs.

Closes part 1 of #15.

`manager-api.yaml` called `chain_id`, `value` and every `bucket_totals`
value a `string` "as big integer string", but all three are `BigInt` on the
wire. `Decode for BigInt` implements `visit_bigint` alone, so a host that
follows the schema and encodes `"1"` lands on the default `visit_str` and the
frame comes back `malformed_frame`.

The parity test only compared field names, which is why the drift survived.
It now compares types too, and a separate test pins the Rust side by
borrowing each field as the type the decoder expects, so retyping one stops
the file compiling.

`required` was checked while in there and needed no change: the 11 required
names are a subset of the 24 fields, and the 13 optional ones all carry
`#[calldata(default = ...)]`.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

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

🗂️ Base branches to auto review (3)
  • main
  • v\d+.\d+
  • v\d+.\d+-dev

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: Repository: genlayerlabs/genvm-manager/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86219779-f973-413e-aa35-7ab7122d66d4

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
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown

GenVM PR actions

Tick a box to run it (the box unticks itself when handled). Actions only run while the PR has the ci-safe label.

  • Force run full tests
  • Provision executor PRs
Commands
  • /genvm-run-tests — run full tests once for the current manager snapshot
  • /merge — queue the exact manager snapshot through the App-owned E2E merge train

@github-actions github-actions Bot added the not rebased branch is behind its base; rebase before it can be merged label Oct 1, 2026
@kp2pml30
kp2pml30 changed the base branch from v0.6-dev to feat/manager-socket-train October 6, 2026 09:22
@github-actions github-actions Bot removed the not rebased branch is behind its base; rebase before it can be merged label Oct 6, 2026
@kp2pml30
kp2pml30 merged commit 1dff5e2 into genlayerlabs:feat/manager-socket-train Oct 6, 2026
7 checks passed
@kp2pml30

kp2pml30 commented Oct 6, 2026

Copy link
Copy Markdown
Member

Thanks! Landed via the feat/manager-socket-train train (#58), reworked after review with you credited as co-author; it reaches v0.6-dev when #58 merges

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