-
Notifications
You must be signed in to change notification settings - Fork 434
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
Optimism plugin #6146
Optimism plugin #6146
Conversation
# Conflicts: # src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Paris.cs
This reverts commit 0c8c091.
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.
Further TODO things - I would like them to be captured to issues and linked with this PR:
- Refactoring of Transactions (and TxDecoder and TransactionsForRpc) to be infectible by plugins
- Refactoring of chain spec specific parts to be injectable by plugins
src/Nethermind/Nethermind.Consensus/Nethermind.Consensus.csproj
Outdated
Show resolved
Hide resolved
|
||
IEnumerable<Transaction> txs = _payloadAttrsTxSource.GetTransactions(parent, attrs.GasLimit, attrs); | ||
|
||
Block block = new(blockHeader, txs, Array.Empty<BlockHeader>(), payloadAttributes?.Withdrawals); |
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.
null check not needed
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.
Compiler can't understand that and fails with warning as error
|
||
public Task InitNetworkProtocol() => Task.CompletedTask; | ||
|
||
public Task InitSynchronization() |
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.
Why this is needed?
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.
WHy do we have to init synchronization?
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.
we would initialize syncronization anyways in the default InitializeNetwork
, at least this one would work if p2p was enabled in Optimism.
if (!WorldState.AccountExists(tx.SenderAddress!)) | ||
{ | ||
WorldState.CreateAccount(tx.SenderAddress!, 0, 1); | ||
} | ||
else | ||
{ | ||
WorldState.IncrementNonce(tx.SenderAddress!); | ||
} |
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.
A bit of hack that Validate
mutates the state
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.
I would love to push it to the next pr. Will require refactoring
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.
let's also capture this in an issue
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.
I created three issues. |
Fixes Closes Resolves #
Nethermind optimism plugin
Changes
DisableGcOnNewPayload
. During sync disabling gc causes memory leakstateUnavailable
. Op-mainnet and op-goerli don't have state for block number zero.Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Documentation
Requires documentation update
Requires explanation in Release Notes