Repository navigation
fix(manager): document the calldata types a host has to encode - #51
Merged
kp2pml30 merged 1 commit intoOct 6, 2026
Conversation
`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 = ...)]`.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
GenVM PR actionsTick a box to run it (the box unticks itself when handled). Actions only run while the PR has the
Commands
|
kp2pml30
merged commit Oct 6, 2026
1dff5e2
into
genlayerlabs:feat/manager-socket-train
7 checks passed
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
manager-api.yamldocumentschain_id,valueand everybucket_totalsvalue astype: string, "as big integer string". All three areBigInton the wire (abi_stub.rs:56,run.rs:974).That is not cosmetic.
impl Decode for num_bigint::BigIntimplementsvisit_bigint/visit_bigint_ownedalone, so a host that follows the schema and calldata-encodes"1"reaches the defaultvisit_strand the frame is rejected asmalformed_frame. The in-tree client never hits it because it ignores the schema too:manager-socket/test.py:32sends'chain_id': 0and anAddress(...), 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.
Addresskeepstype: string— that is how a host spells one — but the component now says it travels as an address value, sinceDecode for Addressimplementsvisit_addressalone.requiredI 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_typeextracted verbatim into a standalone crate and run against both revisions of the schema:cargo fmt -p genvm-modules -- --checkis clean. I could not runcargo testor thepre-commitpipeline:implementation/build.rsneedsLSQLITE3_PREBUILTorLSQLITE3_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.