Letting sensors send transactions without reading metadata

Hi all, EnsRationis, software architect at Robonomics, a parachain on Polkadot for IoT. Our sensors are small ESP32 boards, some of them connected only by LoRa radio. We want them to build and sign full transactions themselves, and we’d like feedback on the design before we write the code.

Signing and talking to a node are the easy part. The hard part is knowing the exact shape of every call, and that shape changes with runtime upgrades. A microcontroller can’t read runtime metadata, so this knowledge has to become plain code at build time.

Our plan in three steps:

  1. The runtime repository publishes a ready-made description of the runtime: every pallet, call and type, plus our own transaction extension that decides who pays. It is produced from metadata once, when the crate is built, so nobody downstream reads metadata. If something can’t be described exactly, the build fails instead of guessing.
  2. A separate generator takes that description and writes C code only for the calls a given firmware uses.
  3. Each firmware gets a fingerprint of the calls it relies on. After a runtime upgrade we can see which devices are still compatible: a sensor that only records data shouldn’t need new firmware because an unrelated pallet changed.

Status: only the preparation step is merged (runtime metadata moved into its own crate). The rest is design, no code yet.

Question: has anyone already published such a ready-made runtime description for no_std or non-Rust clients? We’d rather reuse it than build another one.

Details:

2 Likes