Skip to content

Commit

Permalink
Update tuweni2.4.2 (hyperledger#5684)
Browse files Browse the repository at this point in the history
* Revert "Revert "Update Tuweni to 2.4.1 (hyperledger#5513)" (hyperledger#5585)"

This reverts commit 6111e1b.

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

* update Tuweni to 2.4.2

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>

---------

Signed-off-by: Antoine Toulme <antoine@lunar-ocean.com>
  • Loading branch information
atoulme authored and davidkngo committed Jul 21, 2023
1 parent 61c779f commit ef0d2ff
Show file tree
Hide file tree
Showing 42 changed files with 513 additions and 98 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- EvmTool now executes the `execution-spec-tests` via the `t8n` and `b11r`. See the [README](ethereum/evmtool/README.md) in EvmTool for more instructions.
- Improve lifecycle management of the transaction pool [#5634](https://github.com/hyperledger/besu/pull/5634)
- Add extension points in AbstractCreateOperation for EVM libraries to react to contract creations [#5656](https://github.com/hyperledger/besu/pull/5656)
- Update to Tuweni 2.4.2. [#5684](https://github.com/hyperledger/besu/pull/5684)

### Bug Fixes
- Use the node's configuration to determine if DNS enode URLs are allowed in calls to `admin_addPeer` and `admin_removePeer` [#5584](https://github.com/hyperledger/besu/pull/5584)
Expand Down
6 changes: 3 additions & 3 deletions acceptance-tests/dsl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ dependencies {
implementation 'io.vertx:vertx-core'
implementation 'junit:junit'
implementation 'io.opentelemetry:opentelemetry-api'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-io'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-io'
implementation 'io.tmio:tuweni-units'
implementation 'org.assertj:assertj-core'
implementation 'org.awaitility:awaitility'
implementation 'org.java-websocket:Java-WebSocket'
Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dependencies {
testImplementation 'junit:junit'
testImplementation 'org.apache.commons:commons-compress'
testImplementation 'org.apache.logging.log4j:log4j-core'
testImplementation 'org.apache.tuweni:tuweni-crypto'
testImplementation 'io.tmio:tuweni-crypto'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
Expand Down
12 changes: 6 additions & 6 deletions besu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ dependencies {
implementation 'io.vertx:vertx-web'
implementation 'org.apache.commons:commons-lang3'
implementation 'org.apache.logging.log4j:log4j-core'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-config'
implementation 'org.apache.tuweni:tuweni-toml'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-config'
implementation 'io.tmio:tuweni-toml'
implementation 'io.tmio:tuweni-units'
implementation 'org.springframework.security:spring-security-crypto'
implementation 'org.xerial.snappy:snappy-java'
implementation 'tech.pegasys:jc-kzg-4844'
Expand All @@ -92,8 +92,8 @@ dependencies {
testImplementation 'io.opentelemetry:opentelemetry-api'
testImplementation 'junit:junit'
testImplementation 'org.apache.commons:commons-text'
testImplementation 'org.apache.tuweni:tuweni-bytes'
testImplementation 'org.apache.tuweni:tuweni-units'
testImplementation 'io.tmio:tuweni-bytes'
testImplementation 'io.tmio:tuweni-units'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.awaitility:awaitility'
testImplementation 'org.junit.jupiter:junit-jupiter'
Expand Down
4 changes: 2 additions & 2 deletions config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.google.guava:guava'
implementation 'info.picocli:picocli'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'

testImplementation project(':testutil')

Expand Down
4 changes: 2 additions & 2 deletions consensus/clique/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ dependencies {
implementation 'com.google.guava:guava'
implementation 'io.vertx:vertx-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'

testImplementation project(path: ':consensus:common', configuration: 'testArtifacts')
testImplementation project(path: ':crypto:services', configuration: 'testSupportArtifacts')
Expand Down
2 changes: 1 addition & 1 deletion consensus/common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {

implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.google.guava:guava'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'io.tmio:tuweni-bytes'

testImplementation project(':config')
testImplementation project(':crypto:algorithms')
Expand Down
4 changes: 2 additions & 2 deletions consensus/ibft/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ dependencies {
implementation 'com.google.guava:guava'
implementation 'io.vertx:vertx-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'

integrationTestImplementation project(path: ':config', configuration: 'testSupportArtifacts')
integrationTestImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts')
Expand Down
4 changes: 2 additions & 2 deletions consensus/merge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.google.guava:guava'
implementation 'io.vertx:vertx-core'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'

testImplementation project(path: ':consensus:common', configuration: 'testArtifacts')
testImplementation project(':crypto:algorithms')
Expand Down
4 changes: 2 additions & 2 deletions consensus/qbft/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ dependencies {
implementation 'com.google.guava:guava'
implementation 'io.vertx:vertx-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'
implementation 'org.web3j:abi'

integrationTestImplementation project(path: ':config', configuration: 'testSupportArtifacts')
Expand Down
4 changes: 2 additions & 2 deletions crypto/algorithms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ dependencies {
api 'org.slf4j:slf4j-api'

implementation 'net.java.dev.jna:jna'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'
implementation 'org.hyperledger.besu:secp256k1'
implementation 'org.hyperledger.besu:secp256r1'
implementation 'org.hyperledger.besu:blake2bf'
Expand Down
4 changes: 2 additions & 2 deletions datatypes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ dependencies {
implementation project(':crypto:algorithms')
implementation project(':ethereum:rlp')
implementation 'com.google.guava:guava'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'

testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
Expand Down
2 changes: 1 addition & 1 deletion enclave/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
implementation 'com.google.guava:guava'
implementation 'io.vertx:vertx-core'
implementation 'io.vertx:vertx-web'
implementation 'org.apache.tuweni:tuweni-net'
implementation 'io.tmio:tuweni-net'

runtimeOnly('org.bouncycastle:bcpkix-jdk18on')

Expand Down
8 changes: 4 additions & 4 deletions ethereum/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ dependencies {
implementation 'io.vertx:vertx-web'
implementation 'io.vertx:vertx-codegen'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-net'
implementation 'org.apache.tuweni:tuweni-toml'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-net'
implementation 'io.tmio:tuweni-toml'
implementation 'io.tmio:tuweni-units'
implementation 'org.antlr:antlr4-runtime'
implementation 'org.bouncycastle:bcprov-jdk18on'
implementation 'org.springframework.security:spring-security-crypto'
Expand Down
4 changes: 2 additions & 2 deletions ethereum/blockcreation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ dependencies {

implementation 'com.google.guava:guava'
implementation 'io.vertx:vertx-core'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'

testImplementation project(path: ':config', configuration: 'testSupportArtifacts')
testImplementation project(path: ':ethereum:core', configuration: 'testArtifacts')
Expand Down
14 changes: 7 additions & 7 deletions ethereum/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ dependencies {

implementation 'net.java.dev.jna:jna'
implementation 'org.apache.commons:commons-lang3'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-concurrent'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'org.apache.tuweni:tuweni-rlp'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-concurrent'
implementation 'io.tmio:tuweni-units'
implementation 'io.tmio:tuweni-rlp'
implementation 'org.hyperledger.besu:bls12-381'
implementation 'org.immutables:value-annotations'

Expand All @@ -78,9 +78,9 @@ dependencies {

testImplementation 'junit:junit'
testImplementation 'org.apache.logging.log4j:log4j-core'
testImplementation 'org.apache.tuweni:tuweni-bytes'
testImplementation 'org.apache.tuweni:tuweni-io'
testImplementation 'org.apache.tuweni:tuweni-units'
testImplementation 'io.tmio:tuweni-bytes'
testImplementation 'io.tmio:tuweni-io'
testImplementation 'io.tmio:tuweni-units'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public class TransactionTestFixture {
private static final Hash DEFAULT_VERSIONED_HASH =
Hash.wrap(
Bytes32.wrap(
Bytes.concatenate(Bytes.fromHexString("0x01"), Bytes.repeat((byte) 42, 31))));
Bytes.concatenate(
Bytes.fromHexString("0x01"), Bytes.fromHexString("2a".repeat(31)))));

private TransactionType transactionType = TransactionType.FRONTIER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class WithdrawalEncoderTest {
"0xd8808094000000000000000000000000000000000000000080";
public static final String WITHDRAWAL_MAX_VALUE =
"0xf088ffffffffffffffff88ffffffffffffffff94ffffffffffffffffffffffffffffffffffffffff88ffffffffffffffff";
public static final Address MAX_ADDRESS =
Address.fromHexString(Bytes.repeat((byte) 0xff, 20).toHexString());
public static final Address MAX_ADDRESS = Address.fromHexString("ff".repeat(20));

@Test
void shouldEncodeWithdrawalForZeroCase() {
Expand Down
6 changes: 3 additions & 3 deletions ethereum/eth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ dependencies {
implementation 'com.google.guava:guava'
implementation 'io.vertx:vertx-core'
implementation 'org.apache.commons:commons-lang3'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'org.apache.tuweni:tuweni-rlp'
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-units'
implementation 'io.tmio:tuweni-rlp'

annotationProcessor "org.immutables:value"
implementation "org.immutables:value-annotations"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public final class RangeManagerTest {
@Test
public void testRemainingRangesEqualToOneWhenFirstRangeContainsMoreThanHalf() {
TreeMap<Bytes32, Bytes> items = new TreeMap<>();
items.put(Bytes32.repeat((byte) 0xbb), Bytes.wrap(new byte[] {0x03}));
items.put(Bytes32.fromHexString("bb".repeat(32)), Bytes.wrap(new byte[] {0x03}));
int nbRanges =
RangeManager.getRangeCount(RangeManager.MIN_RANGE, RangeManager.MAX_RANGE, items);
assertThat(nbRanges).isEqualTo(1);
Expand All @@ -50,7 +50,7 @@ public void testRemainingRangesEqualToOneWhenFirstRangeContainsMoreThanHalf() {
@Test
public void testRemainingRangesEqualToOneWhenFirstRangeContainsLessThanHalf() {
TreeMap<Bytes32, Bytes> items = new TreeMap<>();
items.put(Bytes32.repeat((byte) 0x77), Bytes.wrap(new byte[] {0x03}));
items.put(Bytes32.fromHexString("77".repeat(32)), Bytes.wrap(new byte[] {0x03}));
int nbRanges =
RangeManager.getRangeCount(RangeManager.MIN_RANGE, RangeManager.MAX_RANGE, items);
assertThat(nbRanges).isEqualTo(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected TransactionTestFixture prepareTransaction(
.nonce(nonce)
.type(type);
if (payloadSize > 0) {
var payloadBytes = Bytes.repeat((byte) 1, payloadSize);
var payloadBytes = Bytes.fromHexString("01".repeat(payloadSize));
tx.payload(payloadBytes);
}
if (type.supports1559FeeMarket()) {
Expand Down
2 changes: 1 addition & 1 deletion ethereum/ethstats/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
implementation 'com.google.guava:guava'
implementation 'com.squareup.okhttp3:okhttp'
implementation 'io.vertx:vertx-core'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'io.tmio:tuweni-bytes'

implementation project(':consensus:clique')
implementation project(':config')
Expand Down
2 changes: 1 addition & 1 deletion ethereum/mock-p2p/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
implementation project(':util')

implementation 'io.vertx:vertx-core'
implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'io.tmio:tuweni-bytes'

testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
Expand Down
14 changes: 7 additions & 7 deletions ethereum/p2p/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ dependencies {
implementation 'io.prometheus:simpleclient'
implementation 'io.vertx:vertx-core'

implementation 'org.apache.tuweni:tuweni-bytes'
implementation 'org.apache.tuweni:tuweni-crypto'
implementation('org.apache.tuweni:tuweni-devp2p') {
implementation 'io.tmio:tuweni-bytes'
implementation 'io.tmio:tuweni-crypto'
implementation('io.tmio:tuweni-devp2p') {
exclude group:'ch.qos.logback', module:'logback-classic'
}
implementation('org.apache.tuweni:tuweni-dns-discovery'){
implementation('io.tmio:tuweni-dns-discovery'){
exclude group:'ch.qos.logback', module:'logback-classic'
}
implementation 'org.apache.tuweni:tuweni-io'
implementation 'org.apache.tuweni:tuweni-rlp'
implementation 'org.apache.tuweni:tuweni-units'
implementation 'io.tmio:tuweni-io'
implementation 'io.tmio:tuweni-rlp'
implementation 'io.tmio:tuweni-units'
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
implementation 'org.owasp.encoder:encoder'
implementation 'org.xerial.snappy:snappy-java'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public class DefaultP2PNetwork implements P2PNetwork {
private final AtomicBoolean stopped = new AtomicBoolean(false);
private final CountDownLatch shutdownLatch = new CountDownLatch(2);
private final Duration shutdownTimeout = Duration.ofSeconds(15);
private final Vertx vertx;
private DNSDaemon dnsDaemon;

/**
Expand All @@ -163,6 +164,7 @@ public class DefaultP2PNetwork implements P2PNetwork {
* @param maintainedPeers A collection of peers for which we are expected to maintain connections
* @param reputationManager An object that inspect disconnections for misbehaving peers that can
* then be blacklisted.
* @param vertx the Vert.x instance managing network resources
*/
DefaultP2PNetwork(
final MutableLocalNode localNode,
Expand All @@ -173,7 +175,8 @@ public class DefaultP2PNetwork implements P2PNetwork {
final PeerPermissions peerPermissions,
final NatService natService,
final MaintainedPeers maintainedPeers,
final PeerDenylistManager reputationManager) {
final PeerDenylistManager reputationManager,
final Vertx vertx) {
this.localNode = localNode;
this.peerDiscoveryAgent = peerDiscoveryAgent;
this.rlpxAgent = rlpxAgent;
Expand All @@ -183,6 +186,7 @@ public class DefaultP2PNetwork implements P2PNetwork {

this.nodeId = nodeKey.getPublicKey().getEncodedBytes();
this.peerPermissions = peerPermissions;
this.vertx = vertx;

// set the requirement here that the number of peers be greater than the lower bound
final int peerLowerBound = rlpxAgent.getPeerLowerBound();
Expand Down Expand Up @@ -229,7 +233,8 @@ public void start() {
createDaemonListener(),
0L,
600000L,
config.getDnsDiscoveryServerOverride().orElse(null));
config.getDnsDiscoveryServerOverride().orElse(null),
vertx);
dnsDaemon.start();
});

Expand Down Expand Up @@ -535,7 +540,8 @@ private P2PNetwork doBuild() {
peerPermissions,
natService,
maintainedPeers,
reputationManager);
reputationManager,
vertx);
}

private void validate() {
Expand Down
Loading

0 comments on commit ef0d2ff

Please sign in to comment.