Skip to content

Commit

Permalink
Skip prewarming tx if main processing has caught up (#7143)
Browse files Browse the repository at this point in the history
  • Loading branch information
flcl42 committed Jun 10, 2024
1 parent 89d9ce4 commit 89efed6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Nethermind/Nethermind.Crypto/KzgPolynomialCommitments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ public static bool VerifyProof(ReadOnlySpan<byte> commitment, ReadOnlySpan<byte>

public static bool AreProofsValid(byte[][] blobs, byte[][] commitments, byte[][] proofs)
{
if (blobs.Length is 1 && commitments.Length is 1 && proofs.Length is 1)
{
try
{
return Ckzg.Ckzg.VerifyBlobKzgProof(blobs[0], commitments[0], proofs[0], _ckzgSetup);
}
catch (Exception e) when (e is ArgumentException or ApplicationException or InsufficientMemoryException)
{
return false;
}
}

var length = blobs.Length * Ckzg.Ckzg.BytesPerBlob;
byte[] flatBlobsArray = ArrayPool<byte>.Shared.Rent(length);
var flatBlobs = new Span<byte>(flatBlobsArray, 0, length);
Expand Down

0 comments on commit 89efed6

Please sign in to comment.