diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/BlockUtils.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/BlockUtils.java index 29f60dd74a6..3a4ca71002b 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/BlockUtils.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/BlockUtils.java @@ -58,7 +58,6 @@ public static BlockHeader createBlockHeader( null, null, null, - null, blockHeaderFunctions); } } diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json index 8c6a3d41d5a..3f2645d4d3a 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json @@ -36,7 +36,7 @@ "comment": "This is the account used to sign the transaction that creates a validator exit", "balance": "1000000000000000000000000000" }, - "0xEd8EA01d70Cb49726175BCf2778B9C982912e017": { + "0x00A3ca265EBcb825B45F985A16CEFB49958cE017": { "comment": "This is the runtime bytecode for the Withdrawal Request Smart Contract. It was created from the deployment transaction in EIP-7002 (https://eips.ethereum.org/EIPS/eip-7002#deployment)", "balance": "0", "code": "0x3373fffffffffffffffffffffffffffffffffffffffe146090573615156028575f545f5260205ff35b36603814156101215760115f54600182026001905f5b5f82111560595781019083028483029004916001019190603e565b90939004341061012157600154600101600155600354806003026004013381556001015f3581556001016020359055600101600355005b6003546002548082038060101160a4575060105b5f5b81811460dd5780604c02838201600302600401805490600101805490600101549160601b83528260140152906034015260010160a6565b910180921460ed579060025560f8565b90505f6002555f6003555b5f5460015460028282011161010f5750505f610115565b01600290035b5f555f600155604c025ff35b5f5ffd", diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json index e810b1cad33..21a2e70a48d 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json @@ -4,8 +4,8 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", - "safeBlockHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", + "headBlockHash": "0x3ca89f1d6b71aeb56389ac8270e9ae369d0bb8edeea747f2d868a5eb31892b04", + "safeBlockHash": "0x3ca89f1d6b71aeb56389ac8270e9ae369d0bb8edeea747f2d868a5eb31892b04", "finalizedBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", + "latestValidHash": "0x3ca89f1d6b71aeb56389ac8270e9ae369d0bb8edeea747f2d868a5eb31892b04", "validationError": null }, - "payloadId": "0x282643efdc841a11" + "payloadId": "0x282643d318bdab11" } }, "statusCode": 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json index 8c7d4177c45..0c9281fc6a5 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV3", "params": [ - "0x282643efdc841a11" + "0x282643d318bdab11" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", + "parentHash": "0x3ca89f1d6b71aeb56389ac8270e9ae369d0bb8edeea747f2d868a5eb31892b04", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xf4e9cba3bdb0cf3aa214612d87f2a1ab18cdc604a0af18f71110754a85de5d15", + "stateRoot": "0x2b6a1166ce24fe0af741c7313e6049e9e19351742bfaf4179154bc594ca9eb90", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -29,7 +29,7 @@ "blockNumber": "0x1", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", - "blockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a" + "blockHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950" }, "blockValue": "0x0", "blobsBundle": { diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json index 3145cd5439f..583bdc1a20e 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json @@ -4,9 +4,9 @@ "method": "engine_newPayloadV3", "params": [ { - "parentHash": "0x292042b10484fc182be8aba2a4c1863f6712cc7f0c74489c226792138134248f", + "parentHash": "0x3ca89f1d6b71aeb56389ac8270e9ae369d0bb8edeea747f2d868a5eb31892b04", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xf4e9cba3bdb0cf3aa214612d87f2a1ab18cdc604a0af18f71110754a85de5d15", + "stateRoot": "0x2b6a1166ce24fe0af741c7313e6049e9e19351742bfaf4179154bc594ca9eb90", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -17,7 +17,7 @@ "transactions": [], "withdrawals": [], "blockNumber": "0x1", - "blockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "blockHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "excessBlobGas": "0x0", "blobGasUsed": "0x0" @@ -32,7 +32,7 @@ "id": 67, "result": { "status": "VALID", - "latestValidHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "latestValidHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", "validationError": null } }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json index b578116448d..229ca2cf51c 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", - "safeBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", - "finalizedBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a" + "headBlockHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", + "safeBlockHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", + "finalizedBlockHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950" }, null ], @@ -18,7 +18,7 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "latestValidHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", "validationError": null }, "payloadId": null diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json index 3e7d4b38595..721a625b6ab 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", - "safeBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", - "finalizedBlockHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a" + "headBlockHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", + "safeBlockHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", + "finalizedBlockHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950" }, { "timestamp": "0x20", @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "latestValidHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", "validationError": null }, - "payloadId": "0x282643882dfdc121" + "payloadId": "0x282643c6d89e12df" } }, "statusCode": 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json index b8c8f0818a2..4d754df1ce9 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV4", "params": [ - "0x282643882dfdc121" + "0x282643c6d89e12df" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "parentHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xc809e88f0456bc45340fa03cedd1c1d658c1b947a7f23e6a17ed108af60d3afc", + "stateRoot": "0x3057566307e82861160cd217c71c18a93023a752d268113a4e50148fe6f19be6", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -26,7 +26,7 @@ "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "transactions": [], "withdrawals": [], - "depositReceipts": [], + "depositRequests": [], "withdrawalRequests": [ { "sourceAddress": "0xa4664c40aacebd82a2db79f0ea36c06bc6a19adb", @@ -35,7 +35,7 @@ } ], "blockNumber": "0x2", - "blockHash": "0x41d9ad8707752c4e6c46eecc956e79fc1fafc44fc0cc5fd7a5b981b02e216932", + "blockHash": "0xdce2f62925b5ebb218943e71fa87af2aaeb6dab2d8aee12ea7f9f24eeae7b4c7", "blobGasUsed": "0x0", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/08_prague_invalid_null_deposits_execute_payload.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/08_prague_invalid_null_deposits_execute_payload.json index 0294c6b8f21..3eeccb01b5d 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/08_prague_invalid_null_deposits_execute_payload.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/08_prague_invalid_null_deposits_execute_payload.json @@ -17,7 +17,7 @@ "excessBlobGas": "0x0", "transactions": [], "withdrawals": [], - "depositReceipts" : null, + "depositRequests" : null, "blockNumber": "0x2", "blockHash": "0xf6c3f1180ba58d6ea4c69c9328c7afb1fda41df06c368741c1f8310567879de7", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json index 2a57e04ea7a..1c5c0c3b907 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json @@ -4,9 +4,9 @@ "method": "engine_newPayloadV4", "params": [ { - "parentHash": "0x2b0ef8ec0a5f8b3bd5e64cde3f1ed7f61c472b79bea9e44598921c3c37890a6a", + "parentHash": "0x74e8ce9d96d325a605675a34175adfa34581f35091dcd7b107c525a82b0b9950", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xb25de115723e262bb1d5da7e3576dea47c3fe7e8ca52c430e6f9def712de830d", + "stateRoot": "0x778ccbc3adc59876b76489cdc1a2ff76ef2a31ae9d3bf761bc55bbab7d59c489", "logsBloom": "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -19,7 +19,7 @@ "0x02f9021c8217de808459682f008459682f0e830271009442424242424242424242424242424242424242428901bc16d674ec800000b901a422895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120749715de5d1226545c6b3790f515d551a5cc5bf1d49c87a696860554d2fc4f14000000000000000000000000000000000000000000000000000000000000003096a96086cff07df17668f35f7418ef8798079167e3f4f9b72ecde17b28226137cf454ab1dd20ef5d924786ab3483c2f9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef20000000000000000000000000000000000000000000000000000000000000060b1acdb2c4d3df3f1b8d3bfd33421660df358d84d78d16c4603551935f4b67643373e7eb63dcb16ec359be0ec41fee33b03a16e80745f2374ff1d3c352508ac5d857c6476d3c3bcf7e6ca37427c9209f17be3af5264c0e2132b3dd1156c28b4e9c080a09f597089338d7f44f5c59f8230bb38f243849228a8d4e9d2e2956e6050f5b2c7a076486996c7e62802b8f95eee114783e4b403fd11093ba96286ff42c595f24452" ], "withdrawals": [], - "depositReceipts": [ + "depositRequests": [ { "amount": "0x773594000", "index": "0x0", @@ -36,7 +36,7 @@ } ], "blockNumber": "0x2", - "blockHash": "0xcf161dd8d9811f119f7377aa7cccd933955d1a6deb538200785191fb938fec5e", + "blockHash": "0xb56ecf32963d4160799d4db6fe3723f01226635d058ab86a11eaa9f8234af852", "receiptsRoot": "0x79ee3424eb720a3ad4b1c5a372bb8160580cbe4d893778660f34213c685627a9", "blobGasUsed": "0x0" }, @@ -50,7 +50,7 @@ "id": 67, "result": { "status": "VALID", - "latestValidHash": "0xcf161dd8d9811f119f7377aa7cccd933955d1a6deb538200785191fb938fec5e", + "latestValidHash": "0xb56ecf32963d4160799d4db6fe3723f01226635d058ab86a11eaa9f8234af852", "validationError": null } }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json index d764049f65e..c0eaebd2a41 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0xcf161dd8d9811f119f7377aa7cccd933955d1a6deb538200785191fb938fec5e", - "safeBlockHash": "0xcf161dd8d9811f119f7377aa7cccd933955d1a6deb538200785191fb938fec5e", - "finalizedBlockHash": "0xcf161dd8d9811f119f7377aa7cccd933955d1a6deb538200785191fb938fec5e" + "headBlockHash": "0xb56ecf32963d4160799d4db6fe3723f01226635d058ab86a11eaa9f8234af852", + "safeBlockHash": "0xb56ecf32963d4160799d4db6fe3723f01226635d058ab86a11eaa9f8234af852", + "finalizedBlockHash": "0xb56ecf32963d4160799d4db6fe3723f01226635d058ab86a11eaa9f8234af852" }, { "timestamp": "0x30", @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0xcf161dd8d9811f119f7377aa7cccd933955d1a6deb538200785191fb938fec5e", + "latestValidHash": "0xb56ecf32963d4160799d4db6fe3723f01226635d058ab86a11eaa9f8234af852", "validationError": null }, - "payloadId": "0x28264390264496cf" + "payloadId": "0x282643ead6ad5331" } }, "statusCode" : 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json index f9b2aa8e467..f93425a7e16 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV4", "params": [ - "0x28264390264496cf" + "0x282643ead6ad5331" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0xcf161dd8d9811f119f7377aa7cccd933955d1a6deb538200785191fb938fec5e", + "parentHash": "0xb56ecf32963d4160799d4db6fe3723f01226635d058ab86a11eaa9f8234af852", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xf786274a52a498c61961f6faa82c8f2df6c65bf6f0cbdd53216821bc981494a4", + "stateRoot": "0x61d2011dc13b003c48193f0902653fd4f7b67fa949dc0fa6eab9e69e349700fd", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -26,10 +26,10 @@ "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "transactions": [], "withdrawals": [], - "depositReceipts": [], + "depositRequests": [], "withdrawalRequests": [], "blockNumber": "0x3", - "blockHash": "0xf1626764177578f1bf1f0fcce3f5ecab4bf7e4c8c7754d1d30e7c0b98334ad98", + "blockHash": "0x7a619ef406633a6d6589602009b5d242e1273fd8259cebcac4ab006edfdf81f9", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0" }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json index 7c8b36d9943..f5e1c6c2d4d 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/12_cancun_newPayloadV4.json @@ -4,9 +4,9 @@ "method": "engine_newPayloadV3", "params": [ { - "parentHash": "0xcf161dd8d9811f119f7377aa7cccd933955d1a6deb538200785191fb938fec5e", + "parentHash": "0xb56ecf32963d4160799d4db6fe3723f01226635d058ab86a11eaa9f8234af852", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0xf786274a52a498c61961f6faa82c8f2df6c65bf6f0cbdd53216821bc981494a4", + "stateRoot": "0x61d2011dc13b003c48193f0902653fd4f7b67fa949dc0fa6eab9e69e349700fd", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -16,10 +16,10 @@ "baseFeePerGas": "0x7", "transactions": [], "withdrawals": [], - "depositReceipts": [], + "depositRequests": [], "withdrawalRequests": [], "blockNumber": "0x3", - "blockHash": "0xf1626764177578f1bf1f0fcce3f5ecab4bf7e4c8c7754d1d30e7c0b98334ad98", + "blockHash": "0x7a619ef406633a6d6589602009b5d242e1273fd8259cebcac4ab006edfdf81f9", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "excessBlobGas": "0x0", "blobGasUsed": "0x0" @@ -34,7 +34,7 @@ "id": 67, "result": { "status": "VALID", - "latestValidHash": "0xf1626764177578f1bf1f0fcce3f5ecab4bf7e4c8c7754d1d30e7c0b98334ad98", + "latestValidHash": "0x7a619ef406633a6d6589602009b5d242e1273fd8259cebcac4ab006edfdf81f9", "validationError": null } }, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json index c9facbcc663..fca8dd88e41 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/13_prague_send_raw_transaction_create_exit.json @@ -2,13 +2,13 @@ "request": { "jsonrpc": "2.0", "method": "eth_sendRawTransaction", - "params": ["0xf8a08085e8d4a51000832dc6c094ed8ea01d70cb49726175bcf2778b9c982912e01702b8388706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf2430000000000000000822fe0a008135b1be1734b1b446de871eba10dbc317437eff377a7444f2ff6c06b5e5345a01bc61e0d4dd6d8e0b1f41d843fd9e07260c8be8c664ec2fa8c364477fa021176"], + "params": ["0xf8a08085e8d4a51000832dc6c09400a3ca265ebcb825b45f985a16cefb49958ce01702b8388706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf2430000000000000000822fdfa00476c1a81f80f4c130acb5f8b8075468ba0893d766b7ec51a8d9723c573ad034a03bd3eaedabbaaf745f15023185ba66584ad3ee8bb40b9bef8c0b9ed27f8b1959"], "id": 67 }, "response": { "jsonrpc": "2.0", "id": 67, - "result": "0x764bfa879d0df4ff3962e32dfd45dc39ea18a35ccbd0dadf0bb58672537b1db2" + "result": "0x5878bb7458f51c06a121396769543bdc8b40221b7e214880b1e292fa04058f17" }, "statusCode": 200 } \ No newline at end of file diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json index 3c81beb3771..32fc288b0c0 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/14_prague_forkchoiceUpdatedV3.json @@ -4,9 +4,9 @@ "method": "engine_forkchoiceUpdatedV3", "params": [ { - "headBlockHash": "0xf1626764177578f1bf1f0fcce3f5ecab4bf7e4c8c7754d1d30e7c0b98334ad98", - "safeBlockHash": "0xf1626764177578f1bf1f0fcce3f5ecab4bf7e4c8c7754d1d30e7c0b98334ad98", - "finalizedBlockHash": "0xf1626764177578f1bf1f0fcce3f5ecab4bf7e4c8c7754d1d30e7c0b98334ad98" + "headBlockHash": "0x7a619ef406633a6d6589602009b5d242e1273fd8259cebcac4ab006edfdf81f9", + "safeBlockHash": "0x7a619ef406633a6d6589602009b5d242e1273fd8259cebcac4ab006edfdf81f9", + "finalizedBlockHash": "0x7a619ef406633a6d6589602009b5d242e1273fd8259cebcac4ab006edfdf81f9" }, { "timestamp": "0x40", @@ -24,10 +24,10 @@ "result": { "payloadStatus": { "status": "VALID", - "latestValidHash": "0xf1626764177578f1bf1f0fcce3f5ecab4bf7e4c8c7754d1d30e7c0b98334ad98", + "latestValidHash": "0x7a619ef406633a6d6589602009b5d242e1273fd8259cebcac4ab006edfdf81f9", "validationError": null }, - "payloadId": "0x282643d998c41241" + "payloadId": "0x2826438a3f8a7741" } }, "statusCode" : 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json index 31d55af69e6..9af6ea45cc5 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/15_prague_getPayloadV4.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV4", "params": [ - "0x282643d998c41241" + "0x2826438a3f8a7741" ], "id": 67 }, @@ -12,9 +12,9 @@ "id": 67, "result": { "executionPayload": { - "parentHash": "0xf1626764177578f1bf1f0fcce3f5ecab4bf7e4c8c7754d1d30e7c0b98334ad98", + "parentHash": "0x7a619ef406633a6d6589602009b5d242e1273fd8259cebcac4ab006edfdf81f9", "feeRecipient": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "stateRoot": "0x4021e9832c7d9945cb681d670c238c6178bd2184e957a474a7989d06f7171349", + "stateRoot": "0x847db08c6b9e6dcc91288bd963eb5623aea5387232016ef81fddb3ebc994c72f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1c9c380", @@ -25,10 +25,10 @@ "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "transactions": [ - "0xf8a08085e8d4a51000832dc6c094ed8ea01d70cb49726175bcf2778b9c982912e01702b8388706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf2430000000000000000822fe0a008135b1be1734b1b446de871eba10dbc317437eff377a7444f2ff6c06b5e5345a01bc61e0d4dd6d8e0b1f41d843fd9e07260c8be8c664ec2fa8c364477fa021176" + "0xf8a08085e8d4a51000832dc6c09400a3ca265ebcb825b45f985a16cefb49958ce01702b8388706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf2430000000000000000822fdfa00476c1a81f80f4c130acb5f8b8075468ba0893d766b7ec51a8d9723c573ad034a03bd3eaedabbaaf745f15023185ba66584ad3ee8bb40b9bef8c0b9ed27f8b1959" ], "withdrawals": [], - "depositReceipts": [], + "depositRequests": [], "withdrawalRequests": [ { "sourceAddress": "0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f", @@ -39,7 +39,7 @@ "blockNumber": "0x4", "blobGasUsed": "0x0", "receiptsRoot": "0x765bd9d63cc10fa47117d6cc0958f15e55a3bde540d4ed15d220f573fbb82cba", - "blockHash": "0xc5c15f6a88d3576927b16de1c635cabf46bb9419a3bbb3be156ddbe229de5e64" + "blockHash": "0xd0b81acdb3016abbc05599b083c8b090323efaf0b2aeab8d0755780e20214159" }, "blockValue": "0x12855dcd153473b", "blobsBundle": { diff --git a/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java index ee4799da965..731fd2ac568 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/AbstractBftBesuControllerBuilderTest.java @@ -192,7 +192,6 @@ public void miningParametersBlockPeriodSecondsIsUpdatedOnTransition() { null, null, null, - null, getBlockHeaderFunctions()); final Block block1 = new Block(header1, BlockBody.empty()); diff --git a/besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java b/besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java index c4cce7f4c54..82f98ba8266 100644 --- a/besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java +++ b/besu/src/test/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilderTest.java @@ -221,7 +221,6 @@ public void miningParametersBlockPeriodSecondsIsUpdatedOnTransition() { null, null, null, - null, new CliqueBlockHeaderFunctions()); final Block block1 = new Block(header1, BlockBody.empty()); diff --git a/besu/src/test/java/org/hyperledger/besu/services/BesuEventsImplTest.java b/besu/src/test/java/org/hyperledger/besu/services/BesuEventsImplTest.java index 80eae1af436..3673e78e312 100644 --- a/besu/src/test/java/org/hyperledger/besu/services/BesuEventsImplTest.java +++ b/besu/src/test/java/org/hyperledger/besu/services/BesuEventsImplTest.java @@ -218,7 +218,7 @@ private void setSyncTarget() { mock(EthPeer.class), new org.hyperledger.besu.ethereum.core.BlockHeader( null, null, null, null, null, null, null, null, 1, 1, 1, 1, null, null, null, 1, null, - null, null, null, null, null, null)); + null, null, null, null, null)); } private void clearSyncTarget() { diff --git a/consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueBlockCreator.java b/consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueBlockCreator.java index e703aeb48f1..099d66dc9f4 100644 --- a/consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueBlockCreator.java +++ b/consensus/clique/src/main/java/org/hyperledger/besu/consensus/clique/blockcreation/CliqueBlockCreator.java @@ -76,7 +76,6 @@ public CliqueBlockCreator( protocolContext, protocolSchedule, parentHeader, - Optional.empty(), ethScheduler); this.nodeKey = nodeKey; this.epochManager = epochManager; diff --git a/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/blockcreation/BftBlockCreator.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/blockcreation/BftBlockCreator.java index b84cd665f14..f461a77913e 100644 --- a/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/blockcreation/BftBlockCreator.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/blockcreation/BftBlockCreator.java @@ -76,7 +76,6 @@ public BftBlockCreator( protocolContext, protocolSchedule, parentHeader, - Optional.empty(), ethScheduler); this.bftExtraDataCodec = bftExtraDataCodec; } diff --git a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeBlockCreator.java b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeBlockCreator.java index f720d86a54c..10c21384adf 100644 --- a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeBlockCreator.java +++ b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeBlockCreator.java @@ -14,7 +14,6 @@ */ package org.hyperledger.besu.consensus.merge.blockcreation; -import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.blockcreation.AbstractBlockCreator; import org.hyperledger.besu.ethereum.core.BlockHeader; @@ -54,7 +53,6 @@ public MergeBlockCreator( final ProtocolContext protocolContext, final ProtocolSchedule protocolSchedule, final BlockHeader parentHeader, - final Optional
depositContractAddress, final EthScheduler ethScheduler) { super( miningParameters, @@ -64,7 +62,6 @@ public MergeBlockCreator( protocolContext, protocolSchedule, parentHeader, - depositContractAddress, ethScheduler); } diff --git a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java index 68c5a16599a..4d4ca0638d3 100644 --- a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java +++ b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java @@ -149,7 +149,6 @@ public MergeCoordinator( protocolContext, protocolSchedule, parentHeader, - depositContractAddress, ethScheduler); }; diff --git a/consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinatorTest.java b/consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinatorTest.java index 31aadde47d2..6ce8bcd8d0a 100644 --- a/consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinatorTest.java +++ b/consensus/merge/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinatorTest.java @@ -275,7 +275,6 @@ public void exceptionDuringBuildingBlockShouldNotBeInvalid() protocolContext, protocolSchedule, parentHeader, - Optional.empty(), ethScheduler)); doCallRealMethod() diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/ProposalTest.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/ProposalTest.java index 2273b5a0f5a..b3c462656ac 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/ProposalTest.java +++ b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/ProposalTest.java @@ -55,7 +55,6 @@ public class ProposalTest { Collections.emptyList(), Collections.emptyList(), Optional.of(Collections.emptyList()), - Optional.empty(), Optional.empty())); @Test diff --git a/datatypes/src/main/java/org/hyperledger/besu/datatypes/RequestType.java b/datatypes/src/main/java/org/hyperledger/besu/datatypes/RequestType.java new file mode 100644 index 00000000000..b1cddb44040 --- /dev/null +++ b/datatypes/src/main/java/org/hyperledger/besu/datatypes/RequestType.java @@ -0,0 +1,58 @@ +/* + * Copyright contributors to Hyperledger Besu. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.datatypes; + +import java.util.Arrays; + +/** Enum representing different types of requests with associated serialized type values. */ +public enum RequestType { + /** DEPOSITS */ + DEPOSIT(0x00), + /** WITHDRAWAL */ + WITHDRAWAL(0x01); + + private final int typeValue; + + RequestType(final int typeValue) { + this.typeValue = typeValue; + } + + /** + * Gets the serialized type value of the request type. + * + * @return the serialized type value as a byte. + */ + public byte getSerializedType() { + return (byte) this.typeValue; + } + + /** + * Returns the {@link RequestType} corresponding to the given serialized type value. + * + * @param serializedTypeValue the serialized type value. + * @return the corresponding {@link RequestType}. + * @throws IllegalArgumentException if the serialized type value does not correspond to any {@link + * RequestType}. + */ + public static RequestType of(final int serializedTypeValue) { + return Arrays.stream(RequestType.values()) + .filter(requestType -> requestType.typeValue == serializedTypeValue) + .findFirst() + .orElseThrow( + () -> + new IllegalArgumentException( + String.format("Unsupported request type: 0x%02X", serializedTypeValue))); + } +} diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseKey.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseKey.java index 749e96b11e8..a62cc06ec26 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseKey.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseKey.java @@ -38,6 +38,5 @@ public enum JsonRpcResponseKey { TRANSACTION_ROOT, BASEFEE, WITHDRAWALS_ROOT, - DEPOSITS_ROOT, - WITHDRAWAL_REQUESTS_ROOT + REQUESTS_ROOT } diff --git a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseUtils.java b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseUtils.java index 83bcece600d..4e067e6ec8a 100644 --- a/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseUtils.java +++ b/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcResponseUtils.java @@ -16,7 +16,6 @@ import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.BASEFEE; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.COINBASE; -import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.DEPOSITS_ROOT; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.DIFFICULTY; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.EXTRA_DATA; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.GAS_LIMIT; @@ -28,13 +27,13 @@ import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.OMMERS_HASH; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.PARENT_HASH; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.RECEIPTS_ROOT; +import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.REQUESTS_ROOT; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.SIZE; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.STATE_ROOT; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.TIMESTAMP; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.TOTAL_DIFFICULTY; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.TRANSACTION_ROOT; import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.WITHDRAWALS_ROOT; -import static org.hyperledger.besu.ethereum.api.jsonrpc.JsonRpcResponseKey.WITHDRAWAL_REQUESTS_ROOT; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.datatypes.Address; @@ -105,12 +104,8 @@ public JsonRpcResponse response( final int size = unsignedInt(values.get(SIZE)); final Hash withdrawalsRoot = values.containsKey(WITHDRAWALS_ROOT) ? hash(values.get(WITHDRAWALS_ROOT)) : null; - final Hash depositsRoot = - values.containsKey(DEPOSITS_ROOT) ? hash(values.get(DEPOSITS_ROOT)) : null; - final Hash withdrawalRequestsRoot = - values.containsKey(WITHDRAWAL_REQUESTS_ROOT) - ? hash(values.get(WITHDRAWAL_REQUESTS_ROOT)) - : null; + final Hash requestsRoot = + values.containsKey(REQUESTS_ROOT) ? hash(values.get(REQUESTS_ROOT)) : null; final ListThis class provides functionality to decode requests based on their type.
+ */
+public class RequestDecoder {
+
+ @FunctionalInterface
+ interface Decoder {
+ Request decode(RLPInput input);
+ }
+
+ private static final ImmutableMap This method first determines the type of the request and then decodes the request data
+ * according to the request type.
+ *
+ * @param rlpInput The RLP encoded request.
+ * @return The decoded Request object.
+ * @throws IllegalArgumentException if the request type is unsupported or invalid.
+ */
+ public static Request decode(final RLPInput rlpInput) {
+ final Bytes requestBytes = rlpInput.readBytes();
+ return getRequestType(requestBytes)
+ .map(type -> decodeRequest(requestBytes, type))
+ .orElseThrow(() -> new IllegalArgumentException("Unsupported or invalid request type"));
+ }
+
+ /**
+ * Decodes the request data according to the request type.
+ *
+ * @param requestBytes The bytes representing the request, including the request type byte.
+ * @param requestType The type of the request to decode.
+ * @return The decoded Request.
+ * @throws IllegalStateException if no decoder is found for the specified request type.
+ */
+ private static Request decodeRequest(final Bytes requestBytes, final RequestType requestType) {
+ // Skip the first byte which is the request type
+ RLPInput requestInput = RLP.input(requestBytes.slice(1));
+ Decoder decoder =
+ Optional.ofNullable(DECODERS.get(requestType))
+ .orElseThrow(
+ () ->
+ new IllegalStateException(
+ "Decoder not found for request type: " + requestType));
+ return decoder.decode(requestInput);
+ }
+
+ /**
+ * Extracts the request type from the given bytes.
+ *
+ * @param bytes The bytes from which to extract the request type.
+ * @return An Optional containing the RequestType if it could be determined, or an empty Optional
+ * otherwise.
+ */
+ private static Optional> maybeWithdrawals,
- final Optional
> maybeDeposits,
final PrivateMetadataUpdater privateMetadataUpdater) {
final List
> maybeRequests = Optional.empty();
+ if (requestProcessor.isPresent()) {
+ maybeRequests = requestProcessor.get().process(worldState, receipts);
}
if (!rewardCoinbase(worldState, blockHeader, ommers, skipZeroBlockRewards)) {
@@ -219,7 +221,8 @@ public BlockProcessingResult processBlock(
return new BlockProcessingResult(Optional.empty(), e);
}
- return new BlockProcessingResult(Optional.of(new BlockProcessingOutputs(worldState, receipts)));
+ return new BlockProcessingResult(
+ Optional.of(new BlockProcessingOutputs(worldState, receipts, maybeRequests)));
}
protected boolean hasAvailableBlockBudget(
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BaseFeeBlockBodyValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BaseFeeBlockBodyValidator.java
index 62629dde665..0e288185cfc 100644
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BaseFeeBlockBodyValidator.java
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BaseFeeBlockBodyValidator.java
@@ -18,6 +18,7 @@
import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockBody;
+import org.hyperledger.besu.ethereum.core.Request;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.core.feemarket.TransactionPriceCalculator;
@@ -41,9 +42,10 @@ public boolean validateBodyLight(
final ProtocolContext context,
final Block block,
final List
> requests,
final HeaderValidationMode ommerValidationMode) {
- return super.validateBodyLight(context, block, receipts, ommerValidationMode)
+ return super.validateBodyLight(context, block, receipts, requests, ommerValidationMode)
&& validateTransactionGasPrice(block);
}
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockBodyValidator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockBodyValidator.java
index e063c584fd2..62b4985f5ca 100644
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockBodyValidator.java
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockBodyValidator.java
@@ -17,9 +17,11 @@
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.core.Block;
+import org.hyperledger.besu.ethereum.core.Request;
import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import java.util.List;
+import java.util.Optional;
/** Validates block bodies. */
public interface BlockBodyValidator {
@@ -39,6 +41,7 @@ boolean validateBody(
ProtocolContext context,
Block block,
List
> requests,
Hash worldStateRootHash,
final HeaderValidationMode ommerValidationMode);
@@ -55,5 +58,6 @@ boolean validateBodyLight(
ProtocolContext context,
Block block,
List
> requests,
final HeaderValidationMode ommerValidationMode);
}
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockProcessor.java
index 060bce5bd77..d9f2e7874cc 100644
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockProcessor.java
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BlockProcessor.java
@@ -19,7 +19,6 @@
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.BlockHeader;
-import org.hyperledger.besu.ethereum.core.Deposit;
import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt;
@@ -83,7 +82,6 @@ default BlockProcessingResult processBlock(
block.getBody().getTransactions(),
block.getBody().getOmmers(),
block.getBody().getWithdrawals(),
- block.getBody().getDeposits(),
null);
}
@@ -104,14 +102,7 @@ default BlockProcessingResult processBlock(
final List
> withdrawals,
- Optional
> deposits,
PrivateMetadataUpdater privateMetadataUpdater);
/**
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java
index fd00ad47649..86392b86d6b 100644
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/BodyValidation.java
@@ -18,16 +18,14 @@
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.core.BlockHeader;
-import org.hyperledger.besu.ethereum.core.Deposit;
+import org.hyperledger.besu.ethereum.core.Request;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.TransactionReceipt;
import org.hyperledger.besu.ethereum.core.Withdrawal;
-import org.hyperledger.besu.ethereum.core.WithdrawalRequest;
-import org.hyperledger.besu.ethereum.core.encoding.DepositEncoder;
import org.hyperledger.besu.ethereum.core.encoding.EncodingContext;
+import org.hyperledger.besu.ethereum.core.encoding.RequestEncoder;
import org.hyperledger.besu.ethereum.core.encoding.TransactionEncoder;
import org.hyperledger.besu.ethereum.core.encoding.WithdrawalEncoder;
-import org.hyperledger.besu.ethereum.core.encoding.WithdrawalRequestEncoder;
import org.hyperledger.besu.ethereum.rlp.RLP;
import org.hyperledger.besu.ethereum.trie.MerkleTrie;
import org.hyperledger.besu.ethereum.trie.patricia.SimpleMerklePatriciaTrie;
@@ -91,36 +89,15 @@ public static Hash withdrawalsRoot(final List
> deposits);
-
- boolean validateDeposits(Block block, List
> deposits) {
- return deposits.isEmpty();
- }
-
- @Override
- public boolean validateDeposits(final Block block, final List
> deposits = block.getBody().getDeposits();
- final boolean isValid = deposits.isEmpty();
- if (!isValid) {
- LOG.warn("Deposits must be empty when Deposits are prohibited but were: {}", deposits);
- }
- return isValid;
- }
-
- @Override
- public boolean validateDepositsRoot(final Block block) {
- final Optional
> deposits) {
- return deposits.isPresent();
- }
-
- @Override
- public boolean validateDeposits(final Block block, final List
> requests,
final Hash worldStateRootHash,
final HeaderValidationMode ommerValidationMode) {
- if (!validateBodyLight(context, block, receipts, ommerValidationMode)) {
+ if (!validateBodyLight(context, block, receipts, requests, ommerValidationMode)) {
return false;
}
@@ -73,6 +76,7 @@ public boolean validateBodyLight(
final ProtocolContext context,
final Block block,
final List
> requests,
final HeaderValidationMode ommerValidationMode) {
final BlockHeader header = block.getHeader();
final BlockBody body = block.getBody();
@@ -105,16 +109,9 @@ public boolean validateBodyLight(
return false;
}
- if (!validateDeposits(block, receipts)) {
+ if (!validateRequests(block, requests, receipts)) {
return false;
}
-
- if (body.getWithdrawalRequests().isPresent()) {
- if (!validateWithdrawalRequests(block, body.getWithdrawalRequests().get())) {
- return false;
- }
- }
-
return true;
}
@@ -316,25 +313,12 @@ private boolean validateWithdrawals(final Block block) {
return true;
}
- private boolean validateDeposits(final Block block, final List
> requests,
+ final List
> withdrawals,
- final Optional
> deposits,
final PrivateMetadataUpdater privateMetadataUpdater) {
updateWorldStateForDao(worldState);
return wrapped.processBlock(
@@ -923,7 +922,6 @@ public BlockProcessingResult processBlock(
transactions,
ommers,
withdrawals,
- deposits,
privateMetadataUpdater);
}
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessor.java
index 0db16f0c4db..abfdf3652e6 100644
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessor.java
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/PrivacyBlockProcessor.java
@@ -23,7 +23,6 @@
import org.hyperledger.besu.ethereum.BlockProcessingResult;
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.core.BlockHeader;
-import org.hyperledger.besu.ethereum.core.Deposit;
import org.hyperledger.besu.ethereum.core.MutableWorldState;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.Withdrawal;
@@ -90,7 +89,6 @@ public BlockProcessingResult processBlock(
final List
> withdrawals,
- final Optional
> deposits,
final PrivateMetadataUpdater privateMetadataUpdater) {
if (privateMetadataUpdater != null) {
@@ -110,7 +108,6 @@ public BlockProcessingResult processBlock(
transactions,
ommers,
withdrawals,
- deposits,
metadataUpdater);
metadataUpdater.commit();
return result;
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java
index c8b4439a7c9..b364679aa8b 100644
--- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolSpec.java
@@ -21,6 +21,8 @@
import org.hyperledger.besu.ethereum.core.BlockImporter;
import org.hyperledger.besu.ethereum.mainnet.blockhash.BlockHashProcessor;
import org.hyperledger.besu.ethereum.mainnet.feemarket.FeeMarket;
+import org.hyperledger.besu.ethereum.mainnet.requests.RequestProcessorCoordinator;
+import org.hyperledger.besu.ethereum.mainnet.requests.RequestsValidatorCoordinator;
import org.hyperledger.besu.ethereum.privacy.PrivateTransactionProcessor;
import org.hyperledger.besu.evm.EVM;
import org.hyperledger.besu.evm.gascalculator.GasCalculator;
@@ -76,8 +78,8 @@ public class ProtocolSpec {
private final WithdrawalsValidator withdrawalsValidator;
private final Optional
> withdrawalRequests);
-
- boolean validateWithdrawalRequestsInBlock(
- Block block, List
> withdrawalRequests) {
- return withdrawalRequests.isEmpty();
- }
-
- @Override
- public boolean validateWithdrawalRequestsInBlock(
- final Block block, final List
> maybeWithdrawalRequests =
- block.getBody().getWithdrawalRequests();
- if (maybeWithdrawalRequests.isPresent()) {
- LOG.warn(
- "Block {} contains withdrawal requests but withdrawal requests are prohibited",
- block.getHash());
- return false;
- }
-
- if (block.getHeader().getWithdrawalRequestsRoot().isPresent()) {
- LOG.warn(
- "Block {} header contains withdrawal_requests_root but withdrawal requests are prohibited",
- block.getHash());
- return false;
- }
-
- return true;
- }
- }
-}
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/DepositRequestProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/DepositRequestProcessor.java
new file mode 100644
index 00000000000..16109946dfd
--- /dev/null
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/DepositRequestProcessor.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright contributors to Hyperledger Besu.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+package org.hyperledger.besu.ethereum.mainnet.requests;
+
+import org.hyperledger.besu.datatypes.Address;
+import org.hyperledger.besu.ethereum.core.Deposit;
+import org.hyperledger.besu.ethereum.core.MutableWorldState;
+import org.hyperledger.besu.ethereum.core.Request;
+import org.hyperledger.besu.ethereum.core.TransactionReceipt;
+import org.hyperledger.besu.ethereum.core.encoding.DepositDecoder;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+
+import com.google.common.annotations.VisibleForTesting;
+
+public class DepositRequestProcessor implements RequestProcessor {
+
+ public static final Address DEFAULT_DEPOSIT_CONTRACT_ADDRESS =
+ Address.fromHexString("0x00000000219ab540356cbb839cbe05303d7705fa");
+
+ private final Optional depositContractAddress;
+
+ public DepositRequestProcessor(final Address depositContractAddress) {
+ this.depositContractAddress = Optional.ofNullable(depositContractAddress);
+ }
+
+ @Override
+ public Optional
> process(
+ final MutableWorldState ignored, final List
> deposits) {
+ return deposits.isPresent();
+ }
+
+ public boolean validateDeposits(
+ final Block block,
+ final List
> request) {
+ return request.isEmpty();
+ }
+}
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/RequestProcessor.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/RequestProcessor.java
new file mode 100644
index 00000000000..c365e0d754b
--- /dev/null
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/RequestProcessor.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright contributors to Hyperledger Besu.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+package org.hyperledger.besu.ethereum.mainnet.requests;
+
+import org.hyperledger.besu.ethereum.core.MutableWorldState;
+import org.hyperledger.besu.ethereum.core.Request;
+import org.hyperledger.besu.ethereum.core.TransactionReceipt;
+
+import java.util.List;
+import java.util.Optional;
+
+public interface RequestProcessor {
+ Optional
> process(
+ final MutableWorldState mutableWorldState,
+ final List
> process(
+ final MutableWorldState mutableWorldState, final List
> combine(
+ final Optional
> maybeDeposits,
+ final Optional
> maybeWithdrawalRequest) {
+ if (maybeDeposits.isEmpty() && maybeWithdrawalRequest.isEmpty()) {
+ return Optional.empty();
+ }
+ List
> request);
+}
diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/RequestsValidatorCoordinator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/RequestsValidatorCoordinator.java
new file mode 100644
index 00000000000..f6800f95c3b
--- /dev/null
+++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/requests/RequestsValidatorCoordinator.java
@@ -0,0 +1,198 @@
+/*
+ * Copyright contributors to Hyperledger Besu.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+package org.hyperledger.besu.ethereum.mainnet.requests;
+
+import org.hyperledger.besu.datatypes.Hash;
+import org.hyperledger.besu.datatypes.RequestType;
+import org.hyperledger.besu.ethereum.core.Block;
+import org.hyperledger.besu.ethereum.core.Request;
+import org.hyperledger.besu.ethereum.core.TransactionReceipt;
+import org.hyperledger.besu.ethereum.mainnet.BodyValidation;
+
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import com.google.common.collect.ImmutableSortedMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Validates requests within a block against a set of predefined validators. This class delegates
+ * the validation of requests of specific types to corresponding validators. It ensures that
+ * requests are properly ordered, have a valid root, and meet the criteria defined by their
+ * validators.
+ */
+public class RequestsValidatorCoordinator {
+ private static final Logger LOG = LoggerFactory.getLogger(RequestsValidatorCoordinator.class);
+ private final ImmutableSortedMap
> maybeRequests,
+ final List
> requests) {
+ final Hash blockHash = block.getHash();
+ final Optional
> requests) {
+ final Hash blockHash = block.getHash();
+ final Optional
> process(
+ final MutableWorldState mutableWorldState,
+ final List
> withdrawalRequests) {
return withdrawalRequests.isPresent();
}
- @Override
- public boolean validateWithdrawalRequestsInBlock(
+ private boolean validateWithdrawalRequestsInBlock(
final Block block, final List
> request) {
+ if (request.isEmpty()) {
+ return false;
+ }
+ var withdrawalRequests =
+ RequestUtil.filterRequestsOfType(request.get(), WithdrawalRequest.class);
+ return validateWithdrawalRequestParameter(Optional.of(withdrawalRequests));
+ }
}
diff --git a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java
index cafe8bb82e6..c5b797403a8 100644
--- a/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java
+++ b/ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java
@@ -303,8 +303,7 @@ public BlockHeader header(final long number, final BlockBody body, final BlockOp
.mixHash(hash())
.nonce(blockNonce)
.withdrawalsRoot(options.getWithdrawalsRoot(null))
- .depositsRoot(options.getDepositsRoot(null))
- .withdrawalRequestsRoot(options.getWithdrawalRequestsRoot(null))
+ .requestsRoot(options.getRequestsRoot(null))
.blockHeaderFunctions(
options.getBlockHeaderFunctions(new MainnetBlockHeaderFunctions()));
options.getBaseFee(Optional.of(Wei.of(uint256(2)))).ifPresent(blockHeaderBuilder::baseFee);
@@ -333,8 +332,7 @@ public BlockBody body(final BlockOptions options) {
options.getTransactions(defaultTxs),
ommers,
options.getWithdrawals(Optional.empty()),
- options.getDeposits(Optional.empty()),
- options.getWithdrawalRequests(Optional.empty()));
+ options.getRequests(Optional.empty()));
}
private BlockHeader ommer() {
@@ -640,8 +638,7 @@ public static class BlockOptions {
private final List
> getWithdrawals(
return withdrawals.orElse(defaultValue);
}
- public Hash getDepositsRoot(final Hash defaultValue) {
- return depositsRoot.orElse(defaultValue);
+ public Hash getRequestsRoot(final Hash defaultValue) {
+ return requestsRoot.orElse(defaultValue);
}
- public Optional
> getDeposits(final Optional
> defaultValue) {
- return deposits.orElse(defaultValue);
- }
-
- public Hash getWithdrawalRequestsRoot(final Hash defaultValue) {
- return withdrawalRequestsRoot.orElse(defaultValue);
- }
-
- public Optional
> getWithdrawalRequests(
- final Optional
> defaultValue) {
- return withdrawalRequests.orElse(defaultValue);
+ public Optional
> getRequests(final Optional
> defaultValue) {
+ return requests.orElse(defaultValue);
}
public boolean hasTransactions() {
@@ -771,14 +758,8 @@ public BlockOptions setWithdrawals(final Optional