From b6788936ef21816be61af11a7791b3251f447f5e Mon Sep 17 00:00:00 2001 From: Gabriel-Trintinalia Date: Mon, 4 Sep 2023 10:27:43 +1000 Subject: [PATCH] Add javadoc Signed-off-by: Gabriel-Trintinalia --- .../encoding/BlobPooledTransactionDecoder.java | 13 +++++++++++++ .../core/encoding/BlobTransactionDecoder.java | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionDecoder.java index ea6f1e7c9f5..2bcf30e3ed5 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobPooledTransactionDecoder.java @@ -22,7 +22,20 @@ import java.util.List; +/** + * Class responsible for decoding blob transactions from the transaction pool. Blob transactions + * have two network representations. During transaction gossip responses (PooledTransactions), the + * EIP-2718 TransactionPayload of the blob transaction is wrapped to become: rlp([tx_payload_body, + * blobs, commitments, proofs]). + */ public class BlobPooledTransactionDecoder { + + /** + * Decodes a blob transaction from the provided RLP input. + * + * @param input the RLP input to decode + * @return the decoded transaction + */ public static Transaction decode(final RLPInput input) { input.enterList(); final Transaction.Builder builder = Transaction.builder(); diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionDecoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionDecoder.java index cd6aa444b3b..0b3673c0b49 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionDecoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/BlobTransactionDecoder.java @@ -32,9 +32,11 @@ public class BlobTransactionDecoder { private static final Supplier SIGNATURE_ALGORITHM = Suppliers.memoize(SignatureAlgorithmFactory::getInstance); - /* - * [chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, to, value, data, - * access_list, max_fee_per_blob_gas, blob_versioned_hashes, y_parity, r, s] + /** + * Decodes a blob transaction from the provided RLP input. + * + * @param input the RLP input to decode + * @return the decoded transaction */ public static Transaction decode(final RLPInput input) { Transaction transaction; @@ -50,6 +52,15 @@ private static Transaction readTransactionPayload(final RLPInput input) { return builder.build(); } + /** + * Reads the payload of a blob transaction from the provided RLP input. + * + *

[chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, to, value, data, + * access_list, max_fee_per_blob_gas, blob_versioned_hashes, y_parity, r, s] + * + * @param builder the transaction builder + * @param input the RLP input to read from + */ static void readTransactionPayloadInner(final Transaction.Builder builder, final RLPInput input) { builder .type(TransactionType.BLOB)