Skip to content

Commit 0920134

Browse files
marcindsobczakflcl42benaadamsmininnyLukaszRozmej
authored
EIP-7594: PeerDAS (#8417)
* calculate cell kzg proofs * extent tx network wrapper * add cell proofs to test tx builder * add test for blob txs with cell proofs * add tx extension to supply both blob proofs and cell proofs * adjust tx builder to current master * fix data length * adjust tx validator * extend test * simplify network wrapper * cosmetics * hack decoder to accept optional blob proofs * cleaning * add cell proofs verification * fix * draft of translation logic * enable translation in tx validator * fix commitments * Send blobs update * Add engine_getBlobsV2, Fusaka * Fix proofs * drop BlobSender changes * Fix encoding * undo remaining blob sender changes * Fix block production * undo bs * Fix multiple blobs sending * Add more structs and APIs * Split GetBlobsHandler file * cleaning * fix blob tx decoder * fix old proof length in transaction builder * fix transaction builder * whitespaces, encoding * add getBlobsV2 to engine rpc capabilities * fix test * fix proofs validation * bring back Alexey's BlobSender changes * whitespace * fix * Add manager(just PoC) * Add osaka blobs settings change handling * add ProofVersion to ChainHeadInfoProvider and add SpecDrivenTxGossipPolicy * Fix some tests * Fix V2 proofs * fix file encoding * add error InvalidProofVersion * invalidate if proof version is not correct * add test OsakaSpecProvider * adjust and extend test for cell proofs pre and post osaka * Fix APIs * Fix a test * Move name to spec to Spec project * Fix build * fix cancun caps * Make tx pool return blob txs with applicable proof version * Change proof version * Display better error * add ProofsTranslationEnabled to config * convert old proof to cell proofs if enabled and after fusaka * add test * allow replacement: new proofs for old proof * add regression test * fix transaction selector tests * Fix blob sender #2 and #3 breaks * fix engine_getBlobsV2 warning * fix osaka caps activation * fix tests * extend test for blobs bundle v1 * add regression test for blobs bundle v2 * whitespaces * fix blobs bundle v2 * cosmetic * fix versions * add AreBlobsAvailable * add metrics * return empty array if not all blobs are available * add tests, fix disposing issues * fix build * Dial back JsonRpc log spam * fix test * default ProofsTranslationEnabled to false * fix test * Rename proof versions for less confusion * Fix naming change * One does not simply rename an enum value * Simplify proof version checkers * Clean up * Ckzg.Ckzg -> Ckzg. (#8568) Ckzg./2 * Rename peerdas getBlobsV2 metrics (#8579) * Add metrics for getBlobsV2 * Remove AreBlobsAvailable * Rename metrics * fix * fix build * fix test * readd proof version validation * Quick cleanup * Fix gpv3 fork validation * Fix building * Clean up * Evict transactions with old proofs * Improve test * Fix test * Fix some comments * Update src/Nethermind/Nethermind.Merge.Plugin/Metrics.cs Co-authored-by: Lukasz Rozmej <[email protected]> * More fixes * More * More fixes * More fixes * Use preallocated span not list * Segregate; statics * Update src/Nethermind/Nethermind.Merge.Plugin.Test/EngineModuleTests.V4.cs Co-authored-by: Ben {chmark} Adams <[email protected]> * Fix --------- Co-authored-by: Alexey Osipov <[email protected]> Co-authored-by: Ben Adams <[email protected]> Co-authored-by: Minhyuk Kim <[email protected]> Co-authored-by: Lukasz Rozmej <[email protected]>
1 parent 99e074e commit 0920134

File tree

86 files changed

+1548
-401
lines changed

Some content is hidden

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

86 files changed

+1548
-401
lines changed

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

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,57 +16,12 @@
1616
using Nethermind.Int256;
1717
using Nethermind.Serialization.Json;
1818
using Nethermind.Serialization.Rlp;
19-
using Nethermind.Specs.Forks;
19+
using Nethermind.Specs;
2020

2121
namespace Ethereum.Test.Base
2222
{
2323
public static class JsonToEthereumTest
2424
{
25-
public static IReleaseSpec ParseSpec(string network)
26-
{
27-
network = network.Replace("EIP150", "TangerineWhistle");
28-
network = network.Replace("EIP158", "SpuriousDragon");
29-
network = network.Replace("DAO", "Dao");
30-
network = network.Replace("Merged", "Paris");
31-
network = network.Replace("Merge", "Paris");
32-
network = network.Replace("London+3540+3670", "Shanghai");
33-
network = network.Replace("GrayGlacier+3540+3670", "Shanghai");
34-
network = network.Replace("GrayGlacier+3860", "Shanghai");
35-
network = network.Replace("GrayGlacier+3855", "Shanghai");
36-
network = network.Replace("Merge+3540+3670", "Shanghai");
37-
network = network.Replace("Shanghai+3855", "Shanghai");
38-
network = network.Replace("Shanghai+3860", "Shanghai");
39-
network = network.Replace("GrayGlacier+1153", "Cancun");
40-
network = network.Replace("Merge+1153", "Cancun");
41-
network = network.Replace("Shanghai+6780", "Cancun");
42-
network = network.Replace("GrayGlacier+1153", "Cancun");
43-
network = network.Replace("Merge+1153", "Cancun");
44-
return network switch
45-
{
46-
"Frontier" => Frontier.Instance,
47-
"Homestead" => Homestead.Instance,
48-
"TangerineWhistle" => TangerineWhistle.Instance,
49-
"SpuriousDragon" => SpuriousDragon.Instance,
50-
"EIP150" => TangerineWhistle.Instance,
51-
"EIP158" => SpuriousDragon.Instance,
52-
"Dao" => Dao.Instance,
53-
"Constantinople" => Constantinople.Instance,
54-
"ConstantinopleFix" => ConstantinopleFix.Instance,
55-
"Byzantium" => Byzantium.Instance,
56-
"Istanbul" => Istanbul.Instance,
57-
"Berlin" => Berlin.Instance,
58-
"London" => London.Instance,
59-
"ArrowGlacier" => ArrowGlacier.Instance,
60-
"GrayGlacier" => GrayGlacier.Instance,
61-
"Shanghai" => Shanghai.Instance,
62-
"Cancun" => Cancun.Instance,
63-
"Paris" => Paris.Instance,
64-
"Prague" => Prague.Instance,
65-
"Osaka" => Osaka.Instance,
66-
_ => throw new NotSupportedException()
67-
};
68-
}
69-
7025
private static ForkActivation TransitionForkActivation(string transitionInfo)
7126
{
7227
const string timestampPrefix = "Time";
@@ -252,7 +207,7 @@ public static IEnumerable<GeneralStateTest> Convert(string name, string category
252207
test.Category = category;
253208

254209
test.ForkName = postStateBySpec.Key;
255-
test.Fork = ParseSpec(postStateBySpec.Key);
210+
test.Fork = SpecNameParser.Parse(postStateBySpec.Key);
256211
test.PreviousHash = testJson.Env.PreviousHash;
257212
test.CurrentCoinbase = testJson.Env.CurrentCoinbase;
258213
test.CurrentDifficulty = testJson.Env.CurrentDifficulty;
@@ -410,11 +365,11 @@ public static IEnumerable<BlockchainTest> ConvertToBlockchainTests(string json)
410365
string[] transitionInfo = testSpec.Network.Split("At");
411366
string[] networks = transitionInfo[0].Split("To");
412367

413-
testSpec.EthereumNetwork = ParseSpec(networks[0]);
368+
testSpec.EthereumNetwork = SpecNameParser.Parse(networks[0]);
414369
if (transitionInfo.Length > 1)
415370
{
416371
testSpec.TransitionForkActivation = TransitionForkActivation(transitionInfo[1]);
417-
testSpec.EthereumNetworkAfterTransition = ParseSpec(networks[1]);
372+
testSpec.EthereumNetworkAfterTransition = SpecNameParser.Parse(networks[1]);
418373
}
419374

420375
(string name, string category) = GetNameAndCategory(testName);

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public static IEnumerable EnoughShardBlobTransactionsSelectedTestCases
161161
tx.Type = TxType.Blob;
162162
tx.BlobVersionedHashes = new byte[1][];
163163
tx.MaxFeePerBlobGas = 1;
164+
tx.NetworkWrapper = new ShardBlobNetworkWrapper(new byte[1][], new byte[1][], new byte[1][], ProofVersion.V0);
164165
});
165166
maxTransactionsSelected.Transactions[1].BlobVersionedHashes =
166167
new byte[maxTransactionsSelected.ReleaseSpec.MaxBlobCount - 1][];
@@ -179,9 +180,13 @@ public static IEnumerable EnoughShardBlobTransactionsSelectedTestCases
179180
expectedSelectedTransactions[0].BlobVersionedHashes =
180181
new byte[enoughTransactionsSelected.ReleaseSpec.MaxBlobCount][];
181182
expectedSelectedTransactions[0].MaxFeePerBlobGas = 1;
183+
expectedSelectedTransactions[0].NetworkWrapper =
184+
new ShardBlobNetworkWrapper(new byte[1][], new byte[1][], new byte[1][], ProofVersion.V0);
182185
expectedSelectedTransactions[1].Type = TxType.Blob;
183186
expectedSelectedTransactions[1].BlobVersionedHashes = new byte[1][];
184187
expectedSelectedTransactions[1].MaxFeePerBlobGas = 1;
188+
expectedSelectedTransactions[1].NetworkWrapper =
189+
new ShardBlobNetworkWrapper(new byte[1][], new byte[1][], new byte[1][], ProofVersion.V0);
185190
enoughTransactionsSelected.ExpectedSelectedTransactions.AddRange(
186191
expectedSelectedTransactions.Where(static (_, index) => index != 1));
187192
yield return new TestCaseData(enoughTransactionsSelected).SetName(
@@ -230,12 +235,13 @@ private static Transaction CreateBlobTransaction(Address address, PrivateKey key
230235

231236
private static Transaction CreateBlobTransaction(Address address, PrivateKey key, UInt256 maxFee, int blobCount, UInt256 nonce, uint priority = 1)
232237
{
233-
return Build.A.Transaction.WithSenderAddress(address).WithType(TxType.Blob).WithNonce(nonce)
238+
return Build.A.Transaction
239+
.WithSenderAddress(address)
240+
.WithShardBlobTxTypeAndFields(blobCount)
241+
.WithNonce(nonce)
234242
.WithMaxFeePerGas(maxFee)
235-
.WithMaxFeePerBlobGas(2)
236243
.WithMaxPriorityFeePerGas(priority)
237244
.WithGasLimit(20)
238-
.WithBlobVersionedHashes([.. Enumerable.Range(0, blobCount).Select(i => new byte[1] { 0 })])
239245
.SignedAndResolved(key).TestObject;
240246
}
241247

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
1+
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

44
using System;
@@ -792,21 +792,21 @@ static TransactionBuilder<Transaction> MakeTestObject(int blobCount = 1) => Buil
792792
ExpectedResult = false
793793
};
794794
yield return new TestCaseData(Cancun.Instance, MakeTestObject()
795-
.With(static tx => ((ShardBlobNetworkWrapper)tx.NetworkWrapper!).Blobs = [])
795+
.With(static tx => tx.NetworkWrapper = ((ShardBlobNetworkWrapper)tx.NetworkWrapper!) with { Blobs = [] })
796796
.SignedAndResolved().TestObject)
797797
{
798798
TestName = "Blobs count does not match hashes count",
799799
ExpectedResult = false
800800
};
801801
yield return new TestCaseData(Cancun.Instance, MakeTestObject()
802-
.With(static tx => ((ShardBlobNetworkWrapper)tx.NetworkWrapper!).Commitments = [])
802+
.With(static tx => tx.NetworkWrapper = ((ShardBlobNetworkWrapper)tx.NetworkWrapper!) with { Commitments = [] })
803803
.SignedAndResolved().TestObject)
804804
{
805805
TestName = "Commitments count does not match hashes count",
806806
ExpectedResult = false
807807
};
808808
yield return new TestCaseData(Cancun.Instance, MakeTestObject()
809-
.With(static tx => ((ShardBlobNetworkWrapper)tx.NetworkWrapper!).Proofs = [])
809+
.With(static tx => tx.NetworkWrapper = ((ShardBlobNetworkWrapper)tx.NetworkWrapper!) with { Proofs = [] })
810810
.SignedAndResolved().TestObject)
811811
{
812812
TestName = "Proofs count does not match hashes count",

src/Nethermind/Nethermind.Blockchain/ChainHeadInfoProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public ChainHeadInfoProvider(IChainHeadSpecProvider specProvider, IBlockTree blo
5656

5757
public UInt256 CurrentFeePerBlobGas { get; internal set; }
5858

59+
public ProofVersion CurrentProofVersion { get; private set; }
60+
5961
public bool IsSyncing
6062
{
6163
get
@@ -82,6 +84,7 @@ private void OnHeadChanged(object? sender, BlockReplacementEventArgs e)
8284
BlobGasCalculator.TryCalculateFeePerBlobGas(e.Block.Header, spec.BlobBaseFeeUpdateFraction, out UInt256 currentFeePerBlobGas)
8385
? currentFeePerBlobGas
8486
: UInt256.Zero;
87+
CurrentProofVersion = spec.BlobProofVersion;
8588
HeadChanged?.Invoke(sender, e);
8689
}
8790
}

src/Nethermind/Nethermind.Consensus.AuRa/InitializationSteps/InitializeBlockchainAuRa.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private IComparer<Transaction> CreateTxPoolTxComparer(TxPriorityContract? txPrio
242242
return CreateTxPoolTxComparer();
243243
}
244244

245-
protected override TxPool.TxPool CreateTxPool(CodeInfoRepository codeInfoRepository)
245+
protected override TxPool.TxPool CreateTxPool(IChainHeadInfoProvider chainHeadInfoProvider)
246246
{
247247
// This has to be different object than the _processingReadOnlyTransactionProcessorSource as this is in separate thread
248248
TxPriorityContract txPriorityContract = _api.TxAuRaFilterBuilders.CreateTxPrioritySources();
@@ -258,7 +258,7 @@ protected override TxPool.TxPool CreateTxPool(CodeInfoRepository codeInfoReposit
258258
return new TxPool.TxPool(
259259
_api.EthereumEcdsa!,
260260
_api.BlobTxStorage ?? NullBlobTxStorage.Instance,
261-
new ChainHeadInfoProvider(_api.SpecProvider!, _api.BlockTree!, _api.StateReader!, codeInfoRepository),
261+
chainHeadInfoProvider,
262262
NethermindApi.Config<ITxPoolConfig>(),
263263
_api.TxValidator!,
264264
_api.LogManager,

src/Nethermind/Nethermind.Consensus/Messages/TxErrorMessages.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
1+
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

4-
using CkzgLib;
54
using Nethermind.Core;
65
using Nethermind.Crypto;
76

@@ -32,7 +31,7 @@ public static string InvalidTxChainId(ulong expected, ulong? actual) =>
3231
public const string NotAllowedBlobVersionedHashes =
3332
"NotAllowedBlobVersionedHashes: Cannot be set.";
3433

35-
public const string InvalidTransaction =
34+
public const string InvalidTransactionForm =
3635
$"InvalidTransaction: Cannot be {nameof(ShardBlobNetworkWrapper)}.";
3736

3837
public const string NotAllowedCreateTransaction =
@@ -59,14 +58,19 @@ public static string BlobTxGasLimitExceeded(ulong totalDataGas, ulong maxBlobGas
5958
public const string InvalidBlobVersionedHashVersion =
6059
"InvalidBlobVersionedHashVersion: Blob version not supported.";
6160

62-
public static readonly string ExceededBlobSize =
63-
$"ExceededBlobSize: Cannot be more than {Ckzg.BytesPerBlob}.";
61+
public static readonly string InvalidBlobDataSize =
62+
$"InvalidBlobDataSize: Blob data fields are of incorrect size.";
63+
64+
public const string InvalidBlobHashes =
65+
"InvalidBlobProof: Hashes do not match the blobs.";
66+
67+
public const string InvalidBlobProofs =
68+
"InvalidBlobProof: Proofs do not match the blobs.";
69+
70+
public const string InvalidProofVersion =
71+
"InvalidTxProofVersion: Version of network wrapper is not supported.";
6472

65-
public static readonly string ExceededBlobCommitmentSize =
66-
$"ExceededBlobCommitmentSize: Cannot be more than {Ckzg.BytesPerCommitment}.";
6773

68-
public static readonly string InvalidBlobProofSize =
69-
$"InvalidBlobProofSize: Cannot be more than {Ckzg.BytesPerProof}.";
7074

7175
public const string NotAllowedAuthorizationList = $"NotAllowedAuthorizationList: Only transactions with type {nameof(TxType.SetCode)} can have authorization_list.";
7276

@@ -77,12 +81,6 @@ public static string BlobTxGasLimitExceeded(ulong totalDataGas, ulong maxBlobGas
7781
public const string InvalidBlobCommitmentHash =
7882
"InvalidBlobCommitmentHash: Commitment hash does not match.";
7983

80-
public const string InvalidBlobProof =
81-
"InvalidBlobProof: Proof does not match.";
82-
83-
public const string InvalidBlobData
84-
= "InvalidTxBlobData: Number of blobs, hashes, commitments and proofs must match.";
85-
8684
public static string TxGasLimitCapExceeded(long gasLimit, long gasLimitCap)
8785
=> $"TxGasLimitCapExceeded: Gas limit {gasLimit} exceeed cap of {gasLimitCap}.";
8886

src/Nethermind/Nethermind.Consensus/Producers/TxPoolTxSource.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
1+
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

44
using System;
@@ -40,7 +40,7 @@ public class TxPoolTxSource(
4040
public IEnumerable<Transaction> GetTransactions(BlockHeader parent, long gasLimit, PayloadAttributes? payloadAttributes = null, bool filterSource = false)
4141
{
4242
long blockNumber = parent.Number + 1;
43-
IReleaseSpec spec = _specProvider.GetSpec(parent);
43+
IReleaseSpec spec = payloadAttributes is not null ? _specProvider.GetSpec(blockNumber, payloadAttributes.Timestamp) : _specProvider.GetSpec(parent);
4444
UInt256 baseFee = BaseFeeCalculator.Calculate(parent, spec);
4545
IDictionary<AddressAsKey, Transaction[]> pendingTransactions = filterSource ?
4646
_transactionPool.GetPendingTransactionsBySender(filterToReadyTx: true, baseFee) :
@@ -103,13 +103,17 @@ bool ResolveBlob(Transaction blobTx, out Transaction fullBlobTx)
103103
{
104104
if (TryGetFullBlobTx(blobTx, out fullBlobTx))
105105
{
106+
ProofVersion? proofVersion = (fullBlobTx.NetworkWrapper as ShardBlobNetworkWrapper)?.Version;
107+
if (spec.BlobProofVersion != proofVersion)
108+
{
109+
if (_logger.IsTrace) _logger.Trace($"Declining {blobTx.ToShortString()}, {spec.BlobProofVersion} is wanted, but tx's proof version is {proofVersion}.");
110+
return false;
111+
}
112+
106113
return true;
107114
}
108-
else if (_logger.IsTrace)
109-
{
110-
_logger.Trace($"Declining {blobTx.ToShortString()}, failed to get full version of this blob tx from TxPool.");
111-
}
112115

116+
if (_logger.IsTrace) _logger.Trace($"Declining {blobTx.ToShortString()}, failed to get full version of this blob tx from TxPool.");
113117
return false;
114118
}
115119
}

src/Nethermind/Nethermind.Consensus/Validators/TxValidator.cs

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
using System;
55
using System.Collections.Generic;
6-
using System.Linq;
7-
using CkzgLib;
86
using Nethermind.Consensus.Messages;
97
using Nethermind.Core;
108
using Nethermind.Core.Specs;
@@ -172,7 +170,7 @@ private NonBlobFieldsTxValidator() { }
172170
// Execution-payload version verification
173171
{ MaxFeePerBlobGas: not null } => TxErrorMessages.NotAllowedMaxFeePerBlobGas,
174172
{ BlobVersionedHashes: not null } => TxErrorMessages.NotAllowedBlobVersionedHashes,
175-
{ NetworkWrapper: ShardBlobNetworkWrapper } => TxErrorMessages.InvalidTransaction,
173+
{ NetworkWrapper: ShardBlobNetworkWrapper } => TxErrorMessages.InvalidTransactionForm,
176174
_ => ValidationResult.Success
177175
};
178176
}
@@ -239,45 +237,26 @@ private MempoolBlobTxValidator() { }
239237

240238
public ValidationResult IsWellFormed(Transaction transaction, IReleaseSpec releaseSpec)
241239
{
242-
int blobCount = transaction.BlobVersionedHashes!.Length;
243-
return transaction.NetworkWrapper is not ShardBlobNetworkWrapper wrapper ? ValidationResult.Success
244-
: wrapper.Blobs.Length != blobCount ? TxErrorMessages.InvalidBlobData
245-
: wrapper.Commitments.Length != blobCount ? TxErrorMessages.InvalidBlobData
246-
: wrapper.Proofs.Length != blobCount ? TxErrorMessages.InvalidBlobData
247-
: ValidateBlobs();
240+
return transaction switch
241+
{
242+
{ NetworkWrapper: null } => ValidationResult.Success,
243+
{ Type: TxType.Blob, NetworkWrapper: ShardBlobNetworkWrapper wrapper } => ValidateBlobs(transaction, wrapper, releaseSpec),
244+
{ Type: TxType.Blob } or { NetworkWrapper: not null } => TxErrorMessages.InvalidTransactionForm,
245+
};
248246

249-
ValidationResult ValidateBlobs()
247+
static ValidationResult ValidateBlobs(Transaction transaction, ShardBlobNetworkWrapper wrapper, IReleaseSpec releaseSpec)
250248
{
251-
for (int i = 0; i < blobCount; i++)
249+
if (wrapper.Version != releaseSpec.BlobProofVersion)
252250
{
253-
if (wrapper.Blobs[i].Length != Ckzg.BytesPerBlob)
254-
{
255-
return TxErrorMessages.ExceededBlobSize;
256-
}
257-
258-
if (wrapper.Commitments[i].Length != Ckzg.BytesPerCommitment)
259-
{
260-
return TxErrorMessages.ExceededBlobCommitmentSize;
261-
}
262-
263-
if (wrapper.Proofs[i].Length != Ckzg.BytesPerProof)
264-
{
265-
return TxErrorMessages.InvalidBlobProofSize;
266-
}
251+
return TxErrorMessages.InvalidProofVersion;
267252
}
268253

269-
Span<byte> hash = stackalloc byte[32];
270-
for (int i = 0; i < blobCount; i++)
271-
{
272-
if (!KzgPolynomialCommitments.TryComputeCommitmentHashV1(wrapper.Commitments[i].AsSpan(), hash) || !hash.SequenceEqual(transaction.BlobVersionedHashes[i]))
273-
{
274-
return TxErrorMessages.InvalidBlobCommitmentHash;
275-
}
276-
}
254+
IBlobProofsVerifier proofsManager = IBlobProofsManager.For(wrapper.Version);
277255

278-
return !KzgPolynomialCommitments.AreProofsValid(wrapper.Blobs, wrapper.Commitments, wrapper.Proofs)
279-
? TxErrorMessages.InvalidBlobProof
280-
: ValidationResult.Success;
256+
return !proofsManager.ValidateLengths(wrapper) ? TxErrorMessages.InvalidBlobDataSize :
257+
!proofsManager.ValidateHashes(wrapper, transaction.BlobVersionedHashes) ? TxErrorMessages.InvalidBlobHashes :
258+
!proofsManager.ValidateProofs(wrapper) ? TxErrorMessages.InvalidBlobProofs :
259+
ValidationResult.Success;
281260
}
282261
}
283262
}

0 commit comments

Comments
 (0)