Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,11 @@ public List<KZGProof> getKzgProofs() {
public List<VersionedHash> getVersionedHashes() {
return versionedHashes;
}

public int getByteCount() {
int blobSize = blobs.stream().mapToInt(b -> b.getData().size()).sum();
int commitmentSize = kzgCommitments.stream().mapToInt(c -> c.getData().size()).sum();
int proofSize = kzgProofs.stream().mapToInt(p -> p.getData().size()).sum();
return blobSize + commitmentSize + proofSize;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.hyperledger.besu.datatypes.AccessListEntry;
import org.hyperledger.besu.datatypes.Address;
import org.hyperledger.besu.datatypes.BlobsWithCommitments;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.Transaction;
Expand Down Expand Up @@ -119,8 +120,9 @@ private int computeEIP1559MemorySize() {
}

private int computeBlobMemorySize() {
// ToDo 4844: adapt for blobs
return computeEIP1559MemorySize();
int blobsSize =
transaction.getBlobsWithCommitments().map(BlobsWithCommitments::getByteCount).orElse(0);
return computeEIP1559MemorySize() + blobsSize;
}

private int computePayloadMemorySize() {
Expand Down