[hackathon] refactor: decouple signet-node from reth via HostNotifier trait#100
Closed
prestwich wants to merge 19 commits into
Closed
[hackathon] refactor: decouple signet-node from reth via HostNotifier trait#100prestwich wants to merge 19 commits into
prestwich wants to merge 19 commits into
Conversation
Spec for decoupling signet-node from reth's ExExContext by introducing a HostNotifier trait in signet-node-types, with the reth implementation isolated in a new signet-host-reth crate. Co-Authored-By: Claude Opus 4.6 <[email protected]>
14-task plan covering: Extractable extension in SDK, signet-node-types crate, signet-host-reth crate, signet-node refactoring, and test updates. Co-Authored-By: Claude Opus 4.6 <[email protected]>
first_number and tip_number now return Option<u64> instead of panicking on empty chain segments. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Introduces the signet-node-types crate containing HostNotification, HostNotificationKind, and the HostNotifier trait — the core abstraction layer for host chain events with no reth dependencies. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Introduces the signet-host-reth crate which isolates all reth ExEx dependencies behind the HostNotifier trait. This includes: - RethChain: owning wrapper around reth's Chain implementing Extractable with O(1) metadata accessors via inlined transmute logic - RethHostNotifier: ExEx-backed implementation of HostNotifier that handles hash resolution internally - RethAliasOracle/Factory: moved from signet-node for reuse - RPC config helpers: rpc_config_from_args and serve_config_from_args - decompose_exex_context: splits ExExContext into notifier + config - RethHostError: proper error type satisfying core::error::Error Also re-exports RecoveredBlockShim from signet-blobber. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
signet-node is now reth-free. All host chain interaction flows through the HostNotifier trait from signet-node-types. Co-Authored-By: Claude Opus 4.6 <[email protected]>
process_block and run_evm now accept any Extractable chain type, removing the hard dependency on ExtractableChainShim. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Use decompose_exex_context to construct RethHostNotifier and pass it through the new builder API. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The decomposed reth context has IPC/HTTP disabled by default. Tests need the Signet-configured IPC path for RPC communication. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…t_head Eliminates num_hash_slow() calls by using the provider's sealed_header method, which returns pre-cached hashes instead of recomputing from RLP. Co-Authored-By: Claude Opus 4.6 <[email protected]>
6 tasks
Replace local path overrides with git references to the feat/extractable-metadata branch so CI can resolve dependencies. Co-Authored-By: Claude Opus 4.6 <[email protected]>
4 tasks
The upstream signet-sdk changed `Extractable::blocks_and_receipts` to return `BlockAndReceipts` structs instead of tuples. Update both shim implementations to construct the new struct type. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
RPC-based HostNotifier implementation that follows a host chain via WebSocket newHeads subscription. Supports backfill, ring-buffer reorg detection, and epoch-aware safe/finalized block tag caching. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Aligns workspace dependency versions with the feat/extractable-metadata branch, eliminating duplicate signet-types/signet-constants crate resolutions. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add MissingBlock error variant for correct semantics, tighten RpcBlock field visibility, guard backfill_batch_size against zero, and document RPC reorg detection limitations and ChainReverted non-emission. Co-Authored-By: Claude Opus 4.6 <[email protected]>
prestwich
added a commit
that referenced
this pull request
Mar 13, 2026
Add MissingBlock error variant for correct semantics, tighten RpcBlock field visibility, guard backfill_batch_size against zero, and document RPC reorg detection limitations and ChainReverted non-emission. Co-Authored-By: Claude Opus 4.6 <[email protected]>
3 tasks
prestwich
added a commit
that referenced
this pull request
Mar 13, 2026
Add MissingBlock error variant for correct semantics, tighten RpcBlock field visibility, guard backfill_batch_size against zero, and document RPC reorg detection limitations and ChainReverted non-emission. Co-Authored-By: Claude Opus 4.6 <[email protected]>
prestwich
added a commit
that referenced
this pull request
Mar 13, 2026
Add MissingBlock error variant for correct semantics, tighten RpcBlock field visibility, guard backfill_batch_size against zero, and document RPC reorg detection limitations and ChainReverted non-emission. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Claude Code]
Summary
signet-node-typescrate with aHostNotifiertrait,HostNotification, andHostNotificationKind— a host-chain-agnostic abstraction for receiving chain notificationssignet-host-rethcrate withRethHostNotifier(the reth/ExEx implementation),RethChainwrapper, alias oracle, and RPC config helpers extracted fromsignet-nodesignet-host-rpccrate withRpcHostNotifier— an RPC/WebSocket-based host chain follower usingnewHeadssubscriptions, reorg detection via ring buffer, and backfill supportAliasOracle::should_aliasasync via return-positionimpl Traitin trait (RPITIT), enabling future async implementationsSignetNodeandSignetNodeBuilderto be generic overN: HostNotifier, removing all reth dependencies fromsignet-nodereth-exexandreth-node-apidependencies fromsignet-node-configsignet-block-processor::process_blockgeneric overC: ExtractableExtractabletrait in the SDK withfirst_number(),tip_number(),len(),is_empty()metadata methods0.16.0-rc.14Motivation
signet-nodewas tightly coupled to reth'sExExContext, making it impossible to run the node against alternative host chain backends. This refactoring isolates all reth-specific code behind theHostNotifiertrait boundary, enabling future integrations with non-reth hosts (including pure RPC-based followers).Design
docs/superpowers/specs/2026-03-13-host-context-adapter-design.mddocs/superpowers/plans/2026-03-13-host-context-adapter.mdKey decisions
HostNotifier::Errorbound iscore::error::Error(noteyre::Report, which doesn't implement it)HostNotificationat notification time, avoiding provider lookups during processingset_headandsend_finished_heighttakeu64block numbers; hash resolution is the backend's responsibilityRethChainusesrepr(transparent)transmute (matching existingExtractableChainShimpattern) for zero-costExtractableimplementationRethHostErrorusesthiserror(library crate convention) rather thaneyreRpcHostNotifiernever emitsChainReverted— thenewHeadssubscription only fires for new blocks, so pure reverts are invisible[patch.crates-io]entries now point to GitHub branches (not local paths)Note
This branch includes SDK patches pointing to the
feat/extractable-metadatabranch on GitHub. The SDK changes need to be published before this can merge cleanly.Test plan
cargo t --workspace, skipping pre-existing slowtest_stateful_rpc_calls)cargo clippy --workspace --all-features --all-targets)signet-node/Cargo.tomlhas zero reth dependenciesRethHostNotifier→SignetNode🤖 Generated with Claude Code