-
Notifications
You must be signed in to change notification settings - Fork 481
Description
Summary
runtime-only tests currently compile the runtime that is used every time developers run cargo test, which makes the fast-path unusable on large projects. We need a precompiled “runtime shell” binary that embeds the ink parachain runtime, exposes the same contract RPC endpoints as ink-node, and lets ink-e2e execute contracts natively without spawning a node or recompiling the runtime.
Desired Solution
Build a new binary crate (e.g. ink-runtime-shell) that:
- Depends on ink_parachain_runtime and TestExternalities.
- Initializes genesis state in memory and runs the runtime natively via ext.execute_with.
- Exposes the Contracts_* JSON-RPC methods (upload_code, instantiate, call, tracing/dry run) identical to ink-node’s RPC surface.
- Listens on a localhost port; ink-e2e spawns it exactly like the node process today.
Ink-e2e’s runtime-only backend should be able to toggle between this shell and ink-node, reusing the existing RPC client. The shell should be shipped as a precompiled artifact (similar to ink-node releases) so developers download it once; their contract tests then link only their own code and run at native speed.
Benefits
- No runtime compilation during cargo test → faster dev iterations.
- Same behavior/API as the node path → no special client logic.
- No spawning of node compared to using ink-node
Acceptance Criteria
- ink-runtime-shell binary runs locally and answers contract RPCs using the native runtime.
- the e2e and sandbox crate should be refactored into one crate and the only thing that should differ is interacting with the ink-node or ink-runtime-shell