-
Notifications
You must be signed in to change notification settings - Fork 595
Return all forks if needed #9849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new debugging feature to the eth_config RPC method, allowing it to return the complete fork schedule for a chain when requested with a boolean parameter. The implementation introduces a static cache to avoid recomputing fork configurations on every request.
Key Changes:
- Added
GetAllForks()method toIForkInfointerface to retrieve the complete fork schedule - Extended
eth_configRPC method with optionalshowAllForksparameter to return all known forks - Implemented static caching of fork configurations using
FrozenDictionaryfor performance optimization
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nethermind/Nethermind.Network/IForkInfo.cs | Adds GetAllForks() method to interface and imports System namespace for ReadOnlySpan<T> |
| src/Nethermind/Nethermind.Network/ForkInfo.cs | Implements GetAllForks() returning the internal forks array; updates copyright year |
| src/Nethermind/Nethermind.JsonRpc/Modules/Eth/IEthRpcModule.cs | Updates eth_config signature to accept optional showAllForks parameter; removes unused System import |
| src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.cs | Implements fork configuration caching and conditional return of all forks; refactors fork config building into static helper method |
| src/Nethermind/Nethermind.JsonRpc/Data/ForkConfigSummary.cs | Adds All property to hold the complete list of fork configurations when requested |
| src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs | Adds two tests verifying the behavior with and without the showAllForks parameter |
|
Maybe we should add new method for that? We already have a lot of compatibility issues when different clients have extra features on the same methods |
When called in standard way it reveals no difference. What can happen? |
I mean someone could use this feature with nethermind, but when they try to call geth it will fail. We probably shouldn't add extra fields that don't appear in the spec. Maybe it makes sense to move this to debug_ namespace? |
According to the same logic user may find it useful in debug_ namespace, and will not find it in geth. And I don't really want to add nethermind_ namespace |
Yes, but debug_ is for devs and experimental features, so it's much better to add it there. Imo eth_ namespace should behave exactly the same way between clients, because it used by users. |
5d0b168 to
4e3961e
Compare
Getting list of all forks is convenient sometimes.
It's not according to an EIP, just an extension for better debugging
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?