Skip to content

Commit 02386fd

Browse files
committed
Merge branch 'master' into feature/t8n-test
2 parents 5d07d8d + 71c0c6f commit 02386fd

File tree

142 files changed

+1341
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1341
-702
lines changed

src/Nethermind/Chains/chiado.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,18 @@
7878
"eip1559ElasticityMultiplier": "0x2",
7979
"feeCollector": "0x1559000000000000000000000000000000000000",
8080
"eip1559FeeCollectorTransition": 0,
81-
"eip4844BlobGasPriceUpdateFraction": "0x10fafa",
82-
"eip4844MaxBlobGasPerBlock": "0x40000",
8381
"eip4844MinBlobGasPrice": "0x3b9aca00",
84-
"eip4844TargetBlobGasPerBlock": "0x20000",
8582
"registrar": "0x6000000000000000000000000000000000000000",
8683
"transactionPermissionContract": "0x4000000000000000000000000000000000000001",
8784
"transactionPermissionContractTransition": "0x0",
88-
"terminalTotalDifficulty": "231707791542740786049188744689299064356246512"
85+
"terminalTotalDifficulty": "231707791542740786049188744689299064356246512",
86+
"blobSchedule": {
87+
"cancun": {
88+
"target": 1,
89+
"max": 2,
90+
"baseFeeUpdateFraction": "0x10fafa"
91+
}
92+
}
8993
},
9094
"genesis": {
9195
"seal": {

src/Nethermind/Chains/foundation.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,19 @@
191191
"eip4844TransitionTimestamp": "0x65F1B057",
192192
"eip5656TransitionTimestamp": "0x65F1B057",
193193
"eip6780TransitionTimestamp": "0x65F1B057",
194-
"terminalTotalDifficulty": "C70D808A128D7380000"
194+
"terminalTotalDifficulty": "C70D808A128D7380000",
195+
"blobSchedule": {
196+
"cancun": {
197+
"target": 3,
198+
"max": 6,
199+
"baseFeeUpdateFraction": "0x32f0ed"
200+
},
201+
"prague": {
202+
"target": 6,
203+
"max": 9,
204+
"baseFeeUpdateFraction": "0x4c6964"
205+
}
206+
}
195207
},
196208
"genesis": {
197209
"seal": {

src/Nethermind/Chains/gnosis.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,18 @@
8585
"eip1559BaseFeeInitialValue": "0x3b9aca00",
8686
"feeCollector": "0x6BBe78ee9e474842Dbd4AB4987b3CeFE88426A92",
8787
"eip1559FeeCollectorTransition": 19040000,
88-
"eip4844BlobGasPriceUpdateFraction": "0x10fafa",
89-
"eip4844MaxBlobGasPerBlock": "0x40000",
9088
"eip4844MinBlobGasPrice": "0x3b9aca00",
91-
"eip4844TargetBlobGasPerBlock": "0x20000",
9289
"registrar": "0x6B53721D4f2Fb9514B85f5C49b197D857e36Cf03",
9390
"transactionPermissionContract": "0x7Dd7032AA75A37ea0b150f57F899119C7379A78b",
9491
"transactionPermissionContractTransition": 9186425,
95-
"terminalTotalDifficulty": "8626000000000000000000058750000000000000000000"
92+
"terminalTotalDifficulty": "8626000000000000000000058750000000000000000000",
93+
"blobSchedule": {
94+
"cancun": {
95+
"target": 1,
96+
"max": 2,
97+
"baseFeeUpdateFraction": "0x10fafa"
98+
}
99+
}
96100
},
97101
"genesis": {
98102
"seal": {

src/Nethermind/Chains/hive.json

Lines changed: 77 additions & 107 deletions
Large diffs are not rendered by default.

src/Nethermind/Chains/holesky.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,19 @@
5252
"maximumExtraDataSize": "0xffff",
5353
"minGasLimit": "0x1388",
5454
"registrar": "0x0000000000000000000000000000000000000000",
55-
"MergeForkIdTransition": "0x0"
55+
"MergeForkIdTransition": "0x0",
56+
"blobSchedule": {
57+
"cancun": {
58+
"target": 3,
59+
"max": 6,
60+
"baseFeeUpdateFraction": "0x32f0ed"
61+
},
62+
"prague": {
63+
"target": 6,
64+
"max": 9,
65+
"baseFeeUpdateFraction": "0x4c6964"
66+
}
67+
}
5668
},
5769
"genesis": {
5870
"seal": {

src/Nethermind/Chains/sepolia.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,19 @@
6666
"eip4788TransitionTimestamp": "0x65B97D60",
6767
"eip4844TransitionTimestamp": "0x65B97D60",
6868
"eip5656TransitionTimestamp": "0x65B97D60",
69-
"eip6780TransitionTimestamp": "0x65B97D60"
69+
"eip6780TransitionTimestamp": "0x65B97D60",
70+
"blobSchedule": {
71+
"cancun": {
72+
"target": 3,
73+
"max": 6,
74+
"baseFeeUpdateFraction": "0x32f0ed"
75+
},
76+
"prague": {
77+
"target": 6,
78+
"max": 9,
79+
"baseFeeUpdateFraction": "0x4c6964"
80+
}
81+
}
7082
},
7183
"genesis": {
7284
"seal": {

src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected EthereumTestResult RunTest(GeneralStateTest test, ITxTracer txTracer)
133133
TransactionResult? txResult = null;
134134
if (txIsValid)
135135
{
136-
txResult = transactionProcessor.Execute(test.Transaction, new BlockExecutionContext(header), txTracer);
136+
txResult = transactionProcessor.Execute(test.Transaction, new BlockExecutionContext(header, spec), txTracer);
137137
}
138138
else
139139
{

src/Nethermind/Nethermind.Api/IApiWithStores.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public interface IApiWithStores : IBasicApi
2525
ILogFinder? LogFinder { get; set; }
2626
ISigner? EngineSigner { get; set; }
2727
ISignerStore? EngineSignerStore { get; set; }
28-
ProtectedPrivateKey? NodeKey { get; set; }
28+
IProtectedPrivateKey? NodeKey { get; set; }
2929
IReceiptStorage? ReceiptStorage { get; set; }
3030
IReceiptFinder? ReceiptFinder { get; set; }
3131
IReceiptMonitor? ReceiptMonitor { get; set; }

src/Nethermind/Nethermind.Api/IBasicApi.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77
using Autofac;
88
using Nethermind.Abi;
99
using Nethermind.Api.Extensions;
10-
using Nethermind.Blockchain.Receipts;
11-
using Nethermind.Blockchain.Synchronization;
1210
using Nethermind.Config;
1311
using Nethermind.Core;
1412
using Nethermind.Core.Specs;
1513
using Nethermind.Core.Timers;
1614
using Nethermind.Crypto;
1715
using Nethermind.Db;
18-
using Nethermind.Era1;
1916
using Nethermind.KeyStore;
2017
using Nethermind.Logging;
2118
using Nethermind.Serialization.Json;
@@ -39,7 +36,7 @@ public interface IBasicApi
3936
IFileSystem FileSystem { get; set; }
4037
IKeyStore? KeyStore { get; set; }
4138
ILogManager LogManager { get; set; }
42-
ProtectedPrivateKey? OriginalSignerKey { get; set; }
39+
IProtectedPrivateKey? OriginalSignerKey { get; set; }
4340
IReadOnlyList<INethermindPlugin> Plugins { get; }
4441
[SkipServiceCollection]
4542
string SealEngineType { get; set; }

src/Nethermind/Nethermind.Api/NethermindApi.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ public ISealEngine SealEngine
233233
public IWebSocketsManager WebSocketsManager { get; set; } = new WebSocketsManager();
234234

235235
public ISubscriptionFactory? SubscriptionFactory { get; set; }
236-
public ProtectedPrivateKey? NodeKey { get; set; }
236+
public IProtectedPrivateKey? NodeKey { get; set; }
237237

238238
/// <summary>
239239
/// Key used for signing blocks. Original as its loaded on startup. This can later be changed via RPC in <see cref="Signer"/>.
240240
/// </summary>
241-
public ProtectedPrivateKey? OriginalSignerKey { get; set; }
241+
public IProtectedPrivateKey? OriginalSignerKey { get; set; }
242242

243243
public ChainSpec ChainSpec { get; set; }
244244
public DisposableStack DisposeStack { get; }

src/Nethermind/Nethermind.Blockchain.Test/BeaconBlockRootHandlerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,6 @@ public void Test_StoreBeaconRoot_AccessListNotNull()
149149

150150
transaction.Hash = transaction.CalculateHash();
151151
_transactionProcessor.Received().Execute(Arg.Is<Transaction>(t =>
152-
t.Hash == transaction.Hash), header, NullTxTracer.Instance);
152+
t.Hash == transaction.Hash), new BlockExecutionContext(header, Cancun.Instance), NullTxTracer.Instance);
153153
}
154154
}

src/Nethermind/Nethermind.Blockchain.Test/TestEip4844Config.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/Nethermind/Nethermind.Blockchain.Test/TransactionSelectorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public static IEnumerable EnoughShardBlobTransactionsSelectedTestCases
160160
tx.MaxFeePerBlobGas = 1;
161161
});
162162
maxTransactionsSelected.Transactions[1].BlobVersionedHashes =
163-
new byte[Eip4844Constants.MaxBlobGasPerTransaction / Eip4844Constants.GasPerBlob - 1][];
163+
new byte[maxTransactionsSelected.ReleaseSpec.MaxBlobCount - 1][];
164164
maxTransactionsSelected.ExpectedSelectedTransactions.AddRange(
165165
maxTransactionsSelected.Transactions.OrderBy(static t => t.Nonce).Take(2));
166166
yield return new TestCaseData(maxTransactionsSelected).SetName("Enough transactions selected");
@@ -174,7 +174,7 @@ public static IEnumerable EnoughShardBlobTransactionsSelectedTestCases
174174
enoughTransactionsSelected.Transactions.OrderBy(static t => t.Nonce).ToArray();
175175
expectedSelectedTransactions[0].Type = TxType.Blob;
176176
expectedSelectedTransactions[0].BlobVersionedHashes =
177-
new byte[Eip4844Constants.MaxBlobGasPerTransaction / Eip4844Constants.GasPerBlob][];
177+
new byte[enoughTransactionsSelected.ReleaseSpec.MaxBlobCount][];
178178
expectedSelectedTransactions[0].MaxFeePerBlobGas = 1;
179179
expectedSelectedTransactions[1].Type = TxType.Blob;
180180
expectedSelectedTransactions[1].BlobVersionedHashes = new byte[1][];

src/Nethermind/Nethermind.Blockchain.Test/TxPoolSourceTests.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,14 @@ public void GetTransactions_should_respect_customizable_blob_gas_limit(int[] blo
3636
ITxFilterPipeline txFilterPipeline = Substitute.For<ITxFilterPipeline>();
3737
txFilterPipeline.Execute(Arg.Any<Transaction>(), Arg.Any<BlockHeader>()).Returns(true);
3838

39-
TestEip4844Config eip4844Config = new(customMaxBlobGasPerBlock);
40-
41-
TxPoolTxSource transactionSelector = new(txPool, specProvider, transactionComparerProvider, LimboLogs.Instance, txFilterPipeline, eip4844Config);
39+
TxPoolTxSource transactionSelector = new(txPool, specProvider, transactionComparerProvider, LimboLogs.Instance, txFilterPipeline);
4240

4341
IEnumerable<Transaction> txs = transactionSelector.GetTransactions(new BlockHeader { }, long.MaxValue);
4442
int blobsCount = txs.Sum(tx => tx.BlobVersionedHashes?.Length ?? 0);
4543

4644
Assert.Multiple(() =>
4745
{
48-
Assert.That((ulong)blobsCount * eip4844Config.GasPerBlob, Is.LessThanOrEqualTo(eip4844Config.MaxBlobGasPerBlock));
49-
Assert.That(blobsCount, Is.LessThanOrEqualTo(eip4844Config.GetMaxBlobsPerBlock()));
46+
Assert.That(blobsCount, Is.LessThanOrEqualTo(Cancun.Instance.MaxBlobCount));
5047
});
5148
}
5249

src/Nethermind/Nethermind.Blockchain.Test/Validators/ShardBlobBlockValidatorTests.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public static bool Blob_gas_fields_should_be_set(IReleaseSpec spec, ulong? blobG
3333
}
3434

3535
[TestCaseSource(nameof(BlobsPerBlockCountTestCases))]
36-
public bool Blobs_per_block_count_is_valid(ulong blobGasUsed)
36+
public bool Blobs_per_block_count_is_valid(IReleaseSpec spec, ulong blobGasUsed)
3737
{
38-
ISpecProvider specProvider = new CustomSpecProvider(((ForkActivation)0, Cancun.Instance));
38+
ISpecProvider specProvider = new CustomSpecProvider(((ForkActivation)0, spec));
3939
BlockValidator blockValidator = new(Always.Valid, Always.Valid, Always.Valid, specProvider, TestLogManager.Instance);
4040
return blockValidator.ValidateSuggestedBlock(
4141
Build.A.Block
@@ -53,13 +53,19 @@ public bool Blobs_per_block_count_is_valid(ulong blobGasUsed)
5353

5454
private static IEnumerable<TestCaseData> BlobsPerBlockCountTestCases()
5555
{
56-
yield return new TestCaseData(0UL) { ExpectedResult = true };
56+
yield return new TestCaseData(Cancun.Instance, 0UL) { ExpectedResult = true };
57+
58+
yield return new TestCaseData(Cancun.Instance, (Cancun.Instance.MaxBlobCount - 1) * Eip4844Constants.GasPerBlob) { ExpectedResult = true };
59+
60+
yield return new TestCaseData(Cancun.Instance, Cancun.Instance.MaxBlobCount * Eip4844Constants.GasPerBlob) { ExpectedResult = true };
61+
62+
yield return new TestCaseData(Cancun.Instance, (Cancun.Instance.MaxBlobCount + 1) * Eip4844Constants.GasPerBlob) { ExpectedResult = false };
5763

58-
yield return new TestCaseData(Eip4844Constants.MaxBlobGasPerBlock - Eip4844Constants.GasPerBlob) { ExpectedResult = true };
64+
yield return new TestCaseData(Prague.Instance, (Prague.Instance.MaxBlobCount - 1) * Eip4844Constants.GasPerBlob) { ExpectedResult = true };
5965

60-
yield return new TestCaseData(Eip4844Constants.MaxBlobGasPerBlock) { ExpectedResult = true };
66+
yield return new TestCaseData(Prague.Instance, (Prague.Instance.MaxBlobCount) * Eip4844Constants.GasPerBlob) { ExpectedResult = true };
6167

62-
yield return new TestCaseData(Eip4844Constants.MaxBlobGasPerBlock + Eip4844Constants.GasPerBlob) { ExpectedResult = false };
68+
yield return new TestCaseData(Prague.Instance, (Prague.Instance.MaxBlobCount + 1) * Eip4844Constants.GasPerBlob) { ExpectedResult = false };
6369
}
6470

6571
private static IEnumerable<TestCaseData> BlobGasFieldsPerForkTestCases()

0 commit comments

Comments
 (0)