Skip to content

Commit f16d352

Browse files
authored
Change execution requests to use flat encoding (#7771)
Signed-off-by: Jason Frame <[email protected]>
1 parent 516559f commit f16d352

File tree

152 files changed

+1094
-5067
lines changed

Some content is hidden

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

152 files changed

+1094
-5067
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
import java.io.IOException;
2323
import java.util.Optional;
2424

25+
import com.fasterxml.jackson.databind.JsonNode;
2526
import com.fasterxml.jackson.databind.ObjectMapper;
27+
import com.fasterxml.jackson.databind.node.ArrayNode;
2628
import com.fasterxml.jackson.databind.node.ObjectNode;
2729
import okhttp3.Call;
2830
import okhttp3.MediaType;
@@ -74,17 +76,15 @@ public void buildNewBlock() throws IOException {
7476
final Call getPayloadRequest = createEngineCall(createGetPayloadRequest(payloadId));
7577

7678
final ObjectNode executionPayload;
79+
final ArrayNode executionRequests;
7780
final String newBlockHash;
7881
final String parentBeaconBlockRoot;
7982
try (final Response getPayloadResponse = getPayloadRequest.execute()) {
8083
assertThat(getPayloadResponse.code()).isEqualTo(200);
8184

82-
executionPayload =
83-
(ObjectNode)
84-
mapper
85-
.readTree(getPayloadResponse.body().string())
86-
.get("result")
87-
.get("executionPayload");
85+
JsonNode result = mapper.readTree(getPayloadResponse.body().string()).get("result");
86+
executionPayload = (ObjectNode) result.get("executionPayload");
87+
executionRequests = (ArrayNode) result.get("executionRequests");
8888

8989
newBlockHash = executionPayload.get("blockHash").asText();
9090
parentBeaconBlockRoot = executionPayload.remove("parentBeaconBlockRoot").asText();
@@ -94,7 +94,8 @@ public void buildNewBlock() throws IOException {
9494

9595
final Call newPayloadRequest =
9696
createEngineCall(
97-
createNewPayloadRequest(executionPayload.toString(), parentBeaconBlockRoot));
97+
createNewPayloadRequest(
98+
executionPayload.toString(), parentBeaconBlockRoot, executionRequests.toString()));
9899
try (final Response newPayloadResponse = newPayloadRequest.execute()) {
99100
assertThat(newPayloadResponse.code()).isEqualTo(200);
100101
}
@@ -168,7 +169,9 @@ private String createGetPayloadRequest(final String payloadId) {
168169
}
169170

170171
private String createNewPayloadRequest(
171-
final String executionPayload, final String parentBeaconBlockRoot) {
172+
final String executionPayload,
173+
final String parentBeaconBlockRoot,
174+
final String executionRequests) {
172175
return "{"
173176
+ " \"jsonrpc\": \"2.0\","
174177
+ " \"method\": \"engine_newPayloadV4\","
@@ -178,6 +181,8 @@ private String createNewPayloadRequest(
178181
+ "\""
179182
+ parentBeaconBlockRoot
180183
+ "\""
184+
+ ","
185+
+ executionRequests
181186
+ "],"
182187
+ " \"id\": 67"
183188
+ "}";

acceptance-tests/tests/src/test/resources/dev/dev_prague.json

Lines changed: 7 additions & 5 deletions
Large diffs are not rendered by default.

acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json

Lines changed: 14 additions & 9 deletions
Large diffs are not rendered by default.

acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/00_get_genesis_block_info.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"id": 67,
1313
"result": {
1414
"number": "0x0",
15-
"hash" : "0x38d7daa68e8bac41a0a237b7cbfcef480cb9bd9adc7b282d7b0d23ff4eb8d6e5",
15+
"hash" : "0x01f5cbf33268c161f1526d704268db760bf82c9772a8f8ca412e0c6ce5684896",
1616
"mixHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
1717
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
1818
"nonce" : "0x0000000000000042",
1919
"sha3Uncles" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
2020
"logsBloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
2121
"transactionsRoot" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
22-
"stateRoot" : "0x3ed8435adb5f3526144e6babdd3fc8c661a86097cf7e743441b41fda096fc4dd",
22+
"stateRoot" : "0x860be6ab5a8fc2003c3739bfe2cdbcd9dbb273c8ea42951b832a8e1f22fb3a60",
2323
"receiptsRoot" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
2424
"miner" : "0x0000000000000000000000000000000000000000",
2525
"difficulty" : "0x400000000",

acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"method": "engine_forkchoiceUpdatedV3",
55
"params": [
66
{
7-
"headBlockHash": "0x38d7daa68e8bac41a0a237b7cbfcef480cb9bd9adc7b282d7b0d23ff4eb8d6e5",
8-
"safeBlockHash": "0x38d7daa68e8bac41a0a237b7cbfcef480cb9bd9adc7b282d7b0d23ff4eb8d6e5",
7+
"headBlockHash": "0x01f5cbf33268c161f1526d704268db760bf82c9772a8f8ca412e0c6ce5684896",
8+
"safeBlockHash": "0x01f5cbf33268c161f1526d704268db760bf82c9772a8f8ca412e0c6ce5684896",
99
"finalizedBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
1010
},
1111
{
@@ -24,10 +24,10 @@
2424
"result": {
2525
"payloadStatus": {
2626
"status": "VALID",
27-
"latestValidHash": "0x38d7daa68e8bac41a0a237b7cbfcef480cb9bd9adc7b282d7b0d23ff4eb8d6e5",
27+
"latestValidHash": "0x01f5cbf33268c161f1526d704268db760bf82c9772a8f8ca412e0c6ce5684896",
2828
"validationError": null
2929
},
30-
"payloadId": "0x28264396eca1deef"
30+
"payloadId": "0x282643b677b85211"
3131
}
3232
},
3333
"statusCode": 200

acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"jsonrpc": "2.0",
44
"method": "engine_getPayloadV3",
55
"params": [
6-
"0x28264396eca1deef"
6+
"0x282643b677b85211"
77
],
88
"id": 67
99
},
@@ -12,9 +12,9 @@
1212
"id": 67,
1313
"result": {
1414
"executionPayload": {
15-
"parentHash": "0x38d7daa68e8bac41a0a237b7cbfcef480cb9bd9adc7b282d7b0d23ff4eb8d6e5",
15+
"parentHash": "0x01f5cbf33268c161f1526d704268db760bf82c9772a8f8ca412e0c6ce5684896",
1616
"feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
17-
"stateRoot": "0x3ed8435adb5f3526144e6babdd3fc8c661a86097cf7e743441b41fda096fc4dd",
17+
"stateRoot": "0x860be6ab5a8fc2003c3739bfe2cdbcd9dbb273c8ea42951b832a8e1f22fb3a60",
1818
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
1919
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
2020
"gasLimit": "0x1c9c380",
@@ -29,7 +29,7 @@
2929
"blockNumber": "0x1",
3030
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
3131
"blobGasUsed": "0x0",
32-
"blockHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593"
32+
"blockHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e"
3333
},
3434
"blockValue": "0x0",
3535
"blobsBundle": {

acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
"method": "engine_newPayloadV3",
55
"params": [
66
{
7-
"parentHash": "0x38d7daa68e8bac41a0a237b7cbfcef480cb9bd9adc7b282d7b0d23ff4eb8d6e5",
7+
"parentHash": "0x01f5cbf33268c161f1526d704268db760bf82c9772a8f8ca412e0c6ce5684896",
88
"feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
9-
"stateRoot": "0x3ed8435adb5f3526144e6babdd3fc8c661a86097cf7e743441b41fda096fc4dd",
9+
"stateRoot": "0x860be6ab5a8fc2003c3739bfe2cdbcd9dbb273c8ea42951b832a8e1f22fb3a60",
1010
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
1111
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
1212
"gasLimit": "0x1c9c380",
1313
"gasUsed": "0x0",
1414
"timestamp": "0x10",
1515
"extraData": "0x",
1616
"baseFeePerGas": "0x7",
17+
"excessBlobGas": "0x0",
1718
"transactions": [],
1819
"withdrawals": [],
1920
"blockNumber": "0x1",
20-
"blockHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
21-
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
22-
"excessBlobGas": "0x0",
23-
"blobGasUsed": "0x0"
21+
"blobGasUsed": "0x0",
22+
"blockHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
23+
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
2424
},
2525
[],
2626
"0x0000000000000000000000000000000000000000000000000000000000000000"
@@ -32,7 +32,7 @@
3232
"id": 67,
3333
"result": {
3434
"status": "VALID",
35-
"latestValidHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
35+
"latestValidHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
3636
"validationError": null
3737
}
3838
},

acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"method": "engine_forkchoiceUpdatedV3",
55
"params": [
66
{
7-
"headBlockHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
8-
"safeBlockHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
9-
"finalizedBlockHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593"
7+
"headBlockHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
8+
"safeBlockHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
9+
"finalizedBlockHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e"
1010
},
1111
null
1212
],
@@ -18,7 +18,7 @@
1818
"result": {
1919
"payloadStatus": {
2020
"status": "VALID",
21-
"latestValidHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
21+
"latestValidHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
2222
"validationError": null
2323
},
2424
"payloadId": null

acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"method": "engine_forkchoiceUpdatedV3",
55
"params": [
66
{
7-
"headBlockHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
8-
"safeBlockHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
9-
"finalizedBlockHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593"
7+
"headBlockHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
8+
"safeBlockHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
9+
"finalizedBlockHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e"
1010
},
1111
{
1212
"timestamp": "0x20",
@@ -24,10 +24,10 @@
2424
"result": {
2525
"payloadStatus": {
2626
"status": "VALID",
27-
"latestValidHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
27+
"latestValidHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
2828
"validationError": null
2929
},
30-
"payloadId": "0x282643d3a905e721"
30+
"payloadId": "0x282643fdcbcb1ddf"
3131
}
3232
},
3333
"statusCode": 200

acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"jsonrpc": "2.0",
44
"method": "engine_getPayloadV4",
55
"params": [
6-
"0x282643d3a905e721"
6+
"0x282643fdcbcb1ddf"
77
],
88
"id": 67
99
},
@@ -12,9 +12,9 @@
1212
"id": 67,
1313
"result": {
1414
"executionPayload": {
15-
"parentHash": "0x8082deff44f79489ea92415be59afb48b6f46b939553f855479828a6f87f9593",
15+
"parentHash": "0x7cccf6d9ce3e5acaeac9058959c27ace53af3a30b15763e1703bab2d0ae9438e",
1616
"feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
17-
"stateRoot": "0x2e59916a57b535875bcd80d8472aeaa0027aa685d159804e8caa2f12d060155e",
17+
"stateRoot": "0xed4093bcd157ba955245906a1cda7695d3b3f233af709f0adf17689abb4d93b4",
1818
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
1919
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
2020
"gasLimit": "0x1c9c380",
@@ -23,30 +23,26 @@
2323
"extraData": "0x",
2424
"baseFeePerGas": "0x7",
2525
"excessBlobGas": "0x0",
26+
"blobGasUsed": "0x0",
2627
"parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
2728
"transactions": [],
2829
"withdrawals": [],
29-
"depositRequests": [],
30-
"withdrawalRequests": [
31-
{
32-
"sourceAddress": "0xa4664c40aacebd82a2db79f0ea36c06bc6a19adb",
33-
"validatorPubkey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e",
34-
"amount": "0x0"
35-
}
36-
],
37-
"consolidationRequests" : [],
3830
"blockNumber": "0x2",
39-
"blockHash": "0x27a2bc2ac21b3fc796f636bec1ec9cba100435f9a793176a83a5d4fa7cc13006",
4031
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
41-
"blobGasUsed": "0x0"
32+
"blockHash": "0x303fb51567c090ed3fb7ac50a082ae3a0bcb8ff522d071011a1ca433561a4569"
4233
},
4334
"blockValue": "0x0",
4435
"blobsBundle": {
4536
"commitments": [],
4637
"proofs": [],
4738
"blobs": []
4839
},
49-
"shouldOverrideBuilder": false
40+
"shouldOverrideBuilder": false,
41+
"executionRequests": [
42+
"0x",
43+
"0xa4664c40aacebd82a2db79f0ea36c06bc6a19adbb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e0000000000000000",
44+
"0x"
45+
]
5046
}
5147
},
5248
"statusCode": 200

0 commit comments

Comments
 (0)