Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address import performance issues #5734

Merged
merged 2 commits into from
Aug 2, 2023
Merged
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 @@ -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;
Expand Down Expand Up @@ -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();
}
}

Expand Down
8 changes: 7 additions & 1 deletion ethereum/p2p/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Loading