Skip to content

feat(sof-tx): add SOF plugin-host adapters — bridge runtime signals into tx providers#5

Merged
Lythaeon merged 2 commits intomainfrom
feat/sof-tx-plugin-host-adapters
Feb 21, 2026
Merged

feat(sof-tx): add SOF plugin-host adapters — bridge runtime signals into tx providers#5
Lythaeon merged 2 commits intomainfrom
feat/sof-tx-plugin-host-adapters

Conversation

@Lythaeon
Copy link
Owner

Description

Add an optional adapter layer in sof-tx that bridges live sof plugin events into RecentBlockhashProvider and LeaderProvider.

This closes the integration gap between observer runtime signals and tx submission routing without forcing sof as a default dependency for all SDK users.

Changes

  • crates/sof-tx/Cargo.toml
    • Added sof-adapters feature.
    • Added optional dependency on workspace crate sof.
  • crates/sof-tx/src/lib.rs
    • Exposed adapters module behind sof-adapters feature flag.
  • crates/sof-tx/src/adapters/mod.rs
    • Added adapter module export surface.
  • crates/sof-tx/src/adapters/plugin_host.rs
    • Added PluginHostTxProviderAdapter + PluginHostTxProviderAdapterConfig.
    • Implemented ObserverPlugin, RecentBlockhashProvider, and LeaderProvider.
    • Added state handling for:
      • observed recent blockhash events,
      • cluster topology TPU endpoint updates,
      • leader schedule updates with bounded slot retention.
    • Added helper methods:
      • prime_from_plugin_host(...)
      • set_leader_tpu_addr(...)
      • remove_leader_tpu_addr(...)
    • Added adapter unit tests for event ingestion, target resolution, bounded retention, and host priming.
  • crates/sof-tx/README.md
    • Documented sof-adapters feature.
    • Added end-to-end integration snippet for PluginHostTxProviderAdapter.

For slice-related changes, include:

  • Affected slices: none (sof-tx crate only).
  • Cross-slice communication changes: none.
  • Migration requirements: none (additive feature).

Motivation

Business motivation:

  • Make sof-tx + sof composition practical for latency-sensitive users without custom glue code.

Technical motivation:

  • Provide first-party adapter primitives so tx routing can consume observer-derived leader and blockhash signals.

Alternative approaches considered:

  • Keep requiring downstream projects to implement providers/plugins manually.
  • Add hard dependency from sof-tx to sof (rejected to preserve lightweight default SDK footprint).

Scope and impact

  • Affected slices: N/A (sof-observer internals unchanged).
  • Data/API changes: additive APIs under sof-adapters feature.
  • Backward compatibility: preserved; default behavior unchanged.
  • Performance impact: minimal; adapter uses bounded in-memory state.
  • Security impact: no new privileged operations.

Testing

  • Unit tests
  • Integration tests
  • Manual verification
  • Performance checks (if applicable)
  • Security checks (if applicable)

Commands/results:

cargo test -p sof-tx
cargo test -p sof-tx --features sof-adapters

Both commands passed.

Related issues and documentation

  • Fixes: N/A
  • Related: ADR transaction SDK integration phase
  • Architecture docs: docs/architecture/README.md
  • Relevant ARD/ADR: docs/architecture/adr/0006-transaction-sdk-and-dual-submit-routing.md
  • Operations/runbook updates: N/A

Reviewer checklist

  • Code follows project standards and architecture constraints
  • Slice boundaries are respected (docs/architecture/ard/0003-slice-dependency-contracts.md)
  • Tests added/updated and passing
  • Documentation updated (README/docs/operations as needed)
  • No undocumented breaking change
  • Performance trade-offs documented where relevant
  • Security considerations addressed where relevant

Additional notes

  • PluginHostTxProviderAdapter is intentionally feature-gated so RPC-only sof-tx users keep the current dependency surface.

@Lythaeon Lythaeon merged commit 29d0362 into main Feb 21, 2026
2 checks passed
@Lythaeon Lythaeon deleted the feat/sof-tx-plugin-host-adapters branch February 21, 2026 02:22
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.

1 participant