Runtime idl transaction wrapper api - #249
Conversation
There was a problem hiding this comment.
Pull request overview
Implements issue #245 by adding a runtime-IDL transaction preparation API under spel::tx, allowing applications to bind a program once, provide named IDL inputs, and build native Wallet transaction types (public or privacy-preserving) without submitting/polling/printing.
Changes:
- Added
spel::txresolver + ergonomic builder API (SpelProgram, bound programs, fluent.input(...),resolve()andbuild(&WalletCore)), plus structured errors. - Added canonical JSON support for container arguments while preserving legacy CLI-compatible argument forms, PDA seed handling, and deterministic PDA resolution.
- Updated LEZ dependency pinning / crate renames (
nssa*→lee*viapackage), environment variable naming, smoke scripts, and added build-only smoke coverage.
Reviewed changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/fixture_program/Cargo.toml | Pins LEZ dependency to a specific commit and aliases lee_core as nssa_core for fixtures. |
| test-modules/test_modules_ffi/Cargo.toml | Updates LEZ deps to commit rev and switches spel-framework-core to workspace path. |
| spel-framework/Cargo.toml | Updates LEZ deps to commit rev and aliases lee/lee_core back to nssa/nssa_core. |
| spel-framework-macros/src/lib.rs | Updates macro-generated host input read function to read_lee_inputs. |
| spel-framework-core/src/pda.rs | Adds private-PDA derivation helper with explicit identifier; refactors seed combining. |
| spel-framework-core/src/lib.rs | Updates re-export to read_lee_inputs. |
| spel-framework-core/Cargo.toml | Pins LEZ deps to commit rev and aliases lee/lee_core. |
| spel-ffi-compile-test/Cargo.toml | Updates LEZ deps to commit rev and aliases lee/lee_core. |
| spel-client-gen/src/logos_module_codegen.rs | Updates wallet home env var used by generated Qt client glue. |
| spel-client-gen/src/ffi_codegen.rs | Updates generated FFI to use new wallet env var and updated Wallet APIs/transaction enum. |
| spel-client-gen/src/codegen.rs | Updates generated Rust client code to new Wallet APIs/transaction enum. |
| spel-cli/tests/runtime_idl_wallet_smoke.rs | Adds ignored integration test ensuring build-only runtime-IDL txs don’t submit or mutate state. |
| spel-cli/src/tx/value.rs | Adds JSON + legacy parsing/serialization logic for runtime-IDL argument handling. |
| spel-cli/src/tx/runtime.rs | Adds the fluent runtime-IDL builder API (SpelProgram, builders, build-only wallet delegation). |
| spel-cli/src/tx/resolution.rs | Adds resolver-only API with structured SpelTxError and IDL validation. |
| spel-cli/src/tx/pda_resolution.rs | Implements PDA dependency resolution (including private PDAs with identifier validation). |
| spel-cli/src/tx.rs | Re-exports new spel::tx API and updates transaction submission enum usage. |
| spel-cli/src/serialize.rs | Aligns CLI serialization with upstream AccountId string serialization behavior. |
| spel-cli/src/pda.rs | Updates private-PDA derivation to include identifier (defaulting to 0). |
| spel-cli/src/parse.rs | Improves shared parsing for program_id and normalizes account_id handling. |
| spel-cli/src/lib.rs | Updates program binary loading for new Program::new signature. |
| spel-cli/src/inspect.rs | Updates binary inspection path for new Program::new signature. |
| spel-cli/src/init.rs | Updates init templates for LEZ rename + adds lockfile repinning for zkVM toolchain compatibility. |
| spel-cli/src/generate_idl.rs | Minor cleanup to avoid unused-result lint in tests. |
| spel-cli/src/account_inspect.rs | Updates env-var guidance message to LEE_WALLET_HOME_DIR. |
| spel-cli/Cargo.toml | Pins LEZ deps to commit rev, enables serde_json arbitrary precision, adds build script. |
| spel-cli/build.rs | Adds macOS linker rpath workaround for pyo3 Python framework linking. |
| scripts/smoke-test-privacy.sh | Updates smoke flow for LEZ v0.2.0 layout/env changes and adds runtime-IDL build-only step. |
| scripts/init-e2e-test.sh | Updates sequencer + wallet config discovery to support LEZ v0.2.0 layout. |
| scripts/ffi-call-test.sh | Updates sequencer + wallet config discovery and guest lockfile repinning. |
| rust-toolchain.toml | Pins Rust toolchain to match LEZ requirements. |
| README.md | Documents the new spel::tx runtime-IDL resolution/builder API and resolver escape hatch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Print the actual LEZ version resolved | ||
| log " LEZ nssa_core resolved:" | ||
| grep -A2 'name = "nssa_core"' methods/guest/Cargo.lock 2>/dev/null | head -5 || true |
Status: rebased onto LEZ v0.2.0
|
Pin LEE dependencies to the Wallet build API commit.
3eb2ee0 to
dff49f3
Compare
🎯 Purpose
Implement #245 with an ergonomic runtime-IDL transaction-building API in
spel::tx. Applications bind a public or private program once, provide namedIDL inputs, and receive native Wallet transaction types.
The new builder API prepares transactions only. It does not submit, poll,
confirm, print, or change CLI behavior; the application submits through
WalletCore.
⚙️ Approach
SpelProgram, reusable program bindings, public/private instructionbuilders,
SpelInput, and structured build errors underspel::tx.argument parsing, identity checks, duplicate detection, and serialization.
established CLI-compatible argument formats while adding canonical JSON.
WalletCore::build_pub_txandWalletCore::build_privacy_preserving_tx, returning their native resultswithout a transaction, Wallet, send, or confirmation wrapper.
initialized accounts; explicit
AccountIdentityvalues remain a Walletcontract.
add hermetic plus sequencer-backed build-only coverage.
use the existing
--lez-revoption for commit-pinned LEZ smoke inputs.🧪 How to Test
Run from the repository root:
cargo fmt --all -- --check cargo test -p spel cargo clippy -p spel --all-targets cargo build -p spel cargo run -p spel -- init --help bash -n scripts/smoke-test-privacy.shRun
scripts/smoke-test-privacy.shin its existing LEZ smoke environment. Itexecutes the ignored runtime-IDL integration test, verifies build-only public
and private transactions do not reach the sequencer or change relevant state,
then runs the existing public and privacy-preserving CLI submission checks.
🔗 Dependencies
🔜 Future Work
📋 PR Completion Checklist