Skip to content
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

eip 7840 implementation #7964

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c38a641
add MaxBlobCount, TargetBlobCount to chainSpec
yerke26 Dec 23, 2024
10342cc
Change FeeOracleHistory to use right MaxBlobCount
yerke26 Dec 23, 2024
5ef5d36
fix BlobGasUsedRatio
yerke26 Dec 24, 2024
6f45bc6
remove TargetBlobCount, MaxBlobCount constants
yerke26 Dec 30, 2024
0035b43
add PragueTransitionTimestamp
yerke26 Jan 6, 2025
d68374c
Merge branch 'master' into eip-7840
yerke26 Jan 6, 2025
b668cdf
remove PragueTransitionTimestamp, instead use Eip7002TransitionTimestamp
yerke26 Jan 7, 2025
eb77784
remove Eip4844MaxBlobCount, Eip4844TargetBlobCount from chainSpecParams
yerke26 Jan 7, 2025
b8bef08
fix TxValidatorTests
yerke26 Jan 7, 2025
7059480
fix TxValidatorTests
yerke26 Jan 7, 2025
b638d63
fix CancunStateTests
yerke26 Jan 7, 2025
0d5a076
fix TransactionProcessorEip4844Tests
yerke26 Jan 7, 2025
91f1b1f
fix TxPoolTests
yerke26 Jan 7, 2025
e494aa9
fix tests
yerke26 Jan 7, 2025
44481ba
fix FeeHistoryOracleTests
yerke26 Jan 7, 2025
05772a0
fix whitespaces
yerke26 Jan 7, 2025
b6b50b7
Merge branch 'master' into eip-7840
MarekM25 Jan 7, 2025
09a914d
remove hardcoded values
yerke26 Jan 7, 2025
1d271bd
Fix build errors
MarekM25 Jan 7, 2025
87acb12
Merge branch 'eip-7840' of https://github.com/nethermindeth/nethermin…
MarekM25 Jan 7, 2025
0aa4346
Fix OverridableReleaseSpec
MarekM25 Jan 7, 2025
87fc57d
remove hardcoded values
yerke26 Jan 7, 2025
f28e72a
add blobSchedule to chainSpec
yerke26 Jan 7, 2025
8804ccd
fix FeeHistoryOracleTests
yerke26 Jan 7, 2025
8c1c6f3
fix EthRpcModuleTests
yerke26 Jan 8, 2025
d9d60ab
fix PooledTxsRequestor
yerke26 Jan 8, 2025
6058cb1
use the release spec from the testcase and add prague count test
tanishqjasoria Jan 8, 2025
78b9e33
rename
tanishqjasoria Jan 8, 2025
22b7d1d
fix fee history oracle pre cancun
tanishqjasoria Jan 8, 2025
4fbd890
fix gnosis and chiado specs
tanishqjasoria Jan 8, 2025
6952229
Merge branch 'master' into eip-7840
tanishqjasoria Jan 8, 2025
5b4c0d1
fix whitespaces
yerke26 Jan 8, 2025
cb445ee
Merge branch 'master' into eip-7840
MarekM25 Jan 8, 2025
e181b43
fix default blobCount and targetCount
MarekM25 Jan 8, 2025
43e1655
fix PooledTxsRequestor to use spec at current head
yerke26 Jan 9, 2025
0c309ea
fix PooledTxsRequestorTests
yerke26 Jan 9, 2025
c2737fc
CalculateMaxBlobTxSize through transitionActivations
yerke26 Jan 9, 2025
362f18c
set default TargetBlobCount, MaxBlobCount to zero
yerke26 Jan 9, 2025
2f1f6f2
fix defaults
MarekM25 Jan 9, 2025
43bda5a
set default value for gnosisChain
yerke26 Jan 9, 2025
1ecf556
add Eip7840DefaultBlobCountFraction for gnosis chain
yerke26 Jan 10, 2025
3872a10
fix gnosis, chiado chains json
yerke26 Jan 10, 2025
58a3ff9
revert default value changes
yerke26 Jan 13, 2025
a528f1e
Merge branch 'master' into eip-7840
tanishqjasoria Jan 15, 2025
f36e6c4
add blob price update fraction (#8053)
tanishqjasoria Jan 16, 2025
78910ec
cosmetic
MarekM25 Jan 16, 2025
b288921
Merge branch 'eip-7840' of https://github.com/nethermindeth/nethermin…
MarekM25 Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ private async Task InitPeer()
ForkInfo forkInfo = new(_api.SpecProvider!, syncServer.Genesis.Hash!);

ProtocolValidator protocolValidator = new(_api.NodeStatsManager!, _api.BlockTree, forkInfo, _api.LogManager);
PooledTxsRequestor pooledTxsRequestor = new(_api.TxPool!, _api.Config<ITxPoolConfig>());
PooledTxsRequestor pooledTxsRequestor = new(_api.TxPool!, _api.Config<ITxPoolConfig>(), _api.SpecProvider, _api.BlockTree);

ISnapServer? snapServer = null;
if (_syncConfig.SnapServingEnabled == true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,39 @@
// SPDX-License-Identifier: LGPL-3.0-only

using System;
using Nethermind.Blockchain;
using Nethermind.Core;
using Nethermind.Core.Caching;
using Nethermind.Core.Collections;
using Nethermind.Core.Crypto;
using Nethermind.Core.Specs;
using Nethermind.Network.P2P.Subprotocols.Eth.V62.Messages;
using Nethermind.Network.P2P.Subprotocols.Eth.V65.Messages;
using Nethermind.Specs.Forks;
using Nethermind.TxPool;

namespace Nethermind.Network.P2P.Subprotocols.Eth
{
public class PooledTxsRequestor(ITxPool txPool, ITxPoolConfig txPoolConfig) : IPooledTxsRequestor
public class PooledTxsRequestor(ITxPool txPool, ITxPoolConfig txPoolConfig, ISpecProvider specProvider, IBlockTree blockTree) : IPooledTxsRequestor
{
private const int MaxNumberOfTxsInOneMsg = 256;
private readonly bool _blobSupportEnabled = txPoolConfig.BlobsSupport.IsEnabled();
private readonly long _configuredMaxTxSize = txPoolConfig.MaxTxSize ?? long.MaxValue;

private readonly long _configuredMaxBlobTxSize = txPoolConfig.MaxBlobTxSize is not null
? txPoolConfig.MaxBlobTxSize.Value + (long)(Eip4844Constants.GasPerBlob * Cancun.Instance.MaxBlobCount) : long.MaxValue;
private readonly long _configuredMaxBlobTxSize = CalculateMaxBlobTxSize(txPoolConfig.MaxBlobTxSize, blockTree, specProvider);

private static long CalculateMaxBlobTxSize(long? maxBlobTxSize, IBlockTree blockTree, ISpecProvider specProvider)
{
if (maxBlobTxSize is null)
{
return long.MaxValue;
}
IReleaseSpec currentSpec = blockTree.Head is null
? specProvider.GenesisSpec
: specProvider.GetSpec(blockTree.Head.Header);

return maxBlobTxSize.Value + (long)(Eip4844Constants.GasPerBlob * currentSpec.MaxBlobCount);
}
smartprogrammer93 marked this conversation as resolved.
Show resolved Hide resolved

private readonly ClockKeyCache<ValueHash256> _pendingHashes = new(MemoryAllowance.TxHashCacheSize);

Expand Down
Loading