-
Notifications
You must be signed in to change notification settings - Fork 461
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
Adjust Optimism (Mainnet) TotalDifficulty
calculation
#7647
Conversation
src/Nethermind/Nethermind.Optimism/OptimismSynchronizerModule.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Optimism/OptimismSynchronizerModule.cs
Outdated
Show resolved
Hide resolved
{ | ||
base.Load(builder); | ||
|
||
if (provider.ChainId == OptimismMainnetChainId) |
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.
This check is not needed. Just have one OptimismSynchronizerModule
for just optimism configuration, the register it later after MergeSynchronizerModule
.
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.
The check is actually needed since we want to use a particular difficulty calculation strategy in Optimism Mainnet and not in, for example, Optimism Sepolia.
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.
That is unfortunate.
Fixes #7626
Changes
TotalDifficulty
at the Bedrock block in OptimismTypes of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Tested by running a node using the
op-mainnet
configuration. AllOld Headers
were downloaded without any issues and properTotalDifficulty
is always calculated correctly.Documentation
Requires documentation update
This change should be internal so no need to update docs.
Requires explanation in Release Notes
Remarks
Some changes required adjusting the DI modules specific for Optimism. It was not as straightforward as I would have expected it to be.