Skip to content

fix(module): use local registration program id - #24

Draft
3esmit wants to merge 4 commits into
feat/local-public-history-apifrom
fix/local-registration-program-id
Draft

fix(module): use local registration program id#24
3esmit wants to merge 4 commits into
feat/local-public-history-apifrom
fix/local-registration-program-id

Conversation

@3esmit

@3esmit 3esmit commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • use the compiled authenticated-transfer program ID for local registration
  • preserve existing testnet and convenience registration paths
  • cover the local generic registration route

Validation

  • nix build --no-link .#unit-tests -L
  • nix build --no-link .#default -L

Dependency

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 exposes wallet_ffi_register_public_account_local instead. Reconcile the final source ABI first, then adapt, pin, and rerun full module validation against the integrated source stack.

Copilot AI review requested due to automatic review settings August 1, 2026 23:43

Copilot AI left a comment

Copy link
Copy Markdown

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 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_id and add a unit test verifying the local-dev registration route.
  • Bump the logos-execution-zone flake 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.

Comment thread src/lez_core_module.cpp
@3esmit
3esmit marked this pull request as draft August 1, 2026 23:56
@3esmit

3esmit commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

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.

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