Skip to content

feat(calldata)!: move method-call key from "method" to "" (empty string)#192

Draft
MuncleUscles wants to merge 1 commit into
v2-devfrom
codex/calldata-empty-method-key
Draft

feat(calldata)!: move method-call key from "method" to "" (empty string)#192
MuncleUscles wants to merge 1 commit into
v2-devfrom
codex/calldata-empty-method-key

Conversation

@MuncleUscles

@MuncleUscles MuncleUscles commented Jul 1, 2026

Copy link
Copy Markdown
Member

Depends-On: genlayerlabs/genvm-manager#1
Depends-On: https://github.com/genlayerlabs/genlayer-node/pull/1502
Depends-On: https://github.com/genlayerlabs/genlayer-dev-env/pull/95
Depends-On: https://github.com/genlayerlabs/genlayer-e2e/pull/619
Depends-On: genlayerlabs/genlayer-studio#1697
Depends-On: genlayerlabs/genlayer-py#96
Depends-On: #192
Depends-On: genlayerlabs/genlayer-testing-suite#98

Migrate the calldata ABI to the genvm-manager v0.6 method-call wire format.

Wire-format change

The method-call calldata map key moves from "method" to "" (empty string). In canonical
calldata map encoding, keys are ordered by their unicode-codepoint array and the empty array
precedes any non-empty key — so "" sorts first and the method name becomes a prefix of
the encoded binary calldata (ahead of args / kwargs).

The v0.6 genvm-manager still auto-remaps "method" -> "", but it logs an error on every
call while doing so. This migration stops that error by emitting the new key natively.

What changed

  • src/abi/calldata/encoder.tsmakeCalldataObject now writes the method name under
    ret[""] instead of ret["method"]. This flows through every SDK path that builds
    method-call calldata: writes (addTransaction), reads/view calls (sim_call), and the
    schema call. Deploy calldata uses method === undefined (no method key) and is unaffected.
  • Decoder unchangedsrc/abi/calldata/decoder.ts builds a generic Map from raw key
    bytes and already reads whatever key is present; it needs no change.
  • tests/calldata.test.ts (new) — asserts the decoded map has key "" == the method
    name, does not have "method", and that "" is the first entry (sorts before both
    args and kwargs). These assertions fail under the old "method" key (verified).

No back-compat toggle

This repo has no calldata versioning mechanism, so this is a hard cutover per the migration
scope. Peers must run the v0.6 genvm-manager (or a node/studio build expecting the "" key).

Verification

  • vitest run --typecheck: 88/88 tests pass, no type errors
  • npm run build: green
  • eslint on touched files: clean

BREAKING CHANGE

Method-call calldata now uses the "" key instead of "method". Encoded bytes for every
write/read/view/schema call change.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: c2c4e523-d263-425f-b1f2-fbd26e67ebf9

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 codex/calldata-empty-method-key

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.

The v0.6 genvm-manager renamed the method-call calldata map key from
"method" to "" (empty string). The empty key sorts first in canonical
calldata map encoding (keys ordered by unicode-codepoint array; the empty
array precedes any non-empty key), so the method name becomes a prefix of
the encoded binary calldata.

makeCalldataObject now writes the method name under ret[""]. The decoder is
unchanged: it builds a generic Map from raw key bytes and already reads
whatever key is present. No back-compat toggle — there is no calldata
versioning mechanism in this repo, so this is a hard cutover.

The genvm-manager still auto-remaps "method" -> "" but logs an error each
time; this migration stops that error.

BREAKING CHANGE: method-call calldata now uses the "" key instead of
"method". Encoded bytes for every write/read/view/schema call change. Peers
must run the v0.6 genvm-manager (or a node/studio build that expects the ""
key).
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