Skip to content

feat(rpc): add subscribeFinalizedChainNotifications endpoint#22011

Merged
mattsse merged 2 commits intomainfrom
feat/subscribe-finalized-chain-notifications
Feb 10, 2026
Merged

feat(rpc): add subscribeFinalizedChainNotifications endpoint#22011
mattsse merged 2 commits intomainfrom
feat/subscribe-finalized-chain-notifications

Conversation

@mattsse
Copy link
Collaborator

@mattsse mattsse commented Feb 9, 2026

Summary

Adds a new RPC subscription endpoint reth_subscribeFinalizedChainNotifications that emits committed chain notifications once a new finalized block is received.

How it works

  • Buffers Commit notifications from canonical_state_stream
  • Clears the buffer on Reorg
  • When a finalized block arrives via finalized_block_stream, drains all buffered commits whose tip is at or below the finalized block number and emits them as Vec<CanonStateNotification>

Changes

  • rpc-api: Added subscribeFinalizedChainNotifications / unsubscribeFinalizedChainNotifications subscription definition
  • rpc: Added ForkChoiceSubscriptions trait bound on the RethApiServer impl and implemented the finalized_chain_notifications handler
  • rpc-builder: Propagated ForkChoiceSubscriptions bound to the relevant impl blocks

Adds a new subscription endpoint that buffers committed chain
notifications and emits them as `Vec<CanonStateNotification>` once a
new finalized block is received. On reorg, the buffer is cleared.

This merges `canonical_state_stream` and `finalized_block_stream`
from `ForkChoiceSubscriptions` to provide finalization-aware chain
notifications.

Amp-Thread-ID: https://ampcode.com/threads/T-019c44a8-74e0-755e-824d-2915ca653a87
Co-authored-by: Amp <amp@ampcode.com>
@mattsse mattsse added the A-rpc Related to the RPC implementation label Feb 9, 2026
@mattsse mattsse requested a review from Rjected as a code owner February 9, 2026 23:36
@mattsse mattsse added the A-rpc Related to the RPC implementation label Feb 9, 2026
@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Feb 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

✅ Changelog found on PR.

Edit changelog

Added a new RPC endpoint for chain notifications.
@mattsse mattsse requested a review from gakonst as a code owner February 9, 2026 23:41
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 9, 2026

Merging this PR will not alter performance

✅ 118 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing feat/subscribe-finalized-chain-notifications (3028f49) with main (3668575)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@mattsse mattsse merged commit 198e457 into main Feb 10, 2026
41 checks passed
@mattsse mattsse deleted the feat/subscribe-finalized-chain-notifications branch February 10, 2026 14:07
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Feb 10, 2026
CarlBeek added a commit to CarlBeek/reth that referenced this pull request Feb 10, 2026
* paradigmxyz/main: (144 commits)
  feat(engine): add getPayloadBodiesV2 endpoints for EIP-7928 BAL support (paradigmxyz#21774)
  ci: skip scheduled workflows on forks (paradigmxyz#22022)
  chore: rm random log file (paradigmxyz#22023)
  chore: remove base.reth.rs public endpoint references (paradigmxyz#22019)
  feat(rpc): add `subscribeFinalizedChainNotifications` endpoint (paradigmxyz#22011)
  feat(trie): remove `SerialSparseTrie` (paradigmxyz#21808)
  fix(rocksdb): set max_open_files to prevent fd exhaustion (paradigmxyz#22005)
  refactor(txpool): rename and document validation methods (paradigmxyz#22008)
  feat(engine): prefetch withdrawal addresses in pre-warming (paradigmxyz#21966)
  refactor(pool): add IntoIter: Send bounds to avoid unnecessary Vec collect (paradigmxyz#22001)
  fix(rpc): enforce blockHash constraint in append_matching_block_logs (paradigmxyz#22007)
  chore: move Kurtosis failures to the hive slack channel  (paradigmxyz#21983)
  feat(rpc): propagate TransactionOrigin through send_transaction and batcher (paradigmxyz#21969)
  feat(engine): reorg depth commitment metric (paradigmxyz#21992)
  feat(storage): add use_hashed_state storage setting (paradigmxyz#21997)
  perf: better scheduling for storage roots computation (paradigmxyz#21987)
  chore(deps): bump alloy 1.6.2 -> 1.6.3 (paradigmxyz#21986)
  fix(stages): skip sender unwind when fully pruned (paradigmxyz#21988)
  chore(net): remove OP stack bootnodes (paradigmxyz#21984)
  ci: use depot for hive and kurtosis image builds, run daily (paradigmxyz#21976)
  ...

# Conflicts:
#	.github/workflows/compact.yml
#	.github/workflows/dependencies.yml
#	.github/workflows/docker-tag-latest.yml
#	.github/workflows/docker.yml
#	.github/workflows/e2e.yml
#	.github/workflows/hive.yml
#	.github/workflows/integration.yml
#	.github/workflows/kurtosis.yml
#	.github/workflows/lint.yml
#	.github/workflows/release.yml
#	.github/workflows/reproducible-build.yml
#	.github/workflows/stale.yml
#	.github/workflows/sync-era.yml
#	.github/workflows/sync.yml
#	.github/workflows/unit.yml
#	bin/reth/Cargo.toml
#	crates/cli/commands/src/node.rs
#	crates/node/core/src/node_config.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rpc Related to the RPC implementation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant