-
Notifications
You must be signed in to change notification settings - Fork 564
EIP 7742 implementation #7518
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
Open
yerke26
wants to merge
84
commits into
master
Choose a base branch
from
feature/eip-7742
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
EIP 7742 implementation #7518
Changes from all commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
de19765
Get target_blob_count, max_blob_count from Engine Api
yerke26 eca6690
fix HeaderDecoder, restore Eip4844 changes, Add Eip7742
yerke26 7ac90df
Merge branch 'master' into feature/eip-7742
yerke26 9be8a53
fix HeaderDecoder
yerke26 c592412
move new params from ExecutionPayload to ExecutionPayloadV4
yerke26 f6ae01c
revert minor changes
yerke26 f803097
added new params to PayloadAttributes
yerke26 7043124
fix tests
yerke26 fef9cb2
fix whitespaces
yerke26 cc02ce5
add tests
yerke26 206d514
Merge branch 'master' into feature/eip-7742
yerke26 9fbb9c1
add missing fields
yerke26 8ada4e2
fix PayloadAttributes
yerke26 3ae0fed
add engine_forkchoiceUpdatedV4 to EngineRpcModule.Prague
yerke26 372868a
change to engine_forkchoiceUpdatedV4
yerke26 0bd75c6
Merge branch 'master' into feature/eip-7742
yerke26 4b5fbfc
add new fields to EngineModuleTests.V4
yerke26 5078b76
added new engine_forkchoiceUpdatedV4 to EngineRpcCapabilitiesProvider
yerke26 a92cdde
fix test cases
yerke26 c032480
Merge branch 'master' into feature/eip-7742
yerke26 4ab5fda
fix whitespace
yerke26 0ba2006
fix EngineRpcCapabilitiesProvider, revert ChainSpecBasedSpecProviderT…
yerke26 911d232
remove unnecessary comment
yerke26 f806f22
remove comments
yerke26 8dc3d6a
Merge branch 'master' into feature/eip-7742
yerke26 a993d59
Merge branch 'master' into feature/eip-7742
yerke26 ba1a3de
Merge branch 'master' into feature/eip-7742
yerke26 87e721a
add eip7742 logic to TryCalculateFeePerBlobGas
yerke26 e52fc98
remove MaxBlobCount, pass Spec to BlobGasCalculator
yerke26 49424d9
Merge branch 'master' into feature/eip-7742
yerke26 2162240
resolve merge conflicts
yerke26 9d4ec74
add MaxBlobCount in PayloadAttributes, refactoring, resolve comments
yerke26 d8e088c
fix tests
yerke26 793d085
Merge branch 'master' into feature/eip-7742
yerke26 a4fd1ef
fix Evm tool
yerke26 d022c4f
fix Evm tool
yerke26 47437f2
Merge branch 'master' into feature/eip-7742
yerke26 020ceef
resolve merge conflicts
yerke26 5699ad4
fix some tests
yerke26 81fb376
Merge branch 'master' into feature/eip-7742
yerke26 332322d
fix tests
yerke26 91822aa
fix AuraTests
yerke26 b4790dd
fix tests
yerke26 36464ad
fix JsonRpcTests
yerke26 459ebb7
fix TraceRpcModuleTests
yerke26 71963b7
fix tests
yerke26 94a1e4d
fix tests
yerke26 35d29c5
fix whitespaces
yerke26 5fab184
Merge branch 'master' into feature/eip-7742
yerke26 f00d86a
Update src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs
yerke26 1b9b367
Merge remote-tracking branch 'origin/feature/eip-7742' into feature/e…
yerke26 f13d22f
Merge branch 'master' into feature/eip-7742
yerke26 9718087
refactoring of BlockExecutionContext, move blobFee calculation to Vir…
yerke26 7a70d04
refactoring
yerke26 1d0dcc1
fix compilation erros
yerke26 aba9f7c
fix tests
yerke26 36f635d
fix tests, refactoring
yerke26 34ec30c
change to const
yerke26 8657a8c
fix TxPoolTxSource
yerke26 bb63085
fix
yerke26 4a83375
revert blobGasCalculator changes
yerke26 aa8cc8b
fix evm build
yerke26 e876201
revert BlobGasCalculatorTests
yerke26 1d05358
revert BlockExecutionContext
yerke26 c60067c
revert BlockHeader implicit conversion
yerke26 ce81cbe
revert remaining implicit conversion of header
yerke26 77c82a6
remove unnecessary import
yerke26 b465739
Update src/Nethermind/Nethermind.Consensus/Producers/TxPoolTxSource.cs
yerke26 41703ec
Update src/Nethermind/Nethermind.Consensus/Producers/TxPoolTxSource.cs
yerke26 fc1832b
Update src/Nethermind/Nethermind.Consensus/Producers/TxPoolTxSource.cs
yerke26 a6c75cc
resolve comments
yerke26 981f9ee
fix
yerke26 4339472
fix
yerke26 c2abd4c
Fix TransactionProcessorFeeTests: add eip enabled/disabled tests
yerke26 d1b14e9
add MaxBlobCount to BlockHeader
yerke26 2eb9fee
Update src/Nethermind/Nethermind.Consensus/Producers/TxPoolTxSource.cs
yerke26 82f6f4b
Revert "add MaxBlobCount to BlockHeader"
yerke26 0303cfd
Merge remote-tracking branch 'origin/feature/eip-7742' into feature/e…
yerke26 f63e7ef
fix tests with TargetBlobCount = 1
yerke26 13b65bd
fix tests
yerke26 6475265
Update src/Nethermind/Nethermind.JsonRpc/Modules/Eth/FeeHistory/FeeHi…
yerke26 dfe634e
fix whitespaces
yerke26 e231959
Merge branch 'master' into feature/eip-7742
yerke26 5c6dc2c
resolve merge conflicts
yerke26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,9 +62,13 @@ public IEnumerable<Transaction> GetTransactions(BlockHeader parent, long gasLimi | |
|
||
int checkedTransactions = 0; | ||
int selectedTransactions = 0; | ||
using ArrayPoolList<Transaction> selectedBlobTxs = new(_eip4844Config.GetMaxBlobsPerBlock()); | ||
|
||
SelectBlobTransactions(blobTransactions, parent, spec, selectedBlobTxs); | ||
using ArrayPoolList<Transaction> selectedBlobTxs = new((int)(payloadAttributes?.MaxBlobCount ?? Eip4844Constants.GetMaxBlobsPerBlock())); | ||
|
||
if (!spec.IsEip7742Enabled || payloadAttributes?.MaxBlobCount is not null) | ||
{ | ||
SelectBlobTransactions(blobTransactions, parent, spec, selectedBlobTxs); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You dont pass the |
||
} | ||
|
||
foreach (Transaction tx in transactions) | ||
{ | ||
|
@@ -119,7 +123,7 @@ private static IEnumerable<Transaction> PickBlobTxsBetterThanCurrentTx(ArrayPool | |
} | ||
} | ||
|
||
private void SelectBlobTransactions(IEnumerable<Transaction> blobTransactions, BlockHeader parent, IReleaseSpec spec, ArrayPoolList<Transaction> selectedBlobTxs) | ||
private void SelectBlobTransactions(IEnumerable<Transaction> blobTransactions, BlockHeader parent, IReleaseSpec spec, ArrayPoolList<Transaction> selectedBlobTxs, PayloadAttributes? payloadAttributes = null) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is |
||
{ | ||
int checkedBlobTransactions = 0; | ||
int selectedBlobTransactions = 0; | ||
|
@@ -128,7 +132,10 @@ private void SelectBlobTransactions(IEnumerable<Transaction> blobTransactions, B | |
|
||
foreach (Transaction blobTx in blobTransactions) | ||
{ | ||
if (blobGasCounter >= _eip4844Config.MaxBlobGasPerBlock) | ||
UInt256 maxBlobGas = spec.IsEip7742Enabled | ||
? payloadAttributes?.MaxBlobCount * Eip4844Constants.GasPerBlob ?? UInt256.Zero | ||
: _eip4844Config.MaxBlobGasPerBlock; | ||
if (blobGasCounter >= maxBlobGas) | ||
{ | ||
if (_logger.IsTrace) _logger.Trace($"Declining {blobTx.ToShortString()}, no more blob space. Block already have {blobGasCounter} blob gas which is max value allowed."); | ||
break; | ||
|
@@ -137,7 +144,9 @@ private void SelectBlobTransactions(IEnumerable<Transaction> blobTransactions, B | |
checkedBlobTransactions++; | ||
|
||
ulong txBlobGas = (ulong)(blobTx.BlobVersionedHashes?.Length ?? 0) * _eip4844Config.GasPerBlob; | ||
if (txBlobGas > _eip4844Config.MaxBlobGasPerBlock - blobGasCounter) | ||
|
||
UInt256 blobGasLeft = maxBlobGas - blobGasCounter; | ||
if (txBlobGas > blobGasLeft) | ||
{ | ||
if (_logger.IsTrace) _logger.Trace($"Declining {blobTx.ToShortString()}, not enough blob space."); | ||
continue; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.