diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/TransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/TransactionEncoder.java index 4a0f1f02257..22e88cae8bb 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/TransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/TransactionEncoder.java @@ -20,6 +20,7 @@ import org.hyperledger.besu.datatypes.TransactionType; import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.Transaction; +import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.ethereum.rlp.RLPOutput; import org.hyperledger.besu.evm.AccessListEntry; @@ -76,9 +77,10 @@ public static Bytes encodeOpaqueBytes(final Transaction transaction) { TYPED_TRANSACTION_ENCODERS.get(transactionType), "Developer Error. A supported transaction type %s has no associated encoding logic", transactionType); - return Bytes.concatenate( - Bytes.of(transactionType.getSerializedType()), - RLP.encode(rlpOutput -> encoder.encode(transaction, rlpOutput))); + final BytesValueRLPOutput out = new BytesValueRLPOutput(); + out.writeByte(transactionType.getSerializedType()); + encoder.encode(transaction, out); + return out.encoded(); } } diff --git a/ethereum/p2p/build.gradle b/ethereum/p2p/build.gradle index ed2f9aa1e0e..dccbe0fb877 100644 --- a/ethereum/p2p/build.gradle +++ b/ethereum/p2p/build.gradle @@ -62,7 +62,13 @@ dependencies { annotationProcessor "org.immutables:value" implementation "org.immutables:value-annotations" - implementation 'tech.pegasys.discovery:discovery' + implementation('tech.pegasys.discovery:discovery') { + // version conflicts, prefer ours + exclude group: 'org.apache.tuweni', module:'tuweni-bytes' + exclude group: 'org.apache.tuweni', module:'tuweni-crypto' + exclude group: 'org.apache.tuweni', module:'tuweni-rlp' + exclude group: 'org.apache.tuweni', module:'tuweni-units' + } // test dependencies. testImplementation project(path: ':ethereum:core', configuration: 'testArtifacts')