Skip to content

RpcBackend and RpcMode refactor - #2442

Merged
sergerad merged 2 commits into
nextfrom
sergerad-sync-writers-enum
Aug 7, 2026
Merged

RpcBackend and RpcMode refactor#2442
sergerad merged 2 commits into
nextfrom
sergerad-sync-writers-enum

Conversation

@sergerad

@sergerad sergerad commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #2428.

  • RpcMode (crates/rpc/src/server/mod.rs) is now the non-Clone startup-time enum — FullNode carries block_writer/proof_writer directly, so sync_writers: Option<(BlockWriter, ProofWriter)> is gone from Rpc entirely (no more runtime .context() error for a missing writer pair in full-node mode — it's now a compile-time requirement).
  • RpcBackend is the new pub(crate), Clone-able per-request subset (RpcService's field), built from RpcMode::backend() by cloning only the individually-Clone fields.
  • RpcMode::full_node() now takes block_writer/proof_writer; RpcBackend's own constructors are #[cfg(test)]-gated since production only builds it via .backend().
  • Extracted Rpc::spawn_full_node_sync out of serve() to keep it under clippy's line-count lint after the match arm grew.
  • Updated the 5 per-request handlers (submit_proven_tx(_batch), get_transaction_encryption_key, get_network_note_status, status) to match on RpcBackend instead of RpcMode, and fixed all call sites in bin/node/src/commands/modes.rs and crates/rpc/src/tests.rs.

Changelog

changelog = "none"
reason    = "Internal change only."

@sergerad
sergerad marked this pull request as ready for review August 6, 2026 00:19
@sergerad
sergerad force-pushed the sergerad-apply-block-priority branch from 2d151a9 to 1db4774 Compare August 6, 2026 01:48
@sergerad
sergerad force-pushed the sergerad-sync-writers-enum branch from 68b7bc0 to bfc52d1 Compare August 6, 2026 01:48

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I don't love the name

Comment thread crates/rpc/src/server/mod.rs Outdated
@sergerad sergerad changed the title RpcRouting and RpcMode refactor RpcBackend and RpcMode refactor Aug 6, 2026
@sergerad
sergerad force-pushed the sergerad-apply-block-priority branch from 1db4774 to 629fe53 Compare August 6, 2026 08:34
@sergerad
sergerad force-pushed the sergerad-sync-writers-enum branch from a1f1a75 to 8c5a62f Compare August 6, 2026 08:34
@sergerad
sergerad force-pushed the sergerad-apply-block-priority branch from 629fe53 to 6d7e6fb Compare August 6, 2026 08:55
@sergerad
sergerad force-pushed the sergerad-sync-writers-enum branch from 8c5a62f to c3a30a2 Compare August 6, 2026 08:55
kkovaacs

This comment was marked as duplicate.

@kkovaacs kkovaacs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@sergerad
sergerad force-pushed the sergerad-apply-block-priority branch from 6d7e6fb to cd96b15 Compare August 6, 2026 18:01
@sergerad
sergerad force-pushed the sergerad-sync-writers-enum branch from c3a30a2 to 6e8b907 Compare August 6, 2026 18:01
Base automatically changed from sergerad-apply-block-priority to next August 7, 2026 00:03
@sergerad
sergerad force-pushed the sergerad-sync-writers-enum branch from 6e8b907 to 0ba2579 Compare August 7, 2026 00:03
@sergerad
sergerad merged commit 57b9bd7 into next Aug 7, 2026
26 of 27 checks passed
@sergerad
sergerad deleted the sergerad-sync-writers-enum branch August 7, 2026 00:07
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.

Integrate Rpc::sync_writers into RpcMode::FullNode

3 participants