From db788c63a4cf5310b462d5177674e8d2e6ae32c2 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Fri, 24 Feb 2023 11:45:00 -0700 Subject: [PATCH 1/2] Decode long instead of parseLong In one case reading config files use decode instead of parseLong. decode accepts `0x` and decimal, only a single radix for parseLong. Signed-off-by: Danno Ferrin --- .../besu/evmtool/t8n/london-hex.json | 108 ++++++++++++++++++ .../referencetests/ReferenceTestEnv.java | 2 +- 2 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/london-hex.json diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/london-hex.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/london-hex.json new file mode 100644 index 00000000000..a66c7dcd951 --- /dev/null +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/london-hex.json @@ -0,0 +1,108 @@ +{ + "cli": [ + "t8n", + "--input.alloc=stdin", + "--input.txs=stdin", + "--input.env=stdin", + "--output.result=stdout", + "--output.alloc=stdout", + "--output.body=stdout", + "--state.fork=London", + "--state.chainid=1", + "--state.reward=0" + ], + "stdin": { + "alloc": { + "0x1000000000000000000000000000000000000000": { + "nonce": "0x00", + "balance": "0x0ba1a9ce0ba1a9ce", + "code": "0x6010565b6000828201905092915050565b601a600260016003565b60005560206000f3", + "storage": {} + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "nonce": "0x00", + "balance": "0x0ba1a9ce0ba1a9ce", + "code": "0x", + "storage": {} + } + }, + "txs": [ + { + "type": "0x0", + "chainId": "0x0", + "nonce": "0x0", + "gasPrice": "0xa", + "gas": "0x7a120", + "value": "0x0", + "input": "0x", + "to": "0x1000000000000000000000000000000000000000", + "protected": false, + "secretKey": "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "v": "0x0", + "r": "0x0", + "s": "0x0" + } + ], + "env": + { + "currentCoinbase": "0x0000000000000000000000000000000000000000", + "currentNumber" : "0x1", + "currentTimestamp" : "0x0", + "currentGasLimit" : "0xff112233445566", + "previousHash" : "0xb271e9e5796d0ff5a2fd519ba666393e42d4f38680854761121d84a7a96ff017", + "parentTimestamp" : "0x00", + "parentDifficulty" : "0x00", + "parentUncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "currentRandom" : "0x0000000000000000000000000000000000000000000000000000000000020000", + "parentBaseFee" : "0x0b", + "parentGasUsed" : "0x00", + "parentGasLimit" : "0xff112233445566", + "blockHashes" : { + "0" : "0xb271e9e5796d0ff5a2fd519ba666393e42d4f38680854761121d84a7a96ff017" + }, + "currentDifficulty": "0x0" + } + }, + "stdout": { + "alloc": { + "0x0000000000000000000000000000000000000000": { + "balance": "0x696c2" + }, + "0x1000000000000000000000000000000000000000": { + "code": "0x6010565b6000828201905092915050565b601a600260016003565b60005560206000f3", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000000003" + }, + "balance": "0xba1a9ce0ba1a9ce" + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "0xba1a9ce0b9b130c", + "nonce": "0x1" + } + }, + "body": "0xf862f860800a8307a12094100000000000000000000000000000000000000080801ca091df80a63242846dcf1cc16c35e6ba39212cde92aad946f9c286fa0029782b54a0446170c2fb714c717885485ea7d93bf9277f3fb3d89ffd73e9b7f5f8eda3997b", + "result": { + "stateRoot": "0xde762e485411037c02119ff1115b422945b37efe91f4135dd442c3346629d0ef", + "txRoot": "0x8e987be72f36f97a98838e03d9e5d1b3d22795606240f16684532b1c994b4ee7", + "receiptsRoot": "0x0812e2d0238699cad1dd4c1274804ed2dde9a35df8ee002d48bbf3ef87857a63", + "logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "receipts": [ + { + "root": "0x", + "status": "0x1", + "cumulativeGasUsed": "0xa8ad", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logs": null, + "transactionHash": "0x6c4a22ee7d2d9ae9307b09aac69a34600978e34313088917a7e69fd12e8f959a", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0xa8ad", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x0" + } + ], + "currentDifficulty": null, + "gasUsed": "0xa8ad" + } + } +} \ No newline at end of file diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java index 3433e306c89..c95254f3a12 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestEnv.java @@ -163,7 +163,7 @@ public BlockHeader updateFromParentValues(final ProtocolSpec protocolSpec) { .computeBaseFee( number, Wei.fromHexString(parentBaseFee), - Long.parseLong(parentGasUsed), + Long.decode(parentGasUsed), gasLimit / 2)); } if (difficulty == null && parentDifficulty != null) { From 745d624f275b856ca9b6f1065aafc830a01fa4bc Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Fri, 24 Feb 2023 12:12:44 -0700 Subject: [PATCH 2/2] no block rewards in london Signed-off-by: Danno Ferrin --- .../besu/evmtool/t8n/london-hex.json | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/london-hex.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/london-hex.json index a66c7dcd951..15ae26d33ca 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/london-hex.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/t8n/london-hex.json @@ -43,22 +43,21 @@ "s": "0x0" } ], - "env": - { + "env": { "currentCoinbase": "0x0000000000000000000000000000000000000000", - "currentNumber" : "0x1", - "currentTimestamp" : "0x0", - "currentGasLimit" : "0xff112233445566", - "previousHash" : "0xb271e9e5796d0ff5a2fd519ba666393e42d4f38680854761121d84a7a96ff017", - "parentTimestamp" : "0x00", - "parentDifficulty" : "0x00", - "parentUncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "currentRandom" : "0x0000000000000000000000000000000000000000000000000000000000020000", - "parentBaseFee" : "0x0b", - "parentGasUsed" : "0x00", - "parentGasLimit" : "0xff112233445566", - "blockHashes" : { - "0" : "0xb271e9e5796d0ff5a2fd519ba666393e42d4f38680854761121d84a7a96ff017" + "currentNumber": "0x1", + "currentTimestamp": "0x0", + "currentGasLimit": "0xff112233445566", + "previousHash": "0xb271e9e5796d0ff5a2fd519ba666393e42d4f38680854761121d84a7a96ff017", + "parentTimestamp": "0x00", + "parentDifficulty": "0x00", + "parentUncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "currentRandom": "0x0000000000000000000000000000000000000000000000000000000000020000", + "parentBaseFee": "0x0b", + "parentGasUsed": "0x00", + "parentGasLimit": "0xff112233445566", + "blockHashes": { + "0": "0xb271e9e5796d0ff5a2fd519ba666393e42d4f38680854761121d84a7a96ff017" }, "currentDifficulty": "0x0" } @@ -66,7 +65,7 @@ "stdout": { "alloc": { "0x0000000000000000000000000000000000000000": { - "balance": "0x696c2" + "balance": "0x0" }, "0x1000000000000000000000000000000000000000": { "code": "0x6010565b6000828201905092915050565b601a600260016003565b60005560206000f3", @@ -82,7 +81,7 @@ }, "body": "0xf862f860800a8307a12094100000000000000000000000000000000000000080801ca091df80a63242846dcf1cc16c35e6ba39212cde92aad946f9c286fa0029782b54a0446170c2fb714c717885485ea7d93bf9277f3fb3d89ffd73e9b7f5f8eda3997b", "result": { - "stateRoot": "0xde762e485411037c02119ff1115b422945b37efe91f4135dd442c3346629d0ef", + "stateRoot": "0x32c517c68424f758724f80f6f1d6e470d43c7be876c62b32096f49574f5d541e", "txRoot": "0x8e987be72f36f97a98838e03d9e5d1b3d22795606240f16684532b1c994b4ee7", "receiptsRoot": "0x0812e2d0238699cad1dd4c1274804ed2dde9a35df8ee002d48bbf3ef87857a63", "logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", @@ -102,7 +101,8 @@ } ], "currentDifficulty": null, - "gasUsed": "0xa8ad" + "gasUsed": "0xa8ad", + "currentBaseFee": "0xa" } } } \ No newline at end of file