Skip to content

feat(coprocessor): solana host-listener poc scaffold and feedback loop#1951

Draft
Eikix wants to merge 51 commits intomainfrom
codex/solana-host-listener-discovery
Draft

feat(coprocessor): solana host-listener poc scaffold and feedback loop#1951
Eikix wants to merge 51 commits intomainfrom
codex/solana-host-listener-discovery

Conversation

@Eikix
Copy link
Contributor

@Eikix Eikix commented Feb 10, 2026

Summary

Draft PR for Solana host-listener PoC scaffold and fast feedback loop.

Goal: validate Solana host feasibility against existing EVM listener semantics without broad refactors.

Included

  • New solana-listener service scaffold in coprocessor/fhevm-engine/solana-listener
  • Finalized RPC source with both emit! log decoding and emit_cpi! inner-instruction decoding
  • Ingest mapping into existing coprocessor DB tables (computations, allowed_handles, pbs_computations, cursor state)
  • ACL gate behavior for request_add -> allow
  • Localnet integration harness (Docker + local validator + optional tfhe-worker)
  • Anchor host program PoC in solana/host-programs/zama-host
  • Exploration docs, parity matrix, testing tiers, and no-doc-rot protocol

Recent hardening / cleanup

  • Host program naming/layout simplified (no v0 suffix noise).
  • Host op logic deduplicated across emit! and emit_cpi! entrypoints.
  • RPC source now fails closed on unavailable finalized blocks (no cursor advance on missing getBlock result).
  • Removed in-code TODO from listener path.
  • Tier-2 scaffold script trimmed (removed unused event-mode argument branch).
  • Listener CLI defaults to real DB writes (SOLANA_DRY_RUN=false) with explicit dry-run opt-in.

Review focus

  • Cursor/replay semantics in solana_rpc_source
  • Event decoding assumptions (logMessages + innerInstructions)
  • Ingestion parity and ACL gate transitions
  • Test harness readability/maintainability

Notes

  • Draft by design for iterative review.
  • Localnet/e2e integration tests are #[ignore] and run manually.

@cla-bot cla-bot bot added the cla-signed label Feb 10, 2026
@Eikix Eikix changed the title draft: Solana host-listener PoC scaffold + fast feedback loop [NOT REVIEWABLE]: Solana host-listener PoC scaffold + fast feedback loop Feb 10, 2026
@Eikix Eikix changed the title [NOT REVIEWABLE]: Solana host-listener PoC scaffold + fast feedback loop feat(solana): host-listener PoC scaffold and feedback loop Feb 10, 2026
@Eikix Eikix changed the title feat(solana): host-listener PoC scaffold and feedback loop feat(coprocessor): solana host-listener poc scaffold and feedback loop Feb 10, 2026
@mergify
Copy link

mergify bot commented Feb 10, 2026

🧪 CI Insights

Here's what we observed from your CI run for bc699f7.

🟢 All jobs passed!

But CI Insights is watching 👀

@Eikix
Copy link
Contributor Author

Eikix commented Feb 11, 2026

Pushed a follow-up commit that addresses the new inline feedback: 988f5b5a.

What changed:

  • switched solana_poc_runner instruction encoding to Anchor-generated instruction types (zama_host::instruction::*) instead of manual discriminator bytes.
  • fixed runner correctness bug: tenant seeding now uses --host-chain-id (no hardcoded 12345).
  • fixed runner correctness bug: ingest/db path now uses the inserted tenant_id returned from DB.
  • removed noisy into_listener_pubkey helper and decode directly into ProgramEvent fields.
  • clarified runner defaults: replaced raw random UUID default with explicit placeholder DEFAULT_TENANT_API_KEY; renamed/explained host-chain-id placeholder in reserved non-EVM range.
  • kept the key-dir override path (--keys-dir / SOLANA_POC_KEYS_DIR) and docs/tests wiring from the report.

Validation run:

  • cargo fmt -p solana-listener
  • SQLX_OFFLINE=true cargo check -p solana-listener --features solana-e2e
  • cargo test -p solana-listener poller::solana_rpc_source::tests::decodes_op_requested_add_from_program_data_line

@Eikix
Copy link
Contributor Author

Eikix commented Feb 11, 2026

Tier-3 parity scorecard update (2026-02-11)

Ran:
/Users/work/.codex/worktrees/66ae/fhevm/test-suite/fhevm/scripts/solana-poc-tier3-e2e.sh --case all

Result: EXIT_CODE=0 (all cases passed)

Area Tier-3 test Status Duration
ADD localnet_solana_request_add_computes_and_decrypts PASS 62.31s
SUB localnet_solana_request_sub_computes_and_decrypts PASS 61.98s
Binary ops localnet_solana_request_binary_ops_computes_and_decrypts PASS 172.62s
Unary ops localnet_solana_request_unary_ops_computes_and_decrypts PASS 104.92s
If/Then/Else localnet_solana_request_if_then_else_computes_and_decrypts PASS 62.16s
Cast localnet_solana_request_cast_computes_and_decrypts PASS 52.25s
Trivial encrypt localnet_solana_request_trivial_encrypt_computes_and_decrypts PASS 45.93s
Rand localnet_solana_request_rand_computes_and_decrypts PASS 51.24s
Rand bounded localnet_solana_request_rand_bounded_computes_and_decrypts PASS 49.84s
ACL gate localnet_acl_gate_blocks_then_allows_compute PASS 57.25s

Explorer-visible demo evidence (ADD + ALLOW canonical flow):

  • request_add_signature=2Cung4UE36Ky1LkaLLGQT3JgKvD5Udmc85Zi82XRyBKp3ABgP3r7FpYpU2mJzRtuPFK421TkB1pEESTJ7wJD5JTy
  • allow_signature=4DDdwLDaNQWirrrTLoDeaC19xnQGf74wzRrwqddvFeohDUALwupjQr1aTRzyfyqfcUGuNBT2shPDgEqgnbYmoeso
  • DB ingest counters: computations=1, allowed_handles=1, pbs_computations=1

Small follow-up fix included: default host_chain_id in solana_poc_runner reverted to schema-compatible value (12345) to avoid tenants_chain_id_check violations in the local demo path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant