fix(module): use local registration program id - #24
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates LEZCoreModule::register_public_account to use a locally compiled authenticated-transfer program ID when running against the local development sequencer, while preserving the existing testnet and convenience registration behavior. It also extends the unit-test harness (FFI stubs + mocks) and adds coverage for the new local registration route.
Changes:
- Add a local-development sequencer path for public account registration that fetches the authenticated-transfer program ID via FFI and submits a generic public transaction.
- Extend wallet FFI test stubs/mocks with
wallet_ffi_authenticated_transfer_program_idand add a unit test verifying the local-dev registration route. - Bump the
logos-execution-zoneflake input to a revision that provides the required FFI surface.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_lez_core.cpp | Adds a unit test asserting the local-dev registration route uses the authenticated-transfer program id and generic public transaction path. |
| tests/stubs/wallet_ffi.h | Declares the new FFI function in the unit-test stub header. |
| tests/mocks/mock_wallet_ffi.cpp | Implements the new mocked FFI function and returns a deterministic program id for tests. |
| src/lez_core_module.cpp | Adds local-dev sequencer detection, program-id hex conversion helper, and new registration branch using the compiled program id. |
| flake.nix | Updates the logos-execution-zone input revision to one that contains the needed API. |
| flake.lock | Locks the updated logos-execution-zone dependency revision/hash metadata. |
Suppressed comments (1)
src/lez_core_module.cpp:923
- register_public_account() calls get_sequencer_addr() twice (once for the testnet check and again for the local-dev check), which repeats an allocating FFI call and could yield inconsistent results if the sequencer address changes between calls. Cache the value once and reuse it for both checks.
if (isLezLocalDevelopmentSequencer(get_sequencer_addr())) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Returning to draft until its required source PR and parent module PR have landed, then its source revision can be repinned and revalidated in sequence. |
Summary
Validation
nix build --no-link .#unit-tests -Lnix build --no-link .#default -LDependency
Requires 3esmit/logos-execution-zone#45. Fixes 3esmit/logos-execution-zone#44.
Dependency and ABI gate
Remain draft. Do not update the source pin or merge while 3esmit/logos-execution-zone#37 is held for logos-blockchain#43's coordinated Testnet ProgramId migration.
This module currently consumes
wallet_ffi_authenticated_transfer_program_id. Source PR #45 currently exposeswallet_ffi_register_public_account_localinstead. Reconcile the final source ABI first, then adapt, pin, and rerun full module validation against the integrated source stack.