From 852fbf9480954515a4fb7a4be640193627eb5739 Mon Sep 17 00:00:00 2001 From: Simon Dudley Date: Fri, 1 Nov 2024 17:37:23 +1000 Subject: [PATCH] Fix ATs after changing withdrawals payloadId Signed-off-by: Simon Dudley --- .../10_cancun_build_on_genesis.json | 96 ++++++++++++++++++- .../12_cancun_get_built_block.json | 2 +- .../06_shanghai_prepare_payload.json | 2 +- ..._payload_replay_different_withdrawals.json | 2 +- .../test-cases/08_shanghai_getPayloadV2.json | 2 +- .../BlobSizeTransactionSelector.java | 4 +- 6 files changed, 100 insertions(+), 8 deletions(-) diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/cancun/test-cases/block-production/10_cancun_build_on_genesis.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/cancun/test-cases/block-production/10_cancun_build_on_genesis.json index 5dea701a33f..e269c045ec6 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/cancun/test-cases/block-production/10_cancun_build_on_genesis.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/cancun/test-cases/block-production/10_cancun_build_on_genesis.json @@ -1,5 +1,95 @@ { - "request" : {"jsonrpc":"2.0","id":5,"method":"engine_forkchoiceUpdatedV3","params":[{"headBlockHash":"0x33235e7b7a78302cdb54e5ddba66c7ae49b01c1f5498bb00cd0c8ed5206784bf","safeBlockHash":"0x0000000000000000000000000000000000000000000000000000000000000000","finalizedBlockHash":"0x0000000000000000000000000000000000000000000000000000000000000000"},{"timestamp":"0x1236","prevRandao":"0xc13da06dc53836ca0766057413b9683eb9a8773bbb8fcc5691e41c25b56dda1d","suggestedFeeRecipient":"0x0000000000000000000000000000000000000000","withdrawals":[{"index":"0xb","validatorIndex":"0x0","address":"0x0000000000000000000000000000000000000000","amount":"0x64"},{"index":"0xc","validatorIndex":"0x1","address":"0x0100000000000000000000000000000000000000","amount":"0x64"},{"index":"0xd","validatorIndex":"0x2","address":"0x0200000000000000000000000000000000000000","amount":"0x64"},{"index":"0xe","validatorIndex":"0x3","address":"0x0300000000000000000000000000000000000000","amount":"0x64"},{"index":"0xf","validatorIndex":"0x4","address":"0x0400000000000000000000000000000000000000","amount":"0x64"},{"index":"0x10","validatorIndex":"0x5","address":"0x0500000000000000000000000000000000000000","amount":"0x64"},{"index":"0x11","validatorIndex":"0x6","address":"0x0600000000000000000000000000000000000000","amount":"0x64"},{"index":"0x12","validatorIndex":"0x7","address":"0x0700000000000000000000000000000000000000","amount":"0x64"},{"index":"0x13","validatorIndex":"0x8","address":"0x0800000000000000000000000000000000000000","amount":"0x64"},{"index":"0x14","validatorIndex":"0x9","address":"0x0900000000000000000000000000000000000000","amount":"0x64"}],"parentBeaconBlockRoot":"0x062367f0b23e2d49ad5e770d9ad17b83c0c1c625c3f9a290cd9572b3fc6cfc9e"}]}, - "response" : {"jsonrpc":"2.0","id":5,"result":{"payloadStatus":{"status":"VALID","latestValidHash":"0x33235e7b7a78302cdb54e5ddba66c7ae49b01c1f5498bb00cd0c8ed5206784bf","validationError":null},"payloadId":"0x29e12df730769ab6"}}, - "statusCode" : 200 + "request": { + "jsonrpc": "2.0", + "id": 5, + "method": "engine_forkchoiceUpdatedV3", + "params": [ + { + "headBlockHash": "0x33235e7b7a78302cdb54e5ddba66c7ae49b01c1f5498bb00cd0c8ed5206784bf", + "safeBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "finalizedBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "timestamp": "0x1236", + "prevRandao": "0xc13da06dc53836ca0766057413b9683eb9a8773bbb8fcc5691e41c25b56dda1d", + "suggestedFeeRecipient": "0x0000000000000000000000000000000000000000", + "withdrawals": [ + { + "index": "0xb", + "validatorIndex": "0x0", + "address": "0x0000000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0xc", + "validatorIndex": "0x1", + "address": "0x0100000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0xd", + "validatorIndex": "0x2", + "address": "0x0200000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0xe", + "validatorIndex": "0x3", + "address": "0x0300000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0xf", + "validatorIndex": "0x4", + "address": "0x0400000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0x10", + "validatorIndex": "0x5", + "address": "0x0500000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0x11", + "validatorIndex": "0x6", + "address": "0x0600000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0x12", + "validatorIndex": "0x7", + "address": "0x0700000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0x13", + "validatorIndex": "0x8", + "address": "0x0800000000000000000000000000000000000000", + "amount": "0x64" + }, + { + "index": "0x14", + "validatorIndex": "0x9", + "address": "0x0900000000000000000000000000000000000000", + "amount": "0x64" + } + ], + "parentBeaconBlockRoot": "0x062367f0b23e2d49ad5e770d9ad17b83c0c1c625c3f9a290cd9572b3fc6cfc9e" + } + ] + }, + "response": { + "jsonrpc": "2.0", + "id": 5, + "result": { + "payloadStatus": { + "status": "VALID", + "latestValidHash": "0x33235e7b7a78302cdb54e5ddba66c7ae49b01c1f5498bb00cd0c8ed5206784bf", + "validationError": null + }, + "payloadId": "0x744ab0889222f836" + } + }, + "statusCode": 200 } \ No newline at end of file diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/cancun/test-cases/block-production/12_cancun_get_built_block.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/cancun/test-cases/block-production/12_cancun_get_built_block.json index 8cbdd626427..bbc4860f1d3 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/cancun/test-cases/block-production/12_cancun_get_built_block.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/cancun/test-cases/block-production/12_cancun_get_built_block.json @@ -1,5 +1,5 @@ { - "request" : {"jsonrpc":"2.0","id":2,"method":"engine_getPayloadV3","params":["0x29e12df730769ab6"]}, + "request" : {"jsonrpc":"2.0","id":2,"method":"engine_getPayloadV3","params":["0x744ab0889222f836"]}, "response" : { "jsonrpc" : "2.0", "id" : 2, diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/06_shanghai_prepare_payload.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/06_shanghai_prepare_payload.json index 456a9a74264..b171983efd3 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/06_shanghai_prepare_payload.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/06_shanghai_prepare_payload.json @@ -39,7 +39,7 @@ "latestValidHash": "0xf4a1d287dd3bb7e877c57476912e6a6052bc4eed8ea70d032b55d77f26ee985f", "validationError": null }, - "payloadId": "0x0065bd2db6663f59" + "payloadId": "0x48b9f464feba7610" } }, "statusCode" : 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/07_shanghai_prepare_payload_replay_different_withdrawals.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/07_shanghai_prepare_payload_replay_different_withdrawals.json index dcb022e1a62..3bbf1edcd9e 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/07_shanghai_prepare_payload_replay_different_withdrawals.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/07_shanghai_prepare_payload_replay_different_withdrawals.json @@ -39,7 +39,7 @@ "latestValidHash": "0xf4a1d287dd3bb7e877c57476912e6a6052bc4eed8ea70d032b55d77f26ee985f", "validationError": null }, - "payloadId": "0x0065bd2db6663ed9" + "payloadId": "0x48b9f5e4feba7610" } }, "statusCode" : 200 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/08_shanghai_getPayloadV2.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/08_shanghai_getPayloadV2.json index 072e5146d0a..2d1d7f741d2 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/08_shanghai_getPayloadV2.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/shanghai/test-cases/08_shanghai_getPayloadV2.json @@ -3,7 +3,7 @@ "jsonrpc": "2.0", "method": "engine_getPayloadV2", "params": [ - "0x0065bd2db6663ed9" + "0x48b9f5e4feba7610" ], "id": 67 }, diff --git a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlobSizeTransactionSelector.java b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlobSizeTransactionSelector.java index 9a4c83e9625..51651af7bdd 100644 --- a/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlobSizeTransactionSelector.java +++ b/ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/txselection/selectors/BlobSizeTransactionSelector.java @@ -56,7 +56,9 @@ public TransactionSelectionResult evaluateTransactionPreProcessing( if (tx.getType().supportsBlob()) { final var remainingBlobGas = - context.gasLimitCalculator().currentBlobGasLimit() + context + .gasLimitCalculator() + .currentBlobGasLimit() // TODO SLD EIP-7742 max blobs may change - transactionSelectionResults.getCumulativeBlobGasUsed(); if (remainingBlobGas == 0) {