Skip to content

Add IDL transaction resolution API - #248

Open
3esmit wants to merge 2 commits into
logos-co:mainfrom
3esmit:spel-transaction-builder-api
Open

Add IDL transaction resolution API#248
3esmit wants to merge 2 commits into
logos-co:mainfrom
3esmit:spel-transaction-builder-api

Conversation

@3esmit

@3esmit 3esmit commented Jul 13, 2026

Copy link
Copy Markdown

Description

Add a reusable, fallible IDL transaction-resolution API for #244. SPEL prepares
wallet-ready instruction data and accounts; WalletCore remains responsible for
building, proving, signing, submitting, and tracking transactions.

Changes

  • Add public and private spel::tx resolvers that return program ID,
    serialized instruction data, and resolved wallet accounts.
  • Validate selected IDL instructions, supplied accounts and arguments,
    signer and initialization intent, rest accounts, and duplicate account IDs.
  • Resolve public and private PDAs deterministically, including private-PDA
    identity identifiers, without Wallet wrappers or CLI behavior changes.
  • Pin LEZ dependencies to the WalletCore build-API commit until a release
    tag is available.

🔗 Dependencies

Checklist

  • Builds cleanly (make build or cmake --build)
  • Tests pass (make test or ctest -V)
  • README updated if new features, CLI commands, or behaviour changed
  • New public methods have doc comments
  • Branch is off main (not another feature branch) this PR depends on Upgrade to LEZ v0.2.0 #238

Copilot AI review requested due to automatic review settings July 13, 2026 03:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a reusable, fallible transaction resolution API (IDL instruction selection, account/PDA resolution, and instruction serialization) intended to be consumed by applications/tests that own WalletCore, while also updating the repo to a pinned LEZ (lee/lee_core) commit and aligning related tooling/scripts for LEZ v0.2.0-era behavior.

Changes:

  • Add spel::tx resolver-only API (resolve_public_instruction / resolve_private_instruction) with structured SpelTxError and deterministic PDA handling (including private-PDA identifiers).
  • Update LEZ dependencies to a pinned git rev and apply associated renames/adjustments (e.g., lee_core package aliasing, wallet env var rename, transaction enum rename).
  • Update CLI/tooling/scripts for compatibility (macOS rpath fix for pyo3 framework linking; LEZ path/layout changes in smoke/init scripts; toolchain pin).

Reviewed changes

Copilot reviewed 30 out of 32 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/e2e/fixture_program/Cargo.toml Pin LEZ dependency to a specific commit and map nssa_core to lee_core.
tests/e2e/fixture_program/Cargo.lock Lockfile updates reflecting the new LEZ commit and dependency graph changes.
test-modules/test_modules_ffi/Cargo.toml Move LEZ deps to pinned rev and switch spel-framework-core to path dependency.
spel-framework/Cargo.toml Update LEZ deps to pinned rev and alias lee packages.
spel-framework-macros/src/lib.rs Update guest input reader call to read_lee_inputs.
spel-framework-core/src/pda.rs Add private-PDA derivation with explicit identifier and refactor seed combining.
spel-framework-core/src/lib.rs Re-export read_lee_inputs in the prelude.
spel-framework-core/Cargo.toml Pin LEZ deps and alias lee packages.
spel-ffi-compile-test/Cargo.toml Pin LEZ deps to the same rev and alias lee packages.
spel-client-gen/src/logos_module_codegen.rs Update generated Qt wallet-home env var to LEE_WALLET_HOME_DIR.
spel-client-gen/src/ffi_codegen.rs Update generated FFI code to use new wallet APIs/env var and Lee transaction enum.
spel-client-gen/src/codegen.rs Update generated Rust client code to use new wallet APIs and Lee transaction enum.
spel-cli/src/tx/value.rs New typed argument parsing/serialization for resolver API (and PDA seed extraction).
spel-cli/src/tx/resolution.rs New public resolver-only API and error types (SpelInstructionRequest, resolved outputs, SpelTxError).
spel-cli/src/tx/pda_resolution.rs New deterministic PDA resolver supporting dependency graphs and private PDA identifiers.
spel-cli/src/tx.rs Re-export resolver API from spel::tx and update CLI submission path to Lee transaction enum / wallet API changes.
spel-cli/src/serialize.rs Adjust serialization shape for account_id to match upstream display/base58 form.
spel-cli/src/pda.rs Update private PDA derivation call to include identifier (default 0).
spel-cli/src/parse.rs Extend CLI program-id parsing to accept base58/0x-hex 32-byte ImageIDs; normalize account_id input.
spel-cli/src/lib.rs Keep tx module public so new resolver API is reachable as spel::tx.
spel-cli/src/inspect.rs Update Program::new call signature (bytes.into()).
spel-cli/src/init.rs Update scaffolding defaults for LEZ v0.2.0 and add enum-ordinalize pin workaround; alias lee packages in templates.
spel-cli/src/generate_idl.rs Avoid let _ = on must-use results in Drop cleanup.
spel-cli/src/account_inspect.rs Update wallet-home env var guidance to LEE_WALLET_HOME_DIR.
spel-cli/Cargo.toml Pin LEZ deps to a specific rev, enable serde_json arbitrary precision, add thiserror.
spel-cli/build.rs Add macOS-specific build script to inject Python framework rpath for pyo3-linked binary.
scripts/smoke-test-privacy.sh Update env vars and paths for LEZ v0.2.0 layout; patch sequencer config home to writable dir; re-pin enum-ordinalize in guest.
scripts/init-e2e-test.sh Same LEZ v0.2.0 path/env updates and sequencer config home patching.
scripts/ffi-call-test.sh Same LEZ v0.2.0 path/env updates and guest enum-ordinalize re-pin.
rust-toolchain.toml Pin toolchain to Rust 1.94.0 for LEZ API compatibility.
README.md Document the new transaction resolution API (spel::tx) and its intended boundary.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spel-cli/src/tx/value.rs
Comment thread spel-cli/src/tx/value.rs Outdated
Comment thread spel-cli/src/tx/value.rs
@3esmit
3esmit force-pushed the spel-transaction-builder-api branch 2 times, most recently from 1faa839 to 58923be Compare July 13, 2026 08:01
@3esmit
3esmit requested a review from Copilot July 13, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 32 changed files in this pull request and generated 4 comments.

Comment thread spel-client-gen/src/logos_module_codegen.rs
Comment thread spel-client-gen/src/ffi_codegen.rs
Comment thread spel-cli/src/tx.rs
Comment thread spel-cli/src/account_inspect.rs
@3esmit 3esmit mentioned this pull request Jul 14, 2026
11 tasks
@3esmit
3esmit force-pushed the spel-transaction-builder-api branch 5 times, most recently from 9754d73 to b57dfd7 Compare July 16, 2026 17:54
3esmit added 2 commits July 16, 2026 14:57
Pin Logos Execution Zone to 7a40979c7f5b04a46a8665a3d07cd3a300dcae63 and align private PDA derivation, generated IDL, scaffolding, and smoke tests with its wallet API.

BREAKING CHANGE: private PDA derivation now requires both nullifier and viewing public keys; wallet paths use LEE_WALLET_HOME_DIR.
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.

2 participants