Skip to content

Conversation

@manuelmauro
Copy link
Contributor

@manuelmauro manuelmauro commented Dec 17, 2025

⚠️ Breaking Changes ⚠️

The previous implementation was not compliant with the Ethereum specs, thus the new (compliant) behavior might be considered a breaking change with regard to previous assumptions.

In particular, while the current implementation in case of a reorg just returns the new head with a parent hash that was never mentioned within the subscription, the new behavior according to the specs is as follows:

"When a chain reorganization occurs, this subscription will emit an event containing all new headers (blocks) for the new chain. This means that you may see multiple headers emitted with the same height (block number), and when this happens the later (highest) block number should be taken as the correct one after a reorganization."

What does it do?

Guarantees spec compliance of eth_subscribe's newHeads.

More information here:https://github.com/ethereum/go-ethereum/wiki/RPC-PUB-SUB/7a0c1704737ece636aabda1d08d43f96dd1a619f#newheads

Relevant PRs

@manuelmauro manuelmauro self-assigned this Dec 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • agent-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch manuel/test-for-spec-compliance-of-eth-subscribe-new-heads

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@manuelmauro manuelmauro added B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes D2-notlive PR doesn't change runtime code (so can't be audited) breaking Needs to be mentioned in breaking changes labels Dec 17, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

WASM runtime size check:

Compared to target branch

Moonbase runtime: 2124 KB (no changes) ✅

Moonbeam runtime: 2240 KB (no changes) ✅

Moonriver runtime: 2240 KB (no changes) ✅

Compared to latest release (runtime-4100)

Moonbase runtime: 2124 KB (+188 KB compared to latest release) ⚠️

Moonbeam runtime: 2240 KB (+208 KB compared to latest release) ⚠️

Moonriver runtime: 2240 KB (+208 KB compared to latest release) ⚠️

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

Coverage Report

@@                                      Coverage Diff                                      @@
##           master   manuel/test-for-spec-compliance-of-eth-subscribe-new-heads     +/-   ##
=============================================================================================
  Coverage   76.68%                                                       76.68%   0.00%     
  Files         389                                                          389             
  Lines       76615                                                        76615             
=============================================================================================
  Hits        58745                                                        58745             
  Misses      17870                                                        17870             
Files Changed Coverage

Coverage generated Fri Dec 19 14:59:22 UTC 2025

@manuelmauro manuelmauro changed the title Test spec compliance of eth_subzscribe's newHeads Test spec compliance of eth_subscribe's newHeads Dec 18, 2025
@manuelmauro manuelmauro changed the title Test spec compliance of eth_subscribe's newHeads Guarantee spec compliance of eth_subscribe's newHeads Dec 18, 2025
@manuelmauro manuelmauro marked this pull request as ready for review December 19, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes breaking Needs to be mentioned in breaking changes D2-notlive PR doesn't change runtime code (so can't be audited)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants