Skip to content

Commit b5da17b

Browse files
committed
Merge branch 'zkbesu' into clique-simulate-block-production
2 parents fdb88ec + 1bb7624 commit b5da17b

File tree

103 files changed

+5423
-7602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+5423
-7602
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
### Breaking Changes
66
- `--host-whitelist` has been deprecated since 2020 and this option is removed. Use the equivalent `--host-allowlist` instead.
77
- Changed tracer API to include the mining beneficiary in BlockAwareOperationTracer::traceStartBlock [#8096](https://github.com/hyperledger/besu/pull/8096)
8+
- Change the input defaults on debug_trace* calls to not trace memory by default ("disableMemory": true, "disableStack": false, "disableStorage": false)
9+
- Change the output format of debug_trace* and trace_* calls to match Geth behaviour
810

911
### Upcoming Breaking Changes
1012
- `MetricSystem::createLabelledGauge` is deprecated and will be removed in a future release, replace it with `MetricSystem::createLabelledSuppliedGauge`
@@ -20,7 +22,9 @@
2022
- Retrieve all transaction receipts for a block in one request [#6646](https://github.com/hyperledger/besu/pull/6646)
2123
- Implement EIP-7840: Add blob schedule to config files [#8042](https://github.com/hyperledger/besu/pull/8042)
2224
- Allow gasPrice (legacy) and 1559 gasPrice params to be specified simultaneously for `eth_call`, `eth_createAccessList`, and `eth_estimateGas` [#8059](https://github.com/hyperledger/besu/pull/8059)
25+
- Improve debug_traceBlock calls performance and reduce output size [#8076](https://github.com/hyperledger/besu/pull/8076)
2326
- Add support for EIP-7702 transaction in the txpool [#8018](https://github.com/hyperledger/besu/pull/8018) [#7984](https://github.com/hyperledger/besu/pull/7984)
27+
- Add support for `movePrecompileToAddress` in `StateOverrides` (`eth_call`)[8115](https://github.com/hyperledger/besu/pull/8115)
2428

2529
### Bug fixes
2630
- Fix serialization of state overrides when `movePrecompileToAddress` is present [#8204](https://github.com/hyperledger/besu/pull/8024)

acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/ethereum/CodeDelegationTransactionAcceptanceTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ public void shouldTransferAllEthOfAuthorizerToSponsor() throws IOException {
140140
*/
141141
@Test
142142
public void shouldCheckNonceAfterNonceIncreaseOfSender() throws IOException {
143-
final long GAS_LIMIT = 1000000L;
144-
cluster.verify(authorizer.balanceEquals(Amount.ether(90000)));
143+
final long GAS_LIMIT = 1_000_000L;
144+
cluster.verify(authorizer.balanceEquals(Amount.ether(90_000)));
145145

146146
final CodeDelegation authorization =
147147
org.hyperledger.besu.ethereum.core.CodeDelegation.builder()
@@ -159,7 +159,7 @@ public void shouldCheckNonceAfterNonceIncreaseOfSender() throws IOException {
159159
.type(TransactionType.DELEGATE_CODE)
160160
.chainId(BigInteger.valueOf(20211))
161161
.nonce(0)
162-
.maxPriorityFeePerGas(Wei.of(1000000000))
162+
.maxPriorityFeePerGas(Wei.of(1_000_000_000))
163163
.maxFeePerGas(Wei.fromHexString("0x02540BE400"))
164164
.gasLimit(GAS_LIMIT)
165165
.to(Address.fromHexStringStrict(authorizer.getAddress()))
@@ -209,7 +209,7 @@ public void shouldCheckNonceAfterNonceIncreaseOfSender() throws IOException {
209209
.nonce(2)
210210
.maxPriorityFeePerGas(Wei.of(10))
211211
.maxFeePerGas(Wei.of(100))
212-
.gasLimit(21000)
212+
.gasLimit(21_000)
213213
.to(Address.fromHexStringStrict(otherAccount.getAddress()))
214214
.value(Wei.ONE)
215215
.payload(Bytes.EMPTY)

acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/ethereum/PragueAcceptanceTestHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ public void buildNewBlock() throws IOException {
9898
executionPayload.toString(), parentBeaconBlockRoot, executionRequests.toString()));
9999
try (final Response newPayloadResponse = newPayloadRequest.execute()) {
100100
assertThat(newPayloadResponse.code()).isEqualTo(200);
101+
102+
final String responseStatus =
103+
mapper.readTree(newPayloadResponse.body().string()).get("result").get("status").asText();
104+
assertThat(responseStatus).isEqualTo("VALID");
101105
}
102106

103107
final Call moveChainAheadRequest = createEngineCall(createForkChoiceRequest(newBlockHash));

acceptance-tests/tests/src/test/resources/log4j2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Configuration status="WARN" monitorInterval="30">
2+
<Configuration level="WARN" monitorInterval="30">
33
<Properties>
44
<Property name="root.log.level">INFO</Property>
55
</Properties>

besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright ConsenSys AG.
2+
* Copyright contributors to Besu.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -74,6 +74,7 @@
7474
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
7575
import org.hyperledger.besu.ethereum.core.Synchronizer;
7676
import org.hyperledger.besu.ethereum.eth.manager.EthPeers;
77+
import org.hyperledger.besu.ethereum.eth.manager.EthScheduler;
7778
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
7879
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
7980
import org.hyperledger.besu.ethereum.mainnet.precompiles.privacy.FlexiblePrivacyPrecompiledContract;
@@ -836,7 +837,8 @@ public Runner build() {
836837
besuPluginContext.getNamedPlugins(),
837838
dataDir,
838839
rpcEndpointServiceImpl,
839-
transactionSimulator);
840+
transactionSimulator,
841+
besuController.getProtocolManager().ethContext().getScheduler());
840842

841843
jsonRpcHttpService =
842844
Optional.of(
@@ -882,7 +884,8 @@ public Runner build() {
882884
besuPluginContext.getNamedPlugins(),
883885
dataDir,
884886
rpcEndpointServiceImpl,
885-
transactionSimulator);
887+
transactionSimulator,
888+
besuController.getProtocolManager().ethContext().getScheduler());
886889

887890
final Optional<AuthenticationService> authToUse =
888891
engineJsonRpcConfiguration.get().isAuthenticationEnabled()
@@ -978,7 +981,8 @@ public Runner build() {
978981
besuPluginContext.getNamedPlugins(),
979982
dataDir,
980983
rpcEndpointServiceImpl,
981-
transactionSimulator);
984+
transactionSimulator,
985+
besuController.getProtocolManager().ethContext().getScheduler());
982986

983987
createLogsSubscriptionService(
984988
context.getBlockchain(), subscriptionManager, privacyParameters, blockchainQueries);
@@ -1059,7 +1063,8 @@ public Runner build() {
10591063
besuPluginContext.getNamedPlugins(),
10601064
dataDir,
10611065
rpcEndpointServiceImpl,
1062-
transactionSimulator);
1066+
transactionSimulator,
1067+
besuController.getProtocolManager().ethContext().getScheduler());
10631068

10641069
jsonRpcIpcService =
10651070
Optional.of(
@@ -1099,7 +1104,8 @@ public Runner build() {
10991104
besuPluginContext.getNamedPlugins(),
11001105
dataDir,
11011106
rpcEndpointServiceImpl,
1102-
transactionSimulator);
1107+
transactionSimulator,
1108+
besuController.getProtocolManager().ethContext().getScheduler());
11031109
} else {
11041110
inProcessRpcMethods = Map.of();
11051111
}
@@ -1262,7 +1268,8 @@ private Map<String, JsonRpcMethod> jsonRpcMethods(
12621268
final Map<String, BesuPlugin> namedPlugins,
12631269
final Path dataDir,
12641270
final RpcEndpointServiceImpl rpcEndpointServiceImpl,
1265-
final TransactionSimulator transactionSimulator) {
1271+
final TransactionSimulator transactionSimulator,
1272+
final EthScheduler ethScheduler) {
12661273
// sync vertx for engine consensus API, to process requests in FIFO order;
12671274
final Vertx consensusEngineServer = Vertx.vertx(new VertxOptions().setWorkerPoolSize(1));
12681275

@@ -1300,7 +1307,8 @@ private Map<String, JsonRpcMethod> jsonRpcMethods(
13001307
consensusEngineServer,
13011308
apiConfiguration,
13021309
enodeDnsConfiguration,
1303-
transactionSimulator);
1310+
transactionSimulator,
1311+
ethScheduler);
13041312
methods.putAll(besuController.getAdditionalJsonRpcMethods(jsonRpcApis));
13051313

13061314
final var pluginMethods =

besu/src/main/resources/log4j2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Configuration status="WARN">
2+
<Configuration level="WARN">
33
<Properties>
44
<Property name="root.log.level">${env:LOG_LEVEL:-INFO}</Property>
55
<Property name="root.log.logger">${env:LOGGER:-Console}</Property>

consensus/qbft-core/src/integration-test/resources/log4j2.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Configuration status="WARN">
2+
<Configuration level="WARN">
33
<Properties>
44
<Property name="root.log.level">DEBUG</Property>
55
</Properties>

datatypes/src/main/java/org/hyperledger/besu/datatypes/Hash.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,9 @@ public class Hash extends DelegatingBytes32 {
5252
public static final Hash EMPTY = hash(Bytes.EMPTY);
5353

5454
/**
55-
* Hash of empty requests or "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f"
55+
* Hash of empty requests or "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
5656
*/
57-
public static final Hash EMPTY_REQUESTS_HASH =
58-
Hash.wrap(
59-
sha256(
60-
Bytes.concatenate(
61-
sha256(Bytes.of(RequestType.DEPOSIT.getSerializedType())),
62-
sha256(Bytes.of(RequestType.WITHDRAWAL.getSerializedType())),
63-
sha256(Bytes.of(RequestType.CONSOLIDATION.getSerializedType())))));
57+
public static final Hash EMPTY_REQUESTS_HASH = Hash.wrap(sha256(Bytes.EMPTY));
6458

6559
/**
6660
* Instantiates a new Hash.

datatypes/src/main/java/org/hyperledger/besu/datatypes/StateOverride.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,19 @@ public class StateOverride {
3636
private final Optional<Long> nonce;
3737
private final Optional<String> code;
3838
private final Optional<Map<String, String>> stateDiff;
39+
private final Optional<Address> movePrecompileToAddress;
3940

4041
private StateOverride(
4142
final Optional<Wei> balance,
4243
final Optional<Long> nonce,
4344
final Optional<String> code,
44-
final Optional<Map<String, String>> stateDiff) {
45+
final Optional<Map<String, String>> stateDiff,
46+
final Optional<Address> movePrecompileToAddress) {
4547
this.balance = balance;
4648
this.nonce = nonce;
4749
this.code = code;
4850
this.stateDiff = stateDiff;
51+
this.movePrecompileToAddress = movePrecompileToAddress;
4952
}
5053

5154
/**
@@ -84,13 +87,23 @@ public Optional<Map<String, String>> getStateDiff() {
8487
return stateDiff;
8588
}
8689

90+
/**
91+
* Gets the new address for the pre-compiled contract
92+
*
93+
* @return the new address for the pre-compiled contract if present
94+
*/
95+
public Optional<Address> getMovePrecompileToAddress() {
96+
return movePrecompileToAddress;
97+
}
98+
8799
/** Builder class for Account overrides */
88100
@JsonIgnoreProperties(ignoreUnknown = true)
89101
public static class Builder {
90102
private Optional<Wei> balance = Optional.empty();
91103
private Optional<Long> nonce = Optional.empty();
92104
private Optional<String> code = Optional.empty();
93105
private Optional<Map<String, String>> stateDiff = Optional.empty();
106+
private Optional<Address> movePrecompileToAddress = Optional.empty();
94107

95108
/** Default constructor. */
96109
public Builder() {}
@@ -139,13 +152,24 @@ public Builder withStateDiff(final Map<String, String> stateDiff) {
139152
return this;
140153
}
141154

155+
/**
156+
* Sets the new address for the pre-compiled contract
157+
*
158+
* @param newPrecompileAddress the new address for the pre-compile contract
159+
* @return the builder
160+
*/
161+
public Builder withMovePrecompileToAddress(final Address newPrecompileAddress) {
162+
this.movePrecompileToAddress = Optional.ofNullable(newPrecompileAddress);
163+
return this;
164+
}
165+
142166
/**
143167
* build the account override from the builder
144168
*
145169
* @return account override
146170
*/
147171
public StateOverride build() {
148-
return new StateOverride(balance, nonce, code, stateDiff);
172+
return new StateOverride(balance, nonce, code, stateDiff, movePrecompileToAddress);
149173
}
150174
}
151175

@@ -195,6 +219,8 @@ public String toString() {
195219
+ code
196220
+ ", stateDiff="
197221
+ stateDiff
222+
+ ", movePrecompileToAddress="
223+
+ movePrecompileToAddress
198224
+ '}';
199225
}
200226
}

datatypes/src/test/java/org/hyperledger/besu/datatypes/HashTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public void shouldGetExpectedValueForEmptyHash() {
3131
public void shouldGetExpectedValueForEmptyRequestsHash() {
3232
assertThat(Hash.EMPTY_REQUESTS_HASH)
3333
.isEqualTo(
34-
Hash.fromHexString(
35-
"0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f"));
34+
Hash.fromHexString("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"));
3635
}
3736
}

ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcTestMethodsFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright ConsenSys AG.
2+
* Copyright contributors to Besu.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -51,6 +51,7 @@
5151
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem;
5252
import org.hyperledger.besu.metrics.prometheus.MetricsConfiguration;
5353
import org.hyperledger.besu.nat.NatService;
54+
import org.hyperledger.besu.testutil.DeterministicEthScheduler;
5455

5556
import java.math.BigInteger;
5657
import java.nio.file.Path;
@@ -228,6 +229,7 @@ public Map<String, JsonRpcMethod> methods() {
228229
Vertx.vertx(new VertxOptions().setWorkerPoolSize(1)),
229230
ImmutableApiConfiguration.builder().build(),
230231
Optional.empty(),
231-
transactionSimulator);
232+
transactionSimulator,
233+
new DeterministicEthScheduler());
232234
}
233235
}

ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/AbstractBlockParameterMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright ConsenSys AG.
2+
* Copyright contributors to Besu.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at

0 commit comments

Comments
 (0)