diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java index 8416b499bc2..3456df2e6a1 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/processor/TransactionTracer.java @@ -135,7 +135,9 @@ public List traceTransactionToFile( stackedUpdater, transaction, transactionProcessor, - new StandardJsonTracer(out, showMemory, true, true, false), + // FIXME // REVIEWME do we want to change the JSON + // debug calls to use EIP-7756 values for gas and opcode? + new StandardJsonTracer(out, showMemory, true, true, false, true), blobGasPrice); out.println( summaryTrace( diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java index 0ff6a21da83..cf493b8c4e8 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java @@ -199,6 +199,13 @@ void setBytes(final String optionValue) { scope = INHERIT) final Boolean showJsonAlloc = false; + @Option( + names = {"--eip-3155", "--trace.eip-3155"}, + description = "Produce a trace with types strictly compatible with EIP-3155.", + scope = INHERIT, + negatable = true) + final Boolean eip3155strict = false; + @Option( names = {"--memory", "--trace.memory"}, description = @@ -440,7 +447,8 @@ public void run() { final OperationTracer tracer = // You should have picked Mercy. lastLoop && showJsonResults - ? new StandardJsonTracer(out, showMemory, !hideStack, showReturnData, showStorage) + ? new StandardJsonTracer( + out, showMemory, !hideStack, showReturnData, showStorage, eip3155strict) : OperationTracer.NO_TRACING; WorldUpdater updater = component.getWorldUpdater(); diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java index b15aec6b9d0..144958692e0 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/StateTestSubCommand.java @@ -208,7 +208,8 @@ private void traceTestSpecs(final String test, final List logs = result.getLogs(); final Hash actualLogsHash = Hash.hash(RLP.encode(out -> out.writeList(logs, Log::writeTo))); summaryLine.put("postLogsHash", actualLogsHash.toHexString()); diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java index ffa6e67b72f..b78590ca19d 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nServerSubCommand.java @@ -209,7 +209,8 @@ public OperationTracer getManagedTracer(final int txIndex, final Hash txHash) parentCommand.showMemory, !parentCommand.hideStack, parentCommand.showReturnData, - parentCommand.showStorage); + parentCommand.showStorage, + parentCommand.eip3155strict); outputStreams.put(jsonTracer, traceDest); return jsonTracer; } diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java index d6db1a1e8d2..c0155fd1339 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/T8nSubCommand.java @@ -279,7 +279,8 @@ public OperationTracer getManagedTracer(final int txIndex, final Hash txHash) parentCommand.showMemory, !parentCommand.hideStack, parentCommand.showReturnData, - parentCommand.showStorage); + parentCommand.showStorage, + parentCommand.eip3155strict); outputStreams.put(jsonTracer, traceDest); return jsonTracer; } diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/all-trace-flags-disabled.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/all-trace-flags-disabled.json index adaa08952fd..c9337440dba 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/all-trace-flags-disabled.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/all-trace-flags-disabled.json @@ -77,30 +77,30 @@ } }, "stdout": [ - {"pc":0,"op":96,"gas":"0x9ffffadf8","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":96,"gas":"0x9ffffadf5","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":4,"op":96,"gas":"0x9ffffadf2","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x9ffffadef","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":96,"gas":"0x9ffffadec","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":10,"op":115,"gas":"0x9ffffade9","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH20"}, - {"pc":31,"op":100,"gas":"0x9ffffade6","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH5"}, - {"pc":37,"op":241,"gas":"0x9ffffade3","gasCost":"0x900000a28","memSize":0,"depth":1,"refund":0,"opName":"CALL"}, - {"pc":0,"op":125,"gas":"0x900000000","gasCost":"0x3","memSize":0,"depth":2,"refund":0,"opName":"PUSH30"}, - {"pc":31,"op":96,"gas":"0x8fffffffd","gasCost":"0x3","memSize":0,"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":33,"op":82,"gas":"0x8fffffffa","gasCost":"0x6","memSize":0,"depth":2,"refund":0,"opName":"MSTORE"}, - {"pc":34,"op":96,"gas":"0x8fffffff4","gasCost":"0x3","memSize":32,"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":36,"op":96,"gas":"0x8fffffff1","gasCost":"0x3","memSize":32,"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":38,"op":243,"gas":"0x8ffffffee","gasCost":"0x0","memSize":32,"depth":2,"refund":0,"opName":"RETURN"}, - {"pc":38,"op":80,"gas":"0x9ffffa3a9","gasCost":"0x2","memSize":0,"depth":1,"refund":0,"opName":"POP"}, - {"pc":39,"op":96,"gas":"0x9ffffa3a7","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":41,"op":96,"gas":"0x9ffffa3a4","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":43,"op":96,"gas":"0x9ffffa3a1","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":45,"op":62,"gas":"0x9ffffa39e","gasCost":"0x9","memSize":0,"depth":1,"refund":0,"opName":"RETURNDATACOPY"}, - {"pc":46,"op":96,"gas":"0x9ffffa395","gasCost":"0x3","memSize":32,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":48,"op":81,"gas":"0x9ffffa392","gasCost":"0x3","memSize":32,"depth":1,"refund":0,"opName":"MLOAD"}, - {"pc":49,"op":96,"gas":"0x9ffffa38f","gasCost":"0x3","memSize":32,"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":51,"op":85,"gas":"0x9ffffa38c","gasCost":"0x1388","memSize":32,"depth":1,"refund":0,"opName":"SSTORE"}, - {"pc":52,"op":0,"gas":"0x9ffff9004","gasCost":"0x0","memSize":32,"depth":1,"refund":0,"opName":"STOP"}, - {"output":"","gasUsed":"0x6ffc","test":"returndatacopy_following_call","fork":"London","d":0,"g":0,"v":0,"postHash":"0x1c6dda42e80135b6d5ff1a664e6f85e8552d5c56888bb35e2e694f3829a500c7","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true} + {"pc":0,"op":"0x60","gas":42949651960,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x60","gas":42949651957,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":4,"op":"0x60","gas":42949651954,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":42949651951,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x60","gas":42949651948,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":10,"op":"0x73","gas":42949651945,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH20"}, + {"pc":31,"op":"0x64","gas":42949651942,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH5"}, + {"pc":37,"op":"0xf1","gas":42949651939,"gasCost":38654708264,"memSize":0,"depth":1,"refund":0,"opName":"CALL"}, + {"pc":0,"op":"0x7d","gas":38654705664,"gasCost":3,"memSize":0,"depth":2,"refund":0,"opName":"PUSH30"}, + {"pc":31,"op":"0x60","gas":38654705661,"gasCost":3,"memSize":0,"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":33,"op":"0x52","gas":38654705658,"gasCost":6,"memSize":0,"depth":2,"refund":0,"opName":"MSTORE"}, + {"pc":34,"op":"0x60","gas":38654705652,"gasCost":3,"memSize":32,"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":36,"op":"0x60","gas":38654705649,"gasCost":3,"memSize":32,"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":38,"op":"0xf3","gas":38654705646,"gasCost":0,"memSize":32,"depth":2,"refund":0,"opName":"RETURN"}, + {"pc":38,"op":"0x50","gas":42949649321,"gasCost":2,"memSize":0,"depth":1,"refund":0,"opName":"POP"}, + {"pc":39,"op":"0x60","gas":42949649319,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":41,"op":"0x60","gas":42949649316,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":43,"op":"0x60","gas":42949649313,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":45,"op":"0x3e","gas":42949649310,"gasCost":9,"memSize":0,"depth":1,"refund":0,"opName":"RETURNDATACOPY"}, + {"pc":46,"op":"0x60","gas":42949649301,"gasCost":3,"memSize":32,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":48,"op":"0x51","gas":42949649298,"gasCost":3,"memSize":32,"depth":1,"refund":0,"opName":"MLOAD"}, + {"pc":49,"op":"0x60","gas":42949649295,"gasCost":3,"memSize":32,"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":51,"op":"0x55","gas":42949649292,"gasCost":5000,"memSize":32,"depth":1,"refund":0,"opName":"SSTORE"}, + {"pc":52,"op":"0x00","gas":42949644292,"gasCost":0,"memSize":32,"depth":1,"refund":0,"opName":"STOP"}, + {"output":"","gasUsed":28668,"test":"returndatacopy_following_call","fork":"London","d":0,"g":0,"v":0,"stateRoot":"0x1c6dda42e80135b6d5ff1a664e6f85e8552d5c56888bb35e2e694f3829a500c7","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/all-trace-flags.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/all-trace-flags.json index 315b85b3a9d..3aba1a0baad 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/all-trace-flags.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/all-trace-flags.json @@ -6,6 +6,7 @@ "--trace.memory", "--trace.stack", "--trace.returndata", + "--trace.eip-3155", "--notime" ], "stdin": { @@ -101,6 +102,6 @@ {"pc":49,"op":96,"gas":"0x9ffffa38f","gasCost":"0x3","memory":"0x0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","memSize":32,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff"],"returnData":"0x0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","depth":1,"refund":0,"opName":"PUSH1"}, {"pc":51,"op":85,"gas":"0x9ffffa38c","gasCost":"0x1388","memory":"0x0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","memSize":32,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","0x0"],"returnData":"0x0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","depth":1,"refund":0,"opName":"SSTORE"}, {"pc":52,"op":0,"gas":"0x9ffff9004","gasCost":"0x0","memory":"0x0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","memSize":32,"stack":[],"returnData":"0x0000111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","depth":1,"refund":0,"opName":"STOP"}, - {"output":"","gasUsed":"0x6ffc","test":"returndatacopy_following_call","fork":"London","d":0,"g":0,"v":0,"postHash":"0x1c6dda42e80135b6d5ff1a664e6f85e8552d5c56888bb35e2e694f3829a500c7","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true} + {"output":"","gasUsed":"0x6ffc","test":"returndatacopy_following_call","fork":"London","d":0,"g":0,"v":0,"stateRoot":"0x1c6dda42e80135b6d5ff1a664e6f85e8552d5c56888bb35e2e694f3829a500c7","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/blockhash.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/blockhash.json index ad87a8238f4..2a595bf304b 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/blockhash.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/blockhash.json @@ -74,31 +74,31 @@ } }, "stdout": [ - {"pc":0,"op":96,"gas":"0x79bc70","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":96,"gas":"0x79bc6d","gasCost":"0x3","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":4,"op":96,"gas":"0x79bc6a","gasCost":"0x3","memSize":0,"stack":["0x0","0x1"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x79bc67","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":96,"gas":"0x79bc64","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":10,"op":97,"gas":"0x79bc61","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2"],"depth":1,"refund":0,"opName":"PUSH2"}, - {"pc":13,"op":97,"gas":"0x79bc5e","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0x1f4"],"depth":1,"refund":0,"opName":"PUSH2"}, - {"pc":16,"op":88,"gas":"0x79bc5b","gasCost":"0x2","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0x1f4","0xffff"],"depth":1,"refund":0,"opName":"PC"}, - {"pc":17,"op":23,"gas":"0x79bc59","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0x1f4","0xffff","0x10"],"depth":1,"refund":0,"opName":"OR"}, - {"pc":18,"op":144,"gas":"0x79bc56","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0x1f4","0xffff"],"depth":1,"refund":0,"opName":"SWAP1"}, - {"pc":19,"op":124,"gas":"0x79bc53","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4"],"depth":1,"refund":0,"opName":"PUSH29"}, - {"pc":49,"op":131,"gas":"0x79bc50","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913"],"depth":1,"refund":0,"opName":"DUP4"}, - {"pc":50,"op":97,"gas":"0x79bc4d","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2"],"depth":1,"refund":0,"opName":"PUSH2"}, - {"pc":53,"op":137,"gas":"0x79bc4a","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389"],"depth":1,"refund":0,"opName":"DUP10"}, - {"pc":54,"op":95,"gas":"0x79bc47","gasCost":"0x2","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0"],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":55,"op":138,"gas":"0x79bc45","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0"],"depth":1,"refund":0,"opName":"DUP11"}, - {"pc":56,"op":91,"gas":"0x79bc42","gasCost":"0x1","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1"],"depth":1,"refund":0,"opName":"JUMPDEST"}, - {"pc":57,"op":130,"gas":"0x79bc41","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1"],"depth":1,"refund":0,"opName":"DUP3"}, - {"pc":58,"op":114,"gas":"0x79bc3e","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0"],"depth":1,"refund":0,"opName":"PUSH19"}, - {"pc":78,"op":131,"gas":"0x79bc3b","gasCost":"0x3","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273"],"depth":1,"refund":0,"opName":"DUP4"}, - {"pc":79,"op":64,"gas":"0x79bc38","gasCost":"0x14","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0x0"],"depth":1,"refund":0,"opName":"BLOCKHASH"}, - {"pc":80,"op":65,"gas":"0x79bc24","gasCost":"0x2","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d"],"depth":1,"refund":0,"opName":"COINBASE"}, - {"pc":81,"op":72,"gas":"0x79bc22","gasCost":"0x2","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d","0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b"],"depth":1,"refund":0,"opName":"BASEFEE"}, - {"pc":82,"op":8,"gas":"0x79bc20","gasCost":"0x8","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d","0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b","0x10"],"depth":1,"refund":0,"opName":"ADDMOD"}, - {"pc":83,"op":62,"gas":"0x79bc18","gasCost":"0x0","memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0xb94f5374fce5edbc8e2a8697c15331677e6ebf1b"],"depth":1,"refund":0,"opName":"RETURNDATACOPY","error":"Out of bounds"}, - {"output":"","gasUsed":"0x7a1200","test":"00000936-mixed-1","fork":"Shanghai","d":0,"g":0,"v":0,"postHash":"0xd14c10ed22a1cfb642e374be985ac581c39f3969bd59249e0405aca3beb47a47","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":false,"error":"INVALID_RETURN_DATA_BUFFER_ACCESS"} + {"pc":0,"op":"0x60","gas":7978096,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x60","gas":7978093,"gasCost":3,"memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":4,"op":"0x60","gas":7978090,"gasCost":3,"memSize":0,"stack":["0x0","0x1"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":7978087,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x60","gas":7978084,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":10,"op":"0x61","gas":7978081,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2"],"depth":1,"refund":0,"opName":"PUSH2"}, + {"pc":13,"op":"0x61","gas":7978078,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0x1f4"],"depth":1,"refund":0,"opName":"PUSH2"}, + {"pc":16,"op":"0x58","gas":7978075,"gasCost":2,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0x1f4","0xffff"],"depth":1,"refund":0,"opName":"PC"}, + {"pc":17,"op":"0x17","gas":7978073,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0x1f4","0xffff","0x10"],"depth":1,"refund":0,"opName":"OR"}, + {"pc":18,"op":"0x90","gas":7978070,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0x1f4","0xffff"],"depth":1,"refund":0,"opName":"SWAP1"}, + {"pc":19,"op":"0x7c","gas":7978067,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4"],"depth":1,"refund":0,"opName":"PUSH29"}, + {"pc":49,"op":"0x83","gas":7978064,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913"],"depth":1,"refund":0,"opName":"DUP4"}, + {"pc":50,"op":"0x61","gas":7978061,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2"],"depth":1,"refund":0,"opName":"PUSH2"}, + {"pc":53,"op":"0x89","gas":7978058,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389"],"depth":1,"refund":0,"opName":"DUP10"}, + {"pc":54,"op":"0x5f","gas":7978055,"gasCost":2,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0"],"depth":1,"refund":0,"opName":"PUSH0"}, + {"pc":55,"op":"0x8a","gas":7978053,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0"],"depth":1,"refund":0,"opName":"DUP11"}, + {"pc":56,"op":"0x5b","gas":7978050,"gasCost":1,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1"],"depth":1,"refund":0,"opName":"JUMPDEST"}, + {"pc":57,"op":"0x82","gas":7978049,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1"],"depth":1,"refund":0,"opName":"DUP3"}, + {"pc":58,"op":"0x72","gas":7978046,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0"],"depth":1,"refund":0,"opName":"PUSH19"}, + {"pc":78,"op":"0x83","gas":7978043,"gasCost":3,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273"],"depth":1,"refund":0,"opName":"DUP4"}, + {"pc":79,"op":"0x40","gas":7978040,"gasCost":20,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0x0"],"depth":1,"refund":0,"opName":"BLOCKHASH"}, + {"pc":80,"op":"0x41","gas":7978020,"gasCost":2,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d"],"depth":1,"refund":0,"opName":"COINBASE"}, + {"pc":81,"op":"0x48","gas":7978018,"gasCost":2,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d","0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b"],"depth":1,"refund":0,"opName":"BASEFEE"}, + {"pc":82,"op":"0x08","gas":7978016,"gasCost":8,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d","0xb94f5374fce5edbc8e2a8697c15331677e6ebf0b","0x10"],"depth":1,"refund":0,"opName":"ADDMOD"}, + {"pc":83,"op":"0x3e","gas":7978008,"gasCost":0,"memSize":0,"stack":["0x0","0x1","0x1","0x2","0x2","0xffff","0x1f4","0x78859e5b97166c486532b1595a673e9f9073643f1b519c6f18511b9913","0x2","0x389","0x0","0x0","0x1","0x0","0x3e3d6d5ff042148d326c1898713a76759ca273","0xb94f5374fce5edbc8e2a8697c15331677e6ebf1b"],"depth":1,"refund":0,"opName":"RETURNDATACOPY","error":"Out of bounds"}, + {"output":"","gasUsed":8000000,"test":"00000936-mixed-1","fork":"Shanghai","d":0,"g":0,"v":0,"stateRoot":"0xd14c10ed22a1cfb642e374be985ac581c39f3969bd59249e0405aca3beb47a47","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":false,"error":"INVALID_RETURN_DATA_BUFFER_ACCESS"} ] } diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-eof.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-eof.json index 72ada37da7b..733d310ffb2 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-eof.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-eof.json @@ -71,16 +71,16 @@ } }, "stdout": [ - {"pc":0,"section":0,"op":95,"gas":"0x794068","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":1,"section":0,"op":53,"gas":"0x794066","gasCost":"0x3","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"CALLDATALOAD"}, - {"pc":2,"section":0,"op":95,"gas":"0x794063","gasCost":"0x2","memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000"],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":3,"section":0,"op":95,"gas":"0x794061","gasCost":"0x2","memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000","0x0"],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":4,"section":0,"op":161,"gas":"0x79405f","gasCost":"0x2ee","memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000","0x0","0x0"],"depth":1,"refund":0,"opName":"LOG1"}, - {"pc":5,"section":0,"op":95,"gas":"0x793d71","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":6,"section":0,"op":95,"gas":"0x793d6f","gasCost":"0x2","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":7,"section":0,"op":238,"immediate":"0x00","gas":"0x793d6d","gasCost":"0x0","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"RETURNCONTRACT"}, - {"output":"","gasUsed":"0xe433","test":"create-eof","fork":"Osaka","d":0,"g":0,"v":0,"postHash":"0x1a8642a04dae90535f00f53d3a30284c4db051d508a653db89eb100ba9aecbf3","postLogsHash":"0xf48b954a6a6f4ce6b28e4950b7027413f4bdc8f459df6003b6e8d7a1567c8940","pass":true}, - {"pc":0,"op":239,"gas":"0x794068","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"}, - {"output":"","gasUsed":"0x7a1200","test":"create-eof","fork":"Cancun","d":0,"g":0,"v":0,"postHash":"0xaa80d89bc89f58da8de41d3894bd1a241896ff91f7a5964edaefb39e8e3a4a98","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true,"error":"INVALID_OPERATION"} + {"pc":24,"section":0,"op":"0x5f","gas":7946344,"gasCost":2,"memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":25,"section":0,"op":"0x35","gas":7946342,"gasCost":3,"memSize":0,"stack":["0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"CALLDATALOAD"}, + {"pc":26,"section":0,"op":"0x5f","gas":7946339,"gasCost":2,"memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000"],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":27,"section":0,"op":"0x5f","gas":7946337,"gasCost":2,"memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000","0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":28,"section":0,"op":"0xa1","gas":7946335,"gasCost":750,"memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000","0x0","0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"LOG1"}, + {"pc":29,"section":0,"op":"0x5f","gas":7945585,"gasCost":2,"memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":30,"section":0,"op":"0x5f","gas":7945583,"gasCost":2,"memSize":0,"stack":["0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":31,"section":0,"op":"0xee","immediate":"0x00","gas":7945581,"gasCost":0,"memSize":0,"stack":["0x0","0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"RETURNCONTRACT"}, + {"output":"","gasUsed":58419,"test":"create-eof","fork":"Osaka","d":0,"g":0,"v":0,"stateRoot":"0x1a8642a04dae90535f00f53d3a30284c4db051d508a653db89eb100ba9aecbf3","postLogsHash":"0xf48b954a6a6f4ce6b28e4950b7027413f4bdc8f459df6003b6e8d7a1567c8940","pass":true}, + {"pc":0,"op":"0xef","gas":7946344,"gasCost":0,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"}, + {"output":"","gasUsed":8000000,"test":"create-eof","fork":"Cancun","d":0,"g":0,"v":0,"stateRoot":"0xaa80d89bc89f58da8de41d3894bd1a241896ff91f7a5964edaefb39e8e3a4a98","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true,"error":"INVALID_OPERATION"} ] } diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-invalid-eof.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-invalid-eof.json index f3448aa5a27..db1c276c0cb 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-invalid-eof.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/create-invalid-eof.json @@ -71,8 +71,8 @@ } }, "stdout": [ - {"output":"","gasUsed":"0xd198","test":"create-eof","fork":"Osaka","d":0,"g":0,"v":0,"postHash":"0x2a9c58298ba5d4ec86ca682b9fcc9ff67c3fc44dbd39f85a2f9b74bfe4e5178e","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":false,"error":"Invalid EOF Layout: unexpected_header_kind expected 1 actual 17"}, - {"pc":0,"op":239,"gas":"0x794068","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"}, - {"output":"","gasUsed":"0x7a1200","test":"create-eof","fork":"Cancun","d":0,"g":0,"v":0,"postHash":"0xaa80d89bc89f58da8de41d3894bd1a241896ff91f7a5964edaefb39e8e3a4a98","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true,"error":"INVALID_OPERATION"} + {"output":"","gasUsed":53656,"test":"create-eof","fork":"Osaka","d":0,"g":0,"v":0,"stateRoot":"0x2a9c58298ba5d4ec86ca682b9fcc9ff67c3fc44dbd39f85a2f9b74bfe4e5178e","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":false,"error":"Invalid EOF Layout: unexpected_header_kind expected 1 actual 17"}, + {"pc":0,"op":"0xef","gas":7946344,"gasCost":0,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"}, + {"output":"","gasUsed":8000000,"test":"create-eof","fork":"Cancun","d":0,"g":0,"v":0,"stateRoot":"0xaa80d89bc89f58da8de41d3894bd1a241896ff91f7a5964edaefb39e8e3a4a98","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true,"error":"INVALID_OPERATION"} ] } diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/no-memory.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/no-memory.json index f735eb23d17..80643b66eaa 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/no-memory.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/no-memory.json @@ -75,30 +75,30 @@ } }, "stdout": [ - {"pc":0,"op":96,"gas":"0x9ffffadf8","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":96,"gas":"0x9ffffadf5","gasCost":"0x3","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":4,"op":96,"gas":"0x9ffffadf2","gasCost":"0x3","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x9ffffadef","gasCost":"0x3","memSize":0,"stack":["0x0","0x0","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":96,"gas":"0x9ffffadec","gasCost":"0x3","memSize":0,"stack":["0x0","0x0","0x0","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":10,"op":115,"gas":"0x9ffffade9","gasCost":"0x3","memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0"],"depth":1,"refund":0,"opName":"PUSH20"}, - {"pc":31,"op":100,"gas":"0x9ffffade6","gasCost":"0x3","memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0","0xaabbccdd5c57f15886f9b263e2f6d2d6c7b5ec6"],"depth":1,"refund":0,"opName":"PUSH5"}, - {"pc":37,"op":241,"gas":"0x9ffffade3","gasCost":"0x900000a28","memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0","0xaabbccdd5c57f15886f9b263e2f6d2d6c7b5ec6","0x900000000"],"depth":1,"refund":0,"opName":"CALL"}, - {"pc":0,"op":125,"gas":"0x900000000","gasCost":"0x3","memSize":0,"stack":[],"depth":2,"refund":0,"opName":"PUSH30"}, - {"pc":31,"op":96,"gas":"0x8fffffffd","gasCost":"0x3","memSize":0,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":33,"op":82,"gas":"0x8fffffffa","gasCost":"0x6","memSize":0,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","0x0"],"depth":2,"refund":0,"opName":"MSTORE"}, - {"pc":34,"op":96,"gas":"0x8fffffff4","gasCost":"0x3","memSize":32,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":36,"op":96,"gas":"0x8fffffff1","gasCost":"0x3","memSize":32,"stack":["0x20"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":38,"op":243,"gas":"0x8ffffffee","gasCost":"0x0","memSize":32,"stack":["0x20","0x0"],"depth":2,"refund":0,"opName":"RETURN"}, - {"pc":38,"op":80,"gas":"0x9ffffa3a9","gasCost":"0x2","memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"POP"}, - {"pc":39,"op":96,"gas":"0x9ffffa3a7","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":41,"op":96,"gas":"0x9ffffa3a4","gasCost":"0x3","memSize":0,"stack":["0x20"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":43,"op":96,"gas":"0x9ffffa3a1","gasCost":"0x3","memSize":0,"stack":["0x20","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":45,"op":62,"gas":"0x9ffffa39e","gasCost":"0x9","memSize":0,"stack":["0x20","0x0","0x0"],"depth":1,"refund":0,"opName":"RETURNDATACOPY"}, - {"pc":46,"op":96,"gas":"0x9ffffa395","gasCost":"0x3","memSize":32,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":48,"op":81,"gas":"0x9ffffa392","gasCost":"0x3","memSize":32,"stack":["0x0"],"depth":1,"refund":0,"opName":"MLOAD"}, - {"pc":49,"op":96,"gas":"0x9ffffa38f","gasCost":"0x3","memSize":32,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":51,"op":85,"gas":"0x9ffffa38c","gasCost":"0x1388","memSize":32,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","0x0"],"depth":1,"refund":0,"opName":"SSTORE"}, - {"pc":52,"op":0,"gas":"0x9ffff9004","gasCost":"0x0","memSize":32,"stack":[],"depth":1,"refund":0,"opName":"STOP"}, - {"output":"","gasUsed":"0x6ffc","test":"returndatacopy_following_call","fork":"London","d":0,"g":0,"v":0,"postHash":"0x1c6dda42e80135b6d5ff1a664e6f85e8552d5c56888bb35e2e694f3829a500c7","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true} + {"pc":0,"op":"0x60","gas":42949651960,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x60","gas":42949651957,"gasCost":3,"memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":4,"op":"0x60","gas":42949651954,"gasCost":3,"memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":42949651951,"gasCost":3,"memSize":0,"stack":["0x0","0x0","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x60","gas":42949651948,"gasCost":3,"memSize":0,"stack":["0x0","0x0","0x0","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":10,"op":"0x73","gas":42949651945,"gasCost":3,"memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0"],"depth":1,"refund":0,"opName":"PUSH20"}, + {"pc":31,"op":"0x64","gas":42949651942,"gasCost":3,"memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0","0xaabbccdd5c57f15886f9b263e2f6d2d6c7b5ec6"],"depth":1,"refund":0,"opName":"PUSH5"}, + {"pc":37,"op":"0xf1","gas":42949651939,"gasCost":38654708264,"memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0","0xaabbccdd5c57f15886f9b263e2f6d2d6c7b5ec6","0x900000000"],"depth":1,"refund":0,"opName":"CALL"}, + {"pc":0,"op":"0x7d","gas":38654705664,"gasCost":3,"memSize":0,"stack":[],"depth":2,"refund":0,"opName":"PUSH30"}, + {"pc":31,"op":"0x60","gas":38654705661,"gasCost":3,"memSize":0,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":33,"op":"0x52","gas":38654705658,"gasCost":6,"memSize":0,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","0x0"],"depth":2,"refund":0,"opName":"MSTORE"}, + {"pc":34,"op":"0x60","gas":38654705652,"gasCost":3,"memSize":32,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":36,"op":"0x60","gas":38654705649,"gasCost":3,"memSize":32,"stack":["0x20"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":38,"op":"0xf3","gas":38654705646,"gasCost":0,"memSize":32,"stack":["0x20","0x0"],"depth":2,"refund":0,"opName":"RETURN"}, + {"pc":38,"op":"0x50","gas":42949649321,"gasCost":2,"memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"POP"}, + {"pc":39,"op":"0x60","gas":42949649319,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":41,"op":"0x60","gas":42949649316,"gasCost":3,"memSize":0,"stack":["0x20"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":43,"op":"0x60","gas":42949649313,"gasCost":3,"memSize":0,"stack":["0x20","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":45,"op":"0x3e","gas":42949649310,"gasCost":9,"memSize":0,"stack":["0x20","0x0","0x0"],"depth":1,"refund":0,"opName":"RETURNDATACOPY"}, + {"pc":46,"op":"0x60","gas":42949649301,"gasCost":3,"memSize":32,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":48,"op":"0x51","gas":42949649298,"gasCost":3,"memSize":32,"stack":["0x0"],"depth":1,"refund":0,"opName":"MLOAD"}, + {"pc":49,"op":"0x60","gas":42949649295,"gasCost":3,"memSize":32,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":51,"op":"0x55","gas":42949649292,"gasCost":5000,"memSize":32,"stack":["0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff","0x0"],"depth":1,"refund":0,"opName":"SSTORE"}, + {"pc":52,"op":"0x00","gas":42949644292,"gasCost":0,"memSize":32,"stack":[],"depth":1,"refund":0,"opName":"STOP"}, + {"output":"","gasUsed":28668,"test":"returndatacopy_following_call","fork":"London","d":0,"g":0,"v":0,"stateRoot":"0x1c6dda42e80135b6d5ff1a664e6f85e8552d5c56888bb35e2e694f3829a500c7","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/shanghai-blockhash.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/shanghai-blockhash.json index b048e11e2a7..6e5ceb179a5 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/shanghai-blockhash.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/state-test/shanghai-blockhash.json @@ -64,19 +64,19 @@ } }, "stdout": [ - {"pc":0,"op":96,"gas":"0x79bff8","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":64,"gas":"0x79bff5","gasCost":"0x14","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"BLOCKHASH"}, - {"pc":3,"op":96,"gas":"0x79bfe1","gasCost":"0x3","memSize":0,"stack":["0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":5,"op":85,"gas":"0x79bfde","gasCost":"0x5654","memSize":0,"stack":["0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d","0x0"],"depth":1,"refund":0,"opName":"SSTORE"}, - {"pc":6,"op":96,"gas":"0x79698a","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":64,"gas":"0x796987","gasCost":"0x14","memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"BLOCKHASH"}, - {"pc":9,"op":96,"gas":"0x796973","gasCost":"0x3","memSize":0,"stack":["0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":11,"op":85,"gas":"0x796970","gasCost":"0x5654","memSize":0,"stack":["0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6","0x1"],"depth":1,"refund":0,"opName":"SSTORE"}, - {"pc":12,"op":67,"gas":"0x79131c","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"NUMBER"}, - {"pc":13,"op":64,"gas":"0x79131a","gasCost":"0x14","memSize":0,"stack":["0x2"],"depth":1,"refund":0,"opName":"BLOCKHASH"}, - {"pc":14,"op":96,"gas":"0x791306","gasCost":"0x3","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":16,"op":85,"gas":"0x791303","gasCost":"0x898","memSize":0,"stack":["0x0","0x2"],"depth":1,"refund":0,"opName":"SSTORE"}, - {"pc":17,"op":0,"gas":"0x790a6b","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"}, - {"output":"","gasUsed":"0x10795","test":"shanghai-blockhash","fork":"Shanghai","d":0,"g":0,"v":0,"postHash":"0xb3967c897314312cf275055d754c6742d351a2a4bcf0121ed2f896971bf56563","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true} + {"pc":0,"op":"0x60","gas":7979000,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x40","gas":7978997,"gasCost":20,"memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"BLOCKHASH"}, + {"pc":3,"op":"0x60","gas":7978977,"gasCost":3,"memSize":0,"stack":["0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":5,"op":"0x55","gas":7978974,"gasCost":22100,"memSize":0,"stack":["0x44852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d","0x0"],"depth":1,"refund":0,"opName":"SSTORE"}, + {"pc":6,"op":"0x60","gas":7956874,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x40","gas":7956871,"gasCost":20,"memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"BLOCKHASH"}, + {"pc":9,"op":"0x60","gas":7956851,"gasCost":3,"memSize":0,"stack":["0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":11,"op":"0x55","gas":7956848,"gasCost":22100,"memSize":0,"stack":["0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6","0x1"],"depth":1,"refund":0,"opName":"SSTORE"}, + {"pc":12,"op":"0x43","gas":7934748,"gasCost":2,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"NUMBER"}, + {"pc":13,"op":"0x40","gas":7934746,"gasCost":20,"memSize":0,"stack":["0x2"],"depth":1,"refund":0,"opName":"BLOCKHASH"}, + {"pc":14,"op":"0x60","gas":7934726,"gasCost":3,"memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":16,"op":"0x55","gas":7934723,"gasCost":2200,"memSize":0,"stack":["0x0","0x2"],"depth":1,"refund":0,"opName":"SSTORE"}, + {"pc":17,"op":"0x00","gas":7932523,"gasCost":0,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"}, + {"output":"","gasUsed":67477,"test":"shanghai-blockhash","fork":"Shanghai","d":0,"g":0,"v":0,"stateRoot":"0xb3967c897314312cf275055d754c6742d351a2a4bcf0121ed2f896971bf56563","postLogsHash":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","pass":true} ] } diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/badcode.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/badcode.json index 78dc43c02e1..d489270af92 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/badcode.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/badcode.json @@ -7,8 +7,8 @@ ], "stdin": "", "stdout": [ - {"pc":0,"op":96,"gas":"0x2540be400","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":239,"gas":"0x2540be3fd","gasCost":"0x0","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"}, + {"pc":0,"op":"0x60","gas":10000000000,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0xef","gas":9999999997,"gasCost":0,"memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"INVALID","error":"Bad instruction"}, {"stateRoot":"0xfc9dc1be50c1b0a497afa545d770cc7064f0d71efbc4338f002dc2e086965d98","output":"0x","gasUsed":"0x2540be400","pass":false,"fork":"Cancun"} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/charge-intrinsic.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/charge-intrinsic.json index 9355c472837..bf465d1ba00 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/charge-intrinsic.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/charge-intrinsic.json @@ -16,60 +16,60 @@ ], "stdin": "", "stdout": [ - {"pc":0,"op":96,"gas":"0x620c","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":128,"gas":"0x6209","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":1,"refund":0,"opName":"DUP1"}, - {"pc":3,"op":83,"gas":"0x6206","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"MSTORE8"}, - {"pc":4,"op":96,"gas":"0x61fa","gasCost":"0x3","memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x61f7","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":85,"gas":"0x61f4","gasCost":"0x5654","memSize":96,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"SSTORE"}, - {"pc":9,"op":96,"gas":"0xba0","gasCost":"0x3","memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":11,"op":96,"gas":"0xb9d","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":13,"op":96,"gas":"0xb9a","gasCost":"0x3","memSize":96,"stack":["0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":15,"op":96,"gas":"0xb97","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":17,"op":96,"gas":"0xb94","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":19,"op":48,"gas":"0xb91","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":1,"refund":0,"opName":"ADDRESS"}, - {"pc":20,"op":90,"gas":"0xb8f","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":1,"refund":0,"opName":"GAS"}, - {"pc":21,"op":241,"gas":"0xb8d","gasCost":"0xb61","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0xb8d"],"depth":1,"refund":0,"opName":"CALL"}, - {"pc":0,"op":96,"gas":"0xafd","gasCost":"0x3","memSize":0,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":128,"gas":"0xafa","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":2,"refund":0,"opName":"DUP1"}, - {"pc":3,"op":83,"gas":"0xaf7","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":2,"refund":0,"opName":"MSTORE8"}, - {"pc":4,"op":96,"gas":"0xaeb","gasCost":"0x3","memSize":96,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0xae8","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":85,"gas":"0xae5","gasCost":"0x64","memSize":96,"stack":["0x40","0x40"],"depth":2,"refund":0,"opName":"SSTORE"}, - {"pc":9,"op":96,"gas":"0xa81","gasCost":"0x3","memSize":96,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":11,"op":96,"gas":"0xa7e","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":13,"op":96,"gas":"0xa7b","gasCost":"0x3","memSize":96,"stack":["0x40","0x0"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":15,"op":96,"gas":"0xa78","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":17,"op":96,"gas":"0xa75","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":19,"op":48,"gas":"0xa72","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":2,"refund":0,"opName":"ADDRESS"}, - {"pc":20,"op":90,"gas":"0xa70","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":2,"refund":0,"opName":"GAS"}, - {"pc":21,"op":241,"gas":"0xa6e","gasCost":"0xa46","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0xa6e"],"depth":2,"refund":0,"opName":"CALL"}, - {"pc":0,"op":96,"gas":"0x9e2","gasCost":"0x3","memSize":0,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":128,"gas":"0x9df","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":3,"refund":0,"opName":"DUP1"}, - {"pc":3,"op":83,"gas":"0x9dc","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":3,"refund":0,"opName":"MSTORE8"}, - {"pc":4,"op":96,"gas":"0x9d0","gasCost":"0x3","memSize":96,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x9cd","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":85,"gas":"0x9ca","gasCost":"0x64","memSize":96,"stack":["0x40","0x40"],"depth":3,"refund":0,"opName":"SSTORE"}, - {"pc":9,"op":96,"gas":"0x966","gasCost":"0x3","memSize":96,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":11,"op":96,"gas":"0x963","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":13,"op":96,"gas":"0x960","gasCost":"0x3","memSize":96,"stack":["0x40","0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":15,"op":96,"gas":"0x95d","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":17,"op":96,"gas":"0x95a","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":19,"op":48,"gas":"0x957","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":3,"refund":0,"opName":"ADDRESS"}, - {"pc":20,"op":90,"gas":"0x955","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":3,"refund":0,"opName":"GAS"}, - {"pc":21,"op":241,"gas":"0x953","gasCost":"0x930","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0x953"],"depth":3,"refund":0,"opName":"CALL"}, - {"pc":0,"op":96,"gas":"0x8cc","gasCost":"0x3","memSize":0,"stack":[],"depth":4,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":128,"gas":"0x8c9","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":4,"refund":0,"opName":"DUP1"}, - {"pc":3,"op":83,"gas":"0x8c6","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":4,"refund":0,"opName":"MSTORE8"}, - {"pc":4,"op":96,"gas":"0x8ba","gasCost":"0x3","memSize":96,"stack":[],"depth":4,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x8b7","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":4,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":85,"gas":"0x8b4","gasCost":"0x8fc","memSize":96,"stack":["0x40","0x40"],"depth":4,"refund":0,"opName":"SSTORE","error":"Out of gas"}, - {"pc":22,"op":96,"gas":"0x23","gasCost":"0x3","memSize":96,"stack":["0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":24,"op":243,"gas":"0x20","gasCost":"0x0","memSize":96,"stack":["0x0","0x40"],"depth":3,"refund":0,"opName":"RETURN"}, - {"pc":22,"op":96,"gas":"0x48","gasCost":"0x3","memSize":96,"stack":["0x1"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":24,"op":243,"gas":"0x45","gasCost":"0x0","memSize":96,"stack":["0x1","0x40"],"depth":2,"refund":0,"opName":"RETURN"}, - {"pc":22,"op":96,"gas":"0x71","gasCost":"0x3","memSize":96,"stack":["0x1"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":24,"op":243,"gas":"0x6e","gasCost":"0x0","memSize":96,"stack":["0x1","0x40"],"depth":1,"refund":0,"opName":"RETURN"}, + {"pc":0,"op":"0x60","gas":25100,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x80","gas":25097,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":1,"refund":0,"opName":"DUP1"}, + {"pc":3,"op":"0x53","gas":25094,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"MSTORE8"}, + {"pc":4,"op":"0x60","gas":25082,"gasCost":3,"memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":25079,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x55","gas":25076,"gasCost":22100,"memSize":96,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"SSTORE"}, + {"pc":9,"op":"0x60","gas":2976,"gasCost":3,"memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":11,"op":"0x60","gas":2973,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":13,"op":"0x60","gas":2970,"gasCost":3,"memSize":96,"stack":["0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":15,"op":"0x60","gas":2967,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":17,"op":"0x60","gas":2964,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":19,"op":"0x30","gas":2961,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":1,"refund":0,"opName":"ADDRESS"}, + {"pc":20,"op":"0x5a","gas":2959,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":1,"refund":0,"opName":"GAS"}, + {"pc":21,"op":"0xf1","gas":2957,"gasCost":2913,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0xb8d"],"depth":1,"refund":0,"opName":"CALL"}, + {"pc":0,"op":"0x60","gas":2813,"gasCost":3,"memSize":0,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x80","gas":2810,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":2,"refund":0,"opName":"DUP1"}, + {"pc":3,"op":"0x53","gas":2807,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":2,"refund":0,"opName":"MSTORE8"}, + {"pc":4,"op":"0x60","gas":2795,"gasCost":3,"memSize":96,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":2792,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x55","gas":2789,"gasCost":100,"memSize":96,"stack":["0x40","0x40"],"depth":2,"refund":0,"opName":"SSTORE"}, + {"pc":9,"op":"0x60","gas":2689,"gasCost":3,"memSize":96,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":11,"op":"0x60","gas":2686,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":13,"op":"0x60","gas":2683,"gasCost":3,"memSize":96,"stack":["0x40","0x0"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":15,"op":"0x60","gas":2680,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":17,"op":"0x60","gas":2677,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":19,"op":"0x30","gas":2674,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":2,"refund":0,"opName":"ADDRESS"}, + {"pc":20,"op":"0x5a","gas":2672,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":2,"refund":0,"opName":"GAS"}, + {"pc":21,"op":"0xf1","gas":2670,"gasCost":2630,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0xa6e"],"depth":2,"refund":0,"opName":"CALL"}, + {"pc":0,"op":"0x60","gas":2530,"gasCost":3,"memSize":0,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x80","gas":2527,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":3,"refund":0,"opName":"DUP1"}, + {"pc":3,"op":"0x53","gas":2524,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":3,"refund":0,"opName":"MSTORE8"}, + {"pc":4,"op":"0x60","gas":2512,"gasCost":3,"memSize":96,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":2509,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x55","gas":2506,"gasCost":100,"memSize":96,"stack":["0x40","0x40"],"depth":3,"refund":0,"opName":"SSTORE"}, + {"pc":9,"op":"0x60","gas":2406,"gasCost":3,"memSize":96,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":11,"op":"0x60","gas":2403,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":13,"op":"0x60","gas":2400,"gasCost":3,"memSize":96,"stack":["0x40","0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":15,"op":"0x60","gas":2397,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":17,"op":"0x60","gas":2394,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":19,"op":"0x30","gas":2391,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":3,"refund":0,"opName":"ADDRESS"}, + {"pc":20,"op":"0x5a","gas":2389,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":3,"refund":0,"opName":"GAS"}, + {"pc":21,"op":"0xf1","gas":2387,"gasCost":2352,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0x953"],"depth":3,"refund":0,"opName":"CALL"}, + {"pc":0,"op":"0x60","gas":2252,"gasCost":3,"memSize":0,"stack":[],"depth":4,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x80","gas":2249,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":4,"refund":0,"opName":"DUP1"}, + {"pc":3,"op":"0x53","gas":2246,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":4,"refund":0,"opName":"MSTORE8"}, + {"pc":4,"op":"0x60","gas":2234,"gasCost":3,"memSize":96,"stack":[],"depth":4,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":2231,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":4,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x55","gas":2228,"gasCost":2300,"memSize":96,"stack":["0x40","0x40"],"depth":4,"refund":0,"opName":"SSTORE","error":"Out of gas"}, + {"pc":22,"op":"0x60","gas":35,"gasCost":3,"memSize":96,"stack":["0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":24,"op":"0xf3","gas":32,"gasCost":0,"memSize":96,"stack":["0x0","0x40"],"depth":3,"refund":0,"opName":"RETURN"}, + {"pc":22,"op":"0x60","gas":72,"gasCost":3,"memSize":96,"stack":["0x1"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":24,"op":"0xf3","gas":69,"gasCost":0,"memSize":96,"stack":["0x1","0x40"],"depth":2,"refund":0,"opName":"RETURN"}, + {"pc":22,"op":"0x60","gas":113,"gasCost":3,"memSize":96,"stack":["0x1"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":24,"op":"0xf3","gas":110,"gasCost":0,"memSize":96,"stack":["0x1","0x40"],"depth":1,"refund":0,"opName":"RETURN"}, {"stateRoot":"0xcb5e8e232189003640b6f131ea2c09b1791ffd2e8357f64610f638e9a11ab2d2","output":"0x40","gasUsed":"0x619e","pass":true,"fork":"Cancun"} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/coinbase-cold.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/coinbase-cold.json index 127d60fc60f..bf84450079a 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/coinbase-cold.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/coinbase-cold.json @@ -11,9 +11,9 @@ ], "stdin": "", "stdout": [ - {"pc":0,"op":65,"gas":"0x2540be400","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"COINBASE"}, - {"pc":1,"op":49,"gas":"0x2540be3fe","gasCost":"0xa28","memSize":0,"stack":["0x4444588443c3a91288c5002483449aba1054192b"],"depth":1,"refund":0,"opName":"BALANCE"}, - {"pc":2,"op":255,"gas":"0x2540bd9d6","gasCost":"0x1db0","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SELFDESTRUCT"}, + {"pc":0,"op":"0x41","gas":10000000000,"gasCost":2,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"COINBASE"}, + {"pc":1,"op":"0x31","gas":9999999998,"gasCost":2600,"memSize":0,"stack":["0x4444588443c3a91288c5002483449aba1054192b"],"depth":1,"refund":0,"opName":"BALANCE"}, + {"pc":2,"op":"0xff","gas":9999997398,"gasCost":7600,"memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SELFDESTRUCT"}, {"stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","output":"0x","gasUsed":"0x27da","pass":true,"fork":"London"} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/coinbase-warm.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/coinbase-warm.json index 02f9395981d..49da58c3fad 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/coinbase-warm.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/coinbase-warm.json @@ -11,9 +11,9 @@ ], "stdin": "", "stdout": [ - {"pc":0,"op":65,"gas":"0x2540be400","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"COINBASE"}, - {"pc":1,"op":49,"gas":"0x2540be3fe","gasCost":"0x64","memSize":0,"stack":["0x4444588443c3a91288c5002483449aba1054192b"],"depth":1,"refund":0,"opName":"BALANCE"}, - {"pc":2,"op":255,"gas":"0x2540be39a","gasCost":"0x1db0","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SELFDESTRUCT"}, + {"pc":0,"op":"0x41","gas":10000000000,"gasCost":2,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"COINBASE"}, + {"pc":1,"op":"0x31","gas":9999999998,"gasCost":100,"memSize":0,"stack":["0x4444588443c3a91288c5002483449aba1054192b"],"depth":1,"refund":0,"opName":"BALANCE"}, + {"pc":2,"op":"0xff","gas":9999999898,"gasCost":7600,"memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"SELFDESTRUCT"}, {"stateRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","output":"0x","gasUsed":"0x1e16","pass":true,"fork":"Shanghai"} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/create-eof.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/create-eof.json index 6740c86719d..73b3950c22e 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/create-eof.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/create-eof.json @@ -12,14 +12,14 @@ ], "stdin": "", "stdout": [ - {"pc":0,"section":0,"op":95,"gas":"0x2540be400","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":1,"section":0,"op":53,"gas":"0x2540be3fe","gasCost":"0x3","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"CALLDATALOAD"}, - {"pc":2,"section":0,"op":95,"gas":"0x2540be3fb","gasCost":"0x2","memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000"],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":3,"section":0,"op":95,"gas":"0x2540be3f9","gasCost":"0x2","memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000","0x0"],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":4,"section":0,"op":161,"gas":"0x2540be3f7","gasCost":"0x2ee","memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000","0x0","0x0"],"depth":1,"refund":0,"opName":"LOG1"}, - {"pc":5,"section":0,"op":95,"gas":"0x2540be109","gasCost":"0x2","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":6,"section":0,"op":95,"gas":"0x2540be107","gasCost":"0x2","memSize":0,"stack":["0x0"],"depth":1,"refund":0,"opName":"PUSH0"}, - {"pc":7,"section":0,"op":238,"immediate":"0x00","gas":"0x2540be105","gasCost":"0x0","memSize":0,"stack":["0x0","0x0"],"depth":1,"refund":0,"opName":"RETURNCONTRACT"}, + {"pc":24,"section":0,"op":"0x5f","gas":10000000000,"gasCost":2,"memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":25,"section":0,"op":"0x35","gas":9999999998,"gasCost":3,"memSize":0,"stack":["0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"CALLDATALOAD"}, + {"pc":26,"section":0,"op":"0x5f","gas":9999999995,"gasCost":2,"memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000"],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":27,"section":0,"op":"0x5f","gas":9999999993,"gasCost":2,"memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000","0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":28,"section":0,"op":"0xa1","gas":9999999991,"gasCost":750,"memSize":0,"stack":["0xc0de471fe5000000000000000000000000000000000000000000000000000000","0x0","0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"LOG1"}, + {"pc":29,"section":0,"op":"0x5f","gas":9999999241,"gasCost":2,"memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":30,"section":0,"op":"0x5f","gas":9999999239,"gasCost":2,"memSize":0,"stack":["0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH0"}, + {"pc":31,"section":0,"op":"0xee","immediate":"0x00","gas":9999999237,"gasCost":0,"memSize":0,"stack":["0x0","0x0"],"depth":1,"functionDepth":1,"refund":0,"opName":"RETURNCONTRACT"}, {"stateRoot":"0x9790b070a5749acec6a7252a867f795df3c2cb5b800fb509ea259a1c0b5d96c1","output":"0x","gasUsed":"0x129b","pass":true,"fork":"Osaka"} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof-section.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof-section.json index f25557fa7e0..f3d0b7ea94c 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof-section.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof-section.json @@ -11,13 +11,13 @@ ], "stdin": "", "stdout": [ - {"pc":0,"section":0,"op":227,"immediate":"0x0002","gas":"0x2540be400","gasCost":"0x5","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"CALLF"}, - {"pc":11,"section":2,"op":229,"immediate":"0x0001","gas":"0x2540be3fb","gasCost":"0x5","memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"JUMPF"}, - {"pc":10,"section":1,"op":228,"gas":"0x2540be3f6","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"RETF"}, - {"pc":3,"section":0,"op":97,"immediate":"0x2015","gas":"0x2540be3f3","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH2"}, - {"pc":6,"section":0,"op":96,"immediate":"0x01","gas":"0x2540be3f0","gasCost":"0x3","memSize":0,"stack":["0x2015"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":8,"section":0,"op":85,"gas":"0x2540be3ed","gasCost":"0x5654","memSize":0,"stack":["0x2015","0x1"],"depth":1,"refund":0,"opName":"SSTORE"}, - {"pc":9,"section":0,"op":0,"gas":"0x2540b8d99","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"}, + {"pc":31,"section":0,"op":"0xe3","immediate":"0x0002","gas":10000000000,"gasCost":5,"memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"CALLF"}, + {"pc":42,"section":2,"op":"0xe5","immediate":"0x0001","gas":9999999995,"gasCost":5,"memSize":0,"stack":[],"depth":1,"functionDepth":2,"refund":0,"opName":"JUMPF"}, + {"pc":41,"section":1,"op":"0xe4","gas":9999999990,"gasCost":3,"memSize":0,"stack":[],"depth":1,"functionDepth":2,"refund":0,"opName":"RETF"}, + {"pc":34,"section":0,"op":"0x61","immediate":"0x2015","gas":9999999987,"gasCost":3,"memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH2"}, + {"pc":37,"section":0,"op":"0x60","immediate":"0x01","gas":9999999984,"gasCost":3,"memSize":0,"stack":["0x2015"],"depth":1,"functionDepth":1,"refund":0,"opName":"PUSH1"}, + {"pc":39,"section":0,"op":"0x55","gas":9999999981,"gasCost":22100,"memSize":0,"stack":["0x2015","0x1"],"depth":1,"functionDepth":1,"refund":0,"opName":"SSTORE"}, + {"pc":40,"section":0,"op":"0x00","gas":9999977881,"gasCost":0,"memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"STOP"}, {"stateRoot":"0x761f723ceabb467d438fe74abf025c10bf65592b84ec389850038eb572f2b0fa","output":"0x","gasUsed":"0x5667","pass":true,"fork":"Osaka"} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof.json index ddce2bf2aff..f5850449bbf 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/eof.json @@ -11,7 +11,7 @@ ], "stdin": "", "stdout": [ - {"pc":0,"section":0,"op":0,"gas":"0x2540be400","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"}, + {"pc":19,"section":0,"op":"0x00","gas":10000000000,"gasCost":0,"memSize":0,"stack":[],"depth":1,"functionDepth":1,"refund":0,"opName":"STOP"}, {"stateRoot":"0xdae5f2c233bf9fbb7413d06ce744a3345dbf971b5bb5638736c0388f43a61a4b","output":"0x","gasUsed":"0x0","pass":true,"fork":"Osaka"} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/revert.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/revert.json index 32ee526fdd9..3aaa909600d 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/revert.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/revert.json @@ -7,12 +7,12 @@ ], "stdin": "", "stdout": [ - {"pc":0,"op":99,"gas":"0x2540be400","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH4"}, - {"pc":5,"op":96,"gas":"0x2540be3fd","gasCost":"0x3","memSize":0,"stack":["0x4e6f7065"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":7,"op":82,"gas":"0x2540be3fa","gasCost":"0x6","memSize":0,"stack":["0x4e6f7065","0x0"],"depth":1,"refund":0,"opName":"MSTORE"}, - {"pc":8,"op":96,"gas":"0x2540be3f4","gasCost":"0x3","memSize":32,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":10,"op":96,"gas":"0x2540be3f1","gasCost":"0x3","memSize":32,"stack":["0x4"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":12,"op":253,"gas":"0x2540be3ee","gasCost":"0x0","memSize":32,"stack":["0x4","0x1c"],"depth":1,"refund":0,"opName":"REVERT","error":"0x4e6f7065"}, + {"pc":0,"op":"0x63","gas":10000000000,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH4"}, + {"pc":5,"op":"0x60","gas":9999999997,"gasCost":3,"memSize":0,"stack":["0x4e6f7065"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":7,"op":"0x52","gas":9999999994,"gasCost":6,"memSize":0,"stack":["0x4e6f7065","0x0"],"depth":1,"refund":0,"opName":"MSTORE"}, + {"pc":8,"op":"0x60","gas":9999999988,"gasCost":3,"memSize":32,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":10,"op":"0x60","gas":9999999985,"gasCost":3,"memSize":32,"stack":["0x4"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":12,"op":"0xfd","gas":9999999982,"gasCost":0,"memSize":32,"stack":["0x4","0x1c"],"depth":1,"refund":0,"opName":"REVERT","error":"0x4e6f7065"}, {"stateRoot":"0x405bbd98da2aca6dff77f79e0b270270c48d6a3e07b76db675b20e454b50bbcb","output":"0x4e6f7065","gasUsed":"0x12","pass":true,"fork":"Cancun"} ] } \ No newline at end of file diff --git a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/warm-contract.json b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/warm-contract.json index 1c2a9c8064a..627026dc10b 100644 --- a/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/warm-contract.json +++ b/ethereum/evmtool/src/test/resources/org/hyperledger/besu/evmtool/trace/warm-contract.json @@ -13,60 +13,60 @@ ], "stdin": "", "stdout": [ - {"pc":0,"op":96,"gas":"0x620c","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":128,"gas":"0x6209","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":1,"refund":0,"opName":"DUP1"}, - {"pc":3,"op":83,"gas":"0x6206","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"MSTORE8"}, - {"pc":4,"op":96,"gas":"0x61fa","gasCost":"0x3","memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x61f7","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":85,"gas":"0x61f4","gasCost":"0x5654","memSize":96,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"SSTORE"}, - {"pc":9,"op":96,"gas":"0xba0","gasCost":"0x3","memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":11,"op":96,"gas":"0xb9d","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":13,"op":96,"gas":"0xb9a","gasCost":"0x3","memSize":96,"stack":["0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":15,"op":96,"gas":"0xb97","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":17,"op":96,"gas":"0xb94","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":19,"op":48,"gas":"0xb91","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":1,"refund":0,"opName":"ADDRESS"}, - {"pc":20,"op":90,"gas":"0xb8f","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":1,"refund":0,"opName":"GAS"}, - {"pc":21,"op":241,"gas":"0xb8d","gasCost":"0xb61","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0xb8d"],"depth":1,"refund":0,"opName":"CALL"}, - {"pc":0,"op":96,"gas":"0xafd","gasCost":"0x3","memSize":0,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":128,"gas":"0xafa","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":2,"refund":0,"opName":"DUP1"}, - {"pc":3,"op":83,"gas":"0xaf7","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":2,"refund":0,"opName":"MSTORE8"}, - {"pc":4,"op":96,"gas":"0xaeb","gasCost":"0x3","memSize":96,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0xae8","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":85,"gas":"0xae5","gasCost":"0x64","memSize":96,"stack":["0x40","0x40"],"depth":2,"refund":0,"opName":"SSTORE"}, - {"pc":9,"op":96,"gas":"0xa81","gasCost":"0x3","memSize":96,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":11,"op":96,"gas":"0xa7e","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":13,"op":96,"gas":"0xa7b","gasCost":"0x3","memSize":96,"stack":["0x40","0x0"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":15,"op":96,"gas":"0xa78","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":17,"op":96,"gas":"0xa75","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":19,"op":48,"gas":"0xa72","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":2,"refund":0,"opName":"ADDRESS"}, - {"pc":20,"op":90,"gas":"0xa70","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":2,"refund":0,"opName":"GAS"}, - {"pc":21,"op":241,"gas":"0xa6e","gasCost":"0xa46","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0xa6e"],"depth":2,"refund":0,"opName":"CALL"}, - {"pc":0,"op":96,"gas":"0x9e2","gasCost":"0x3","memSize":0,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":128,"gas":"0x9df","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":3,"refund":0,"opName":"DUP1"}, - {"pc":3,"op":83,"gas":"0x9dc","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":3,"refund":0,"opName":"MSTORE8"}, - {"pc":4,"op":96,"gas":"0x9d0","gasCost":"0x3","memSize":96,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x9cd","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":85,"gas":"0x9ca","gasCost":"0x64","memSize":96,"stack":["0x40","0x40"],"depth":3,"refund":0,"opName":"SSTORE"}, - {"pc":9,"op":96,"gas":"0x966","gasCost":"0x3","memSize":96,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":11,"op":96,"gas":"0x963","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":13,"op":96,"gas":"0x960","gasCost":"0x3","memSize":96,"stack":["0x40","0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":15,"op":96,"gas":"0x95d","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":17,"op":96,"gas":"0x95a","gasCost":"0x3","memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":19,"op":48,"gas":"0x957","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":3,"refund":0,"opName":"ADDRESS"}, - {"pc":20,"op":90,"gas":"0x955","gasCost":"0x2","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":3,"refund":0,"opName":"GAS"}, - {"pc":21,"op":241,"gas":"0x953","gasCost":"0x930","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0x953"],"depth":3,"refund":0,"opName":"CALL"}, - {"pc":0,"op":96,"gas":"0x8cc","gasCost":"0x3","memSize":0,"stack":[],"depth":4,"refund":0,"opName":"PUSH1"}, - {"pc":2,"op":128,"gas":"0x8c9","gasCost":"0x3","memSize":0,"stack":["0x40"],"depth":4,"refund":0,"opName":"DUP1"}, - {"pc":3,"op":83,"gas":"0x8c6","gasCost":"0xc","memSize":0,"stack":["0x40","0x40"],"depth":4,"refund":0,"opName":"MSTORE8"}, - {"pc":4,"op":96,"gas":"0x8ba","gasCost":"0x3","memSize":96,"stack":[],"depth":4,"refund":0,"opName":"PUSH1"}, - {"pc":6,"op":96,"gas":"0x8b7","gasCost":"0x3","memSize":96,"stack":["0x40"],"depth":4,"refund":0,"opName":"PUSH1"}, - {"pc":8,"op":85,"gas":"0x8b4","gasCost":"0x8fc","memSize":96,"stack":["0x40","0x40"],"depth":4,"refund":0,"opName":"SSTORE","error":"Out of gas"}, - {"pc":22,"op":96,"gas":"0x23","gasCost":"0x3","memSize":96,"stack":["0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, - {"pc":24,"op":243,"gas":"0x20","gasCost":"0x0","memSize":96,"stack":["0x0","0x40"],"depth":3,"refund":0,"opName":"RETURN"}, - {"pc":22,"op":96,"gas":"0x48","gasCost":"0x3","memSize":96,"stack":["0x1"],"depth":2,"refund":0,"opName":"PUSH1"}, - {"pc":24,"op":243,"gas":"0x45","gasCost":"0x0","memSize":96,"stack":["0x1","0x40"],"depth":2,"refund":0,"opName":"RETURN"}, - {"pc":22,"op":96,"gas":"0x71","gasCost":"0x3","memSize":96,"stack":["0x1"],"depth":1,"refund":0,"opName":"PUSH1"}, - {"pc":24,"op":243,"gas":"0x6e","gasCost":"0x0","memSize":96,"stack":["0x1","0x40"],"depth":1,"refund":0,"opName":"RETURN"}, + {"pc":0,"op":"0x60","gas":25100,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x80","gas":25097,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":1,"refund":0,"opName":"DUP1"}, + {"pc":3,"op":"0x53","gas":25094,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"MSTORE8"}, + {"pc":4,"op":"0x60","gas":25082,"gasCost":3,"memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":25079,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x55","gas":25076,"gasCost":22100,"memSize":96,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"SSTORE"}, + {"pc":9,"op":"0x60","gas":2976,"gasCost":3,"memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":11,"op":"0x60","gas":2973,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":13,"op":"0x60","gas":2970,"gasCost":3,"memSize":96,"stack":["0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":15,"op":"0x60","gas":2967,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":17,"op":"0x60","gas":2964,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":19,"op":"0x30","gas":2961,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":1,"refund":0,"opName":"ADDRESS"}, + {"pc":20,"op":"0x5a","gas":2959,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":1,"refund":0,"opName":"GAS"}, + {"pc":21,"op":"0xf1","gas":2957,"gasCost":2913,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0xb8d"],"depth":1,"refund":0,"opName":"CALL"}, + {"pc":0,"op":"0x60","gas":2813,"gasCost":3,"memSize":0,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x80","gas":2810,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":2,"refund":0,"opName":"DUP1"}, + {"pc":3,"op":"0x53","gas":2807,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":2,"refund":0,"opName":"MSTORE8"}, + {"pc":4,"op":"0x60","gas":2795,"gasCost":3,"memSize":96,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":2792,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x55","gas":2789,"gasCost":100,"memSize":96,"stack":["0x40","0x40"],"depth":2,"refund":0,"opName":"SSTORE"}, + {"pc":9,"op":"0x60","gas":2689,"gasCost":3,"memSize":96,"stack":[],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":11,"op":"0x60","gas":2686,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":13,"op":"0x60","gas":2683,"gasCost":3,"memSize":96,"stack":["0x40","0x0"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":15,"op":"0x60","gas":2680,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":17,"op":"0x60","gas":2677,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":19,"op":"0x30","gas":2674,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":2,"refund":0,"opName":"ADDRESS"}, + {"pc":20,"op":"0x5a","gas":2672,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":2,"refund":0,"opName":"GAS"}, + {"pc":21,"op":"0xf1","gas":2670,"gasCost":2630,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0xa6e"],"depth":2,"refund":0,"opName":"CALL"}, + {"pc":0,"op":"0x60","gas":2530,"gasCost":3,"memSize":0,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x80","gas":2527,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":3,"refund":0,"opName":"DUP1"}, + {"pc":3,"op":"0x53","gas":2524,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":3,"refund":0,"opName":"MSTORE8"}, + {"pc":4,"op":"0x60","gas":2512,"gasCost":3,"memSize":96,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":2509,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x55","gas":2506,"gasCost":100,"memSize":96,"stack":["0x40","0x40"],"depth":3,"refund":0,"opName":"SSTORE"}, + {"pc":9,"op":"0x60","gas":2406,"gasCost":3,"memSize":96,"stack":[],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":11,"op":"0x60","gas":2403,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":13,"op":"0x60","gas":2400,"gasCost":3,"memSize":96,"stack":["0x40","0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":15,"op":"0x60","gas":2397,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":17,"op":"0x60","gas":2394,"gasCost":3,"memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":19,"op":"0x30","gas":2391,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0"],"depth":3,"refund":0,"opName":"ADDRESS"}, + {"pc":20,"op":"0x5a","gas":2389,"gasCost":2,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de"],"depth":3,"refund":0,"opName":"GAS"}, + {"pc":21,"op":"0xf1","gas":2387,"gasCost":2352,"memSize":96,"stack":["0x40","0x0","0x40","0x0","0x0","0xc0de","0x953"],"depth":3,"refund":0,"opName":"CALL"}, + {"pc":0,"op":"0x60","gas":2252,"gasCost":3,"memSize":0,"stack":[],"depth":4,"refund":0,"opName":"PUSH1"}, + {"pc":2,"op":"0x80","gas":2249,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":4,"refund":0,"opName":"DUP1"}, + {"pc":3,"op":"0x53","gas":2246,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":4,"refund":0,"opName":"MSTORE8"}, + {"pc":4,"op":"0x60","gas":2234,"gasCost":3,"memSize":96,"stack":[],"depth":4,"refund":0,"opName":"PUSH1"}, + {"pc":6,"op":"0x60","gas":2231,"gasCost":3,"memSize":96,"stack":["0x40"],"depth":4,"refund":0,"opName":"PUSH1"}, + {"pc":8,"op":"0x55","gas":2228,"gasCost":2300,"memSize":96,"stack":["0x40","0x40"],"depth":4,"refund":0,"opName":"SSTORE","error":"Out of gas"}, + {"pc":22,"op":"0x60","gas":35,"gasCost":3,"memSize":96,"stack":["0x0"],"depth":3,"refund":0,"opName":"PUSH1"}, + {"pc":24,"op":"0xf3","gas":32,"gasCost":0,"memSize":96,"stack":["0x0","0x40"],"depth":3,"refund":0,"opName":"RETURN"}, + {"pc":22,"op":"0x60","gas":72,"gasCost":3,"memSize":96,"stack":["0x1"],"depth":2,"refund":0,"opName":"PUSH1"}, + {"pc":24,"op":"0xf3","gas":69,"gasCost":0,"memSize":96,"stack":["0x1","0x40"],"depth":2,"refund":0,"opName":"RETURN"}, + {"pc":22,"op":"0x60","gas":113,"gasCost":3,"memSize":96,"stack":["0x1"],"depth":1,"refund":0,"opName":"PUSH1"}, + {"pc":24,"op":"0xf3","gas":110,"gasCost":0,"memSize":96,"stack":["0x1","0x40"],"depth":1,"refund":0,"opName":"RETURN"}, {"stateRoot":"0xcb5e8e232189003640b6f131ea2c09b1791ffd2e8357f64610f638e9a11ab2d2","output":"0x40","gasUsed":"0x619e","pass":true,"fork":"Cancun"} ] } \ No newline at end of file diff --git a/evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java b/evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java index 8071fa942f1..a7793e15892 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/tracing/StandardJsonTracer.java @@ -40,14 +40,15 @@ public class StandardJsonTracer implements OperationTracer { private final boolean showStack; private final boolean showReturnData; private final boolean showStorage; + private final boolean eip3155strict; private int pc; private int section; private List stack; - private String gas; + private long gas; private Bytes memory; private int memorySize; private int depth; - private int subdepth; + private int functionDepth; private String storageString; /** @@ -65,11 +66,32 @@ public StandardJsonTracer( final boolean showStack, final boolean showReturnData, final boolean showStorage) { + this(out, showMemory, showStack, showReturnData, showStorage, false); + } + + /** + * Instantiates a new Standard json tracer. + * + * @param out the out + * @param showMemory show memory in trace lines + * @param showStack show the stack in trace lines + * @param showReturnData show return data in trace lines + * @param showStorage show the updated storage + * @param eip3155strict Output EIP-3155 compatible traces + */ + public StandardJsonTracer( + final PrintWriter out, + final boolean showMemory, + final boolean showStack, + final boolean showReturnData, + final boolean showStorage, + final boolean eip3155strict) { this.out = out; this.showMemory = showMemory; this.showStack = showStack; this.showReturnData = showReturnData; this.showStorage = showStorage; + this.eip3155strict = eip3155strict; } /** @@ -95,6 +117,32 @@ public StandardJsonTracer( showStorage); } + /** + * Instantiates a new Standard json tracer. + * + * @param out the out + * @param showMemory show memory in trace lines + * @param showStack show the stack in trace lines + * @param showReturnData show return data in trace lines + * @param showStorage show updated storage + * @param eip3155strict Output eip-3155 compatible traces + */ + public StandardJsonTracer( + final PrintStream out, + final boolean showMemory, + final boolean showStack, + final boolean showReturnData, + final boolean showStorage, + final boolean eip3155strict) { + this( + new PrintWriter(out, true, StandardCharsets.UTF_8), + showMemory, + showStack, + showReturnData, + showStorage, + eip3155strict); + } + /** * Short as hex string. * @@ -125,9 +173,9 @@ public void tracePreExecution(final MessageFrame messageFrame) { for (int i = messageFrame.stackSize() - 1; i >= 0; i--) { stack.add("\"" + shortBytes(messageFrame.getStackItem(i)) + "\""); } - pc = messageFrame.getPC() - messageFrame.getCode().getCodeSection(0).getEntryPoint(); + pc = messageFrame.getPC(); section = messageFrame.getSection(); - gas = shortNumber(messageFrame.getRemainingGas()); + gas = messageFrame.getRemainingGas(); memorySize = messageFrame.memoryWordSize() * 32; if (showMemory && memorySize > 0) { memory = messageFrame.readMemory(0, messageFrame.memoryWordSize() * 32L); @@ -135,7 +183,8 @@ public void tracePreExecution(final MessageFrame messageFrame) { memory = null; } depth = messageFrame.getMessageStackSize(); - subdepth = messageFrame.returnStackSize(); + functionDepth = + messageFrame.getCode().getEofVersion() > 0 ? messageFrame.returnStackSize() + 1 : 0; StringBuilder sb = new StringBuilder(); if (showStorage) { @@ -186,20 +235,23 @@ public void tracePostExecution( if (eofContract) { sb.append("\"section\":").append(section).append(","); } - sb.append("\"op\":").append(opcode).append(","); + if (eip3155strict) { + sb.append("\"op\":").append(opcode).append(","); + } else { + sb.append("\"op\":\"").append(fastHexByte(opcode)).append("\","); + } OpcodeInfo opInfo = OpcodeInfo.getOpcode(opcode); if (eofContract && opInfo.pcAdvance() > 1) { - var immediate = - messageFrame - .getCode() - .getBytes() - .slice( - pc + messageFrame.getCode().getCodeSection(0).getEntryPoint() + 1, - opInfo.pcAdvance() - 1); + var immediate = messageFrame.getCode().getBytes().slice(pc + 1, opInfo.pcAdvance() - 1); sb.append("\"immediate\":\"").append(immediate.toHexString()).append("\","); } - sb.append("\"gas\":\"").append(gas).append("\","); - sb.append("\"gasCost\":\"").append(shortNumber(thisGasCost)).append("\","); + if (eip3155strict) { + sb.append("\"gas\":\"").append(shortNumber(gas)).append("\","); + sb.append("\"gasCost\":\"").append(shortNumber(thisGasCost)).append("\","); + } else { + sb.append("\"gas\":").append(Long.toUnsignedString(gas)).append(","); + sb.append("\"gasCost\":").append(Long.toUnsignedString(thisGasCost)).append(","); + } if (memory != null) { sb.append("\"memory\":\"").append(memory.toHexString()).append("\","); } @@ -211,8 +263,8 @@ public void tracePostExecution( sb.append("\"returnData\":\"").append(returnData.toHexString()).append("\","); } sb.append("\"depth\":").append(depth).append(","); - if (subdepth >= 1) { - sb.append("\"functionDepth\":").append(subdepth).append(","); + if (functionDepth > 0) { + sb.append("\"functionDepth\":").append(functionDepth).append(","); } sb.append("\"refund\":").append(messageFrame.getGasRefund()).append(","); sb.append("\"opName\":\"").append(currentOp.getName()).append("\""); @@ -241,4 +293,12 @@ public void traceAccountCreationResult( final MessageFrame frame, final Optional haltReason) { // precompile calls are not part of the standard trace } + + private String fastHexByte(final int b) { + char[] result = new char[] {'0', 'x', '-', '-'}; + result[2] = "0123456789abcdef".charAt(b >> 4 & 15); + result[3] = "0123456789abcdef".charAt(b & 15); + + return new String(result); + } } diff --git a/evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java b/evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java index 4f18f582d1a..8b18d70ac8e 100644 --- a/evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java +++ b/evm/src/test/java/org/hyperledger/besu/evm/StandardJsonTracerTest.java @@ -30,12 +30,12 @@ class StandardJsonTracerTest { @Test - void eip3155ModifiedTestCase() { + void eip3155ModifiedTestCaseStrictTypes() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); var executor = EVMExecutor.evm(EvmSpecVersion.ISTANBUL); - StandardJsonTracer tracer = new StandardJsonTracer(out, true, true, true, false); + StandardJsonTracer tracer = new StandardJsonTracer(out, true, true, true, false, true); executor.tracer(tracer); executor.gas(10_000_000_000L); @@ -72,6 +72,49 @@ void eip3155ModifiedTestCase() { """); } + @Test + void eip3155ModifiedTestCase() { + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream out = new PrintStream(baos); + var executor = EVMExecutor.evm(EvmSpecVersion.ISTANBUL); + StandardJsonTracer tracer = new StandardJsonTracer(out, true, true, true, false); + executor.tracer(tracer); + executor.gas(10_000_000_000L); + + var codeBytes = Bytes.fromHexString("0x604080536040604055604060006040600060025afa6040f3"); + executor.execute(codeBytes, Bytes.EMPTY, Wei.ZERO, Address.ZERO); + + // differences from the EIP-3155 test case + // (a) the test case was written when EIP-2315 was part of the pending hard fork, so + // returnStack was a valid field. It no longer appears in any traces. + // (b) the summary line is omitted + // (c) pc:3 is in error, the size of the memory before the first MSTORE8 is zero. + // (d) if memory is zero length, it is not included even if `showMemory` is true + // (e) if return data is zero length or null, it is not included even if `showReturnData` is + // true + // (f) if error is zero length or null it is not included. + assertThat(baos) + .hasToString( + """ + {"pc":0,"op":"0x60","gas":10000000000,"gasCost":3,"memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":2,"op":"0x80","gas":9999999997,"gasCost":3,"memSize":0,"stack":["0x40"],"depth":1,"refund":0,"opName":"DUP1"} + {"pc":3,"op":"0x53","gas":9999999994,"gasCost":12,"memSize":0,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"MSTORE8"} + {"pc":4,"op":"0x60","gas":9999999982,"gasCost":3,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":6,"op":"0x60","gas":9999999979,"gasCost":3,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":8,"op":"0x55","gas":9999999976,"gasCost":20000,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x40"],"depth":1,"refund":0,"opName":"SSTORE"} + {"pc":9,"op":"0x60","gas":9999979976,"gasCost":3,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":11,"op":"0x60","gas":9999979973,"gasCost":3,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40"],"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":13,"op":"0x60","gas":9999979970,"gasCost":3,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":15,"op":"0x60","gas":9999979967,"gasCost":3,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0","0x40"],"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":17,"op":"0x60","gas":9999979964,"gasCost":3,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0","0x40","0x0"],"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":19,"op":"0x5a","gas":9999979961,"gasCost":2,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x2"],"depth":1,"refund":0,"opName":"GAS"} + {"pc":20,"op":"0xfa","gas":9999979959,"gasCost":9843730284,"memory":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x40","0x0","0x40","0x0","0x2","0x2540b95b7"],"depth":1,"refund":0,"opName":"STATICCALL"} + {"pc":21,"op":"0x60","gas":9999979175,"gasCost":3,"memory":"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x1"],"returnData":"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b","depth":1,"refund":0,"opName":"PUSH1"} + {"pc":23,"op":"0xf3","gas":9999979172,"gasCost":0,"memory":"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b00000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000","memSize":96,"stack":["0x1","0x40"],"returnData":"0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b","depth":1,"refund":0,"opName":"RETURN"} + """); + } + @Test void updatedStorageTestCase() { @@ -88,21 +131,21 @@ void updatedStorageTestCase() { assertThat(baos) .hasToString( """ - {"pc":0,"op":96,"gas":"0x2540be400","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"PUSH1"} - {"pc":2,"op":128,"gas":"0x2540be3fd","gasCost":"0x3","memSize":0,"depth":1,"refund":0,"opName":"DUP1"} - {"pc":3,"op":83,"gas":"0x2540be3fa","gasCost":"0xc","memSize":0,"depth":1,"refund":0,"opName":"MSTORE8"} - {"pc":4,"op":96,"gas":"0x2540be3ee","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1"} - {"pc":6,"op":96,"gas":"0x2540be3eb","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1"} - {"pc":8,"op":85,"gas":"0x2540be3e8","gasCost":"0x4e20","memSize":96,"depth":1,"refund":0,"opName":"SSTORE"} - {"pc":9,"op":96,"gas":"0x2540b95c8","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} - {"pc":11,"op":96,"gas":"0x2540b95c5","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} - {"pc":13,"op":96,"gas":"0x2540b95c2","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} - {"pc":15,"op":96,"gas":"0x2540b95bf","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} - {"pc":17,"op":96,"gas":"0x2540b95bc","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} - {"pc":19,"op":90,"gas":"0x2540b95b9","gasCost":"0x2","memSize":96,"depth":1,"refund":0,"opName":"GAS","storage":{"0x40":"0x40"}} - {"pc":20,"op":250,"gas":"0x2540b95b7","gasCost":"0x24abb676c","memSize":96,"depth":1,"refund":0,"opName":"STATICCALL","storage":{"0x40":"0x40"}} - {"pc":21,"op":96,"gas":"0x2540b92a7","gasCost":"0x3","memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} - {"pc":23,"op":243,"gas":"0x2540b92a4","gasCost":"0x0","memSize":96,"depth":1,"refund":0,"opName":"RETURN","storage":{"0x40":"0x40"}} + {"pc":0,"op":"0x60","gas":10000000000,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":2,"op":"0x80","gas":9999999997,"gasCost":3,"memSize":0,"depth":1,"refund":0,"opName":"DUP1"} + {"pc":3,"op":"0x53","gas":9999999994,"gasCost":12,"memSize":0,"depth":1,"refund":0,"opName":"MSTORE8"} + {"pc":4,"op":"0x60","gas":9999999982,"gasCost":3,"memSize":96,"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":6,"op":"0x60","gas":9999999979,"gasCost":3,"memSize":96,"depth":1,"refund":0,"opName":"PUSH1"} + {"pc":8,"op":"0x55","gas":9999999976,"gasCost":20000,"memSize":96,"depth":1,"refund":0,"opName":"SSTORE"} + {"pc":9,"op":"0x60","gas":9999979976,"gasCost":3,"memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} + {"pc":11,"op":"0x60","gas":9999979973,"gasCost":3,"memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} + {"pc":13,"op":"0x60","gas":9999979970,"gasCost":3,"memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} + {"pc":15,"op":"0x60","gas":9999979967,"gasCost":3,"memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} + {"pc":17,"op":"0x60","gas":9999979964,"gasCost":3,"memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} + {"pc":19,"op":"0x5a","gas":9999979961,"gasCost":2,"memSize":96,"depth":1,"refund":0,"opName":"GAS","storage":{"0x40":"0x40"}} + {"pc":20,"op":"0xfa","gas":9999979959,"gasCost":9843730284,"memSize":96,"depth":1,"refund":0,"opName":"STATICCALL","storage":{"0x40":"0x40"}} + {"pc":21,"op":"0x60","gas":9999979175,"gasCost":3,"memSize":96,"depth":1,"refund":0,"opName":"PUSH1","storage":{"0x40":"0x40"}} + {"pc":23,"op":"0xf3","gas":9999979172,"gasCost":0,"memSize":96,"depth":1,"refund":0,"opName":"RETURN","storage":{"0x40":"0x40"}} """); } }