You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runtime adapter: define each message kind's code once #665
The runtime adapter's framing, in tests/runtime-adapter/src/frame.rs, writes each message kind's code as a bare number twice: Kind::from_code maps a header's kind byte to a Kind, and Kind::code maps a Kind back to its byte. Adding or renumbering a kind means keeping both matches in step by hand.
Give each code a single definition that both directions use, for example:
named constants for the codes;
explicit discriminants on a #[repr(u8)]Kind, so that code is a cast and from_code matches the same values; or
a small, maintained crate that derives the conversion from u8, as long as the guest-only build stays free of host-only dependencies, which tests/independent_build.rs checks.
Done when:
each kind's code is written once in frame.rs;
the table of kinds in tests/runtime-adapter/README.md still matches the codes;
the adapter's checks pass in every configuration, as its README lists them.
Activity
akhil9tiet commentedon Oct 21, 2026
I'd like to work on this — please assign it to me.