diff --git a/nimbus/common/chain_config.nim b/nimbus/common/chain_config.nim index efc3156d3..686f18168 100644 --- a/nimbus/common/chain_config.nim +++ b/nimbus/common/chain_config.nim @@ -445,7 +445,9 @@ func chainConfigForNetwork*(id: NetworkId): ChainConfig = result = case id of MainNet: - const mainNetTTD = parse("58750000000000000000000",UInt256) + const + mainNetTTD = parse("58750000000000000000000",UInt256) + MAINNET_DEPOSIT_CONTRACT_ADDRESS = address"0x00000000219ab540356cbb839cbe05303d7705fa" ChainConfig( chainId: MainNet.ChainId, # Genesis (Frontier): # 2015-07-30 15:26:13 UTC @@ -470,6 +472,7 @@ func chainConfigForNetwork*(id: NetworkId): ChainConfig = terminalTotalDifficulty: Opt.some(mainNetTTD), shanghaiTime: Opt.some(1_681_338_455.EthTime), # 2023-04-12 10:27:35 UTC cancunTime: Opt.some(1_710_338_135.EthTime), # 2024-03-13 13:55:35 UTC + depositContractAddress: Opt.some(MAINNET_DEPOSIT_CONTRACT_ADDRESS), ) of SepoliaNet: const sepoliaTTD = parse("17000000000000000",UInt256) diff --git a/nimbus/common/common.nim b/nimbus/common/common.nim index 7570261a8..3114620c2 100644 --- a/nimbus/common/common.nim +++ b/nimbus/common/common.nim @@ -328,6 +328,9 @@ proc proofOfStake*(com: CommonRef, header: Header): bool = # This costly check is only executed from test suite com.isBlockAfterTtd(header) +func depositContractAddress*(com: CommonRef): Address = + com.config.depositContractAddress.get(default(Address)) + proc syncReqNewHead*(com: CommonRef; header: Header) {.gcsafe, raises: [].} = ## Used by RPC updater diff --git a/nimbus/common/hardforks.nim b/nimbus/common/hardforks.nim index 37c3d4ae0..7ed02deb1 100644 --- a/nimbus/common/hardforks.nim +++ b/nimbus/common/hardforks.nim @@ -176,6 +176,7 @@ type terminalTotalDifficulty*: Opt[UInt256] terminalTotalDifficultyPassed*: Opt[bool] + depositContractAddress*: Opt[Address] # These are used for checking that the values of the fields # are in a valid order. diff --git a/nimbus/constants.nim b/nimbus/constants.nim index 4c28e9ec6..1006cfc29 100644 --- a/nimbus/constants.nim +++ b/nimbus/constants.nim @@ -108,7 +108,6 @@ const initAddress(3) HISTORY_STORAGE_ADDRESS* = address"0x0aae40965e6800cd9b1f4b05ff21581047e3f91e" - DEPOSIT_CONTRACT_ADDRESS* = address"0x00000000219ab540356cbb839cbe05303d7705fa" - WITHDRAWAL_REQUEST_ADDRESS* = address"0x00A3ca265EBcb825B45F985A16CEFB49958cE017" - CONSOLIDATION_REQUEST_ADDRESS* = address"0x00b42dbF2194e931E80326D950320f7d9Dbeac02" + WITHDRAWAL_QUEUE_ADDRESS* = address"0x09Fc772D0857550724b07B850a4323f39112aAaA" + CONSOLIDATION_QUEUE_ADDRESS* = address"0x01aBEa29659e5e97C95107F20bb753cD3e09bBBb" # End diff --git a/nimbus/core/eip6110.nim b/nimbus/core/eip6110.nim index 63f27825e..583ea9e4f 100644 --- a/nimbus/core/eip6110.nim +++ b/nimbus/core/eip6110.nim @@ -14,8 +14,7 @@ import eth/common/receipts, stew/assign2, stew/arrayops, - results, - ../constants + results # ----------------------------------------------------------------------------- # Private helpers @@ -71,14 +70,13 @@ func depositLogToRequest(data: openArray[byte]): DepositRequest = # Public functions # ----------------------------------------------------------------------------- -func parseDepositLogs*(logs: openArray[Log]): Result[seq[byte], string] = - var res = newSeq[byte](logs.len*depositRequestSize) +func parseDepositLogs*(logs: openArray[Log], depositContractAddress: Address): Result[seq[byte], string] = + var res = newSeqOfCap[byte](logs.len*depositRequestSize) for i, log in logs: - if log.address == DEPOSIT_CONTRACT_ADDRESS: - if log.data.len != 576: - return err("deposit wrong length: want 576, have " & $log.data.len) - let offset = i*depositRequestSize - assign(res.toOpenArray(offset, offset+depositRequestSize-1), - depositLogToRequest(log.data)) + if log.address != depositContractAddress: + continue + if log.data.len != 576: + return err("deposit wrong length: want 576, have " & $log.data.len) + res.add depositLogToRequest(log.data) ok(move(res)) diff --git a/nimbus/core/executor/process_block.nim b/nimbus/core/executor/process_block.nim index dc2a03bad..c4bb9a626 100644 --- a/nimbus/core/executor/process_block.nim +++ b/nimbus/core/executor/process_block.nim @@ -191,7 +191,7 @@ proc procBlkEpilogue( if header.requestsHash.isSome: let - depositReqs = ?parseDepositLogs(vmState.allLogs) + depositReqs = ?parseDepositLogs(vmState.allLogs, vmState.com.depositContractAddress) requestsHash = calcRequestsHash(depositReqs, withdrawalReqs, consolidationReqs) if header.requestsHash.get != requestsHash: diff --git a/nimbus/core/executor/process_transaction.nim b/nimbus/core/executor/process_transaction.nim index 0e7f9247b..041158729 100644 --- a/nimbus/core/executor/process_transaction.nim +++ b/nimbus/core/executor/process_transaction.nim @@ -197,7 +197,7 @@ proc processDequeueWithdrawalRequests*(vmState: BaseVMState): seq[byte] = sender : SYSTEM_ADDRESS, gasLimit : 30_000_000.GasInt, gasPrice : 0.GasInt, - to : WITHDRAWAL_REQUEST_ADDRESS, + to : WITHDRAWAL_QUEUE_ADDRESS, # It's a systemCall, no need for other knicks knacks sysCall : true, @@ -221,7 +221,7 @@ proc processDequeueConsolidationRequests*(vmState: BaseVMState): seq[byte] = sender : SYSTEM_ADDRESS, gasLimit : 30_000_000.GasInt, gasPrice : 0.GasInt, - to : CONSOLIDATION_REQUEST_ADDRESS, + to : CONSOLIDATION_QUEUE_ADDRESS, # It's a systemCall, no need for other knicks knacks sysCall : true, diff --git a/nimbus/core/tx_pool/tx_packer.nim b/nimbus/core/tx_pool/tx_packer.nim index 32bec6dab..eacd57b10 100644 --- a/nimbus/core/tx_pool/tx_packer.nim +++ b/nimbus/core/tx_pool/tx_packer.nim @@ -269,7 +269,7 @@ proc vmExecCommit(pst: var TxPacker): Result[void, string] = if vmState.fork >= FkPrague: pst.withdrawalReqs = processDequeueWithdrawalRequests(vmState) pst.consolidationReqs = processDequeueConsolidationRequests(vmState) - pst.depositReqs = ?parseDepositLogs(vmState.allLogs) + pst.depositReqs = ?parseDepositLogs(vmState.allLogs, vmState.com.depositContractAddress) # Finish up, then vmState.stateDB.stateRoot may be accessed stateDB.persist(clearEmptyAccount = vmState.fork >= FkSpurious) diff --git a/nimbus/db/core_db/core_apps.nim b/nimbus/db/core_db/core_apps.nim index e4e3d8794..7eccf7af3 100644 --- a/nimbus/db/core_db/core_apps.nim +++ b/nimbus/db/core_db/core_apps.nim @@ -14,7 +14,7 @@ {.push gcsafe, raises: [].} import - std/[algorithm, sequtils], + std/[sequtils], chronicles, eth/[common, rlp], stew/byteutils, diff --git a/nimbus/evm/interpreter/evmc_gas_costs.nim b/nimbus/evm/interpreter/evmc_gas_costs.nim index d1460391b..56addde80 100644 --- a/nimbus/evm/interpreter/evmc_gas_costs.nim +++ b/nimbus/evm/interpreter/evmc_gas_costs.nim @@ -57,9 +57,8 @@ func storageCostSpec(): array[EVMFork, StorageCostSpec] {.compileTime.} = netCost: true, warmAccess: WarmStorageReadCost, sset: 20000, reset: 5000 - ColdSloadCost, clear: 4800) - result[FkParis] = result[FkLondon] - result[FkShanghai] = result[FkLondon] - result[FkCancun] = result[FkLondon] + for fork in FkParis..EVMFork.high: + result[fork] = result[FkLondon] proc legacySStoreCost(e: var SstoreCosts, c: StorageCostSpec) {.compileTime.} = diff --git a/nimbus/evm/interpreter/op_dispatcher.nim b/nimbus/evm/interpreter/op_dispatcher.nim index 6aa07da79..9c47872eb 100644 --- a/nimbus/evm/interpreter/op_dispatcher.nim +++ b/nimbus/evm/interpreter/op_dispatcher.nim @@ -37,6 +37,7 @@ template handleStopDirective(cpt: VmCpt, tracingEnabled: bool) = if not cpt.code.atEnd(): # we only trace `REAL STOP` and ignore `FAKE STOP` cpt.opIndex = cpt.traceOpCodeStarted(Stop) + ?cpt.opcodeGasCost(Stop, 0, tracingEnabled, reason = $Stop) cpt.traceOpCodeEnded(Stop, cpt.opIndex) template handleFixedGasCostsDirective( diff --git a/nimbus/transaction/host_trace.nim b/nimbus/transaction/host_trace.nim index a090f6155..2a743e2a1 100644 --- a/nimbus/transaction/host_trace.nim +++ b/nimbus/transaction/host_trace.nim @@ -115,7 +115,7 @@ proc showEvmcArgsExpr(fn: NimNode, callName: string): auto = if (types[i].repr == "ptr byte" or types[i].repr == "ptr HostTopic") and (i < args.len-1 and types[i+1].repr == "HostSize"): skip = i+1 - arg = newPar(args[i], args[i+1]) + arg = newNimNode(nnkTupleConstr).add(args[i], args[i+1]) msgExpr = quote do: `msgExpr` & `argNameString` & $(`arg`) return (msgExpr, args) diff --git a/tools/t8n/helpers.nim b/tools/t8n/helpers.nim index 7abb6395a..1c2632312 100644 --- a/tools/t8n/helpers.nim +++ b/tools/t8n/helpers.nim @@ -191,6 +191,7 @@ proc readValue*(r: var JsonReader[T8Conv], val: var EnvStruct) of "blockHashes": r.readValue(val.blockHashes) of "ommers": r.readValue(val.ommers) of "withdrawals": r.readValue(val.withdrawals) + of "depositContractAddress": r.readValue(val.depositContractAddress) else: discard r.readValue(JsonString) if not currentCoinbaseParsed: @@ -235,10 +236,10 @@ proc parseTxJson(txo: TxObject, chainId: ChainId): Result[Transaction, string] = required(value) required(input, payload) tx.to = txo.to - tx.chainId = chainId case tx.txType of TxLegacy: + tx.chainId = chainId required(gasPrice) of TxEip2930: required(gasPrice) @@ -263,6 +264,9 @@ proc parseTxJson(txo: TxObject, chainId: ChainId): Result[Transaction, string] = optional(accessList) required(authorizationList) + if tx.chainId != chainId: + return err("invalid chain id: have " & $tx.chainId & " want " & $chainId) + let eip155 = txo.protected.get(true) if txo.secretKey.isSome: let secretKey = PrivateKey.fromRaw(txo.secretKey.get).valueOr: @@ -274,13 +278,17 @@ proc parseTxJson(txo: TxObject, chainId: ChainId): Result[Transaction, string] = required(s, S) ok(tx) -proc readNestedTx(rlp: var Rlp): Result[Transaction, string] = +proc readNestedTx(rlp: var Rlp, chainId: ChainId): Result[Transaction, string] = try: - ok if rlp.isList: + let tx = if rlp.isList: rlp.read(Transaction) else: var rr = rlpFromBytes(rlp.read(seq[byte])) rr.read(Transaction) + if tx.chainId == chainId: + ok(tx) + else: + err("invalid chain id: have " & $tx.chainId & " want " & $chainId) except RlpError as exc: err(exc.msg) @@ -301,7 +309,7 @@ proc parseTxs*(ctx: var TransContext, chainId: ChainId) if ctx.txsRlp.len > 0: for item in rlp: - ctx.txList.add rlp.readNestedTx() + ctx.txList.add rlp.readNestedTx(chainId) proc filterGoodTransactions*(ctx: TransContext): seq[Transaction] = for txRes in ctx.txList: @@ -433,6 +441,11 @@ proc `@@`[T](x: seq[T]): JsonNode = for c in x: result.add @@(c) +proc `@@`[N, T](x: array[N, T]): JsonNode = + result = newJArray() + for c in x: + result.add @@(c) + proc `@@`[T](x: Opt[T]): JsonNode = if x.isNone: newJNull() @@ -462,3 +475,5 @@ proc `@@`*(x: ExecutionResult): JsonNode = result["blobGasUsed"] = @@(x.blobGasUsed) if x.requestsHash.isSome: result["requestsHash"] = @@(x.requestsHash) + if x.requests.isSome: + result["requests"] = @@(x.requests) diff --git a/tools/t8n/t8n_test.nim b/tools/t8n/t8n_test.nim index e47c565a6..c49c86635 100644 --- a/tools/t8n/t8n_test.nim +++ b/tools/t8n/t8n_test.nim @@ -20,6 +20,7 @@ type inEnv : string stFork : string stReward: string + chainid : string T8nOutput = object alloc : bool @@ -39,13 +40,15 @@ type path: string error: string -proc t8nInput(alloc, txs, env, fork, reward: string): T8nInput = +proc t8nInput(alloc, txs, env, fork: string; + reward = "0"; chainid = ""): T8nInput = T8nInput( inAlloc : alloc, inTxs : txs, inEnv : env, stFork : fork, - stReward: reward + stReward: reward, + chainid : chainid, ) proc get(opt: T8nInput, base : string): string = @@ -55,6 +58,8 @@ proc get(opt: T8nInput, base : string): string = result.add(" --state.fork " & opt.stFork) if opt.stReward.len > 0: result.add(" --state.reward " & opt.stReward) + if opt.chainid.len > 0: + result.add(" --state.chainid " & opt.chainid) proc get(opt: T8nOutput): string = if opt.alloc and not opt.trace: @@ -164,15 +169,20 @@ proc runTest(appDir: string, spec: TestSpec): bool = if spec.expOut.len > 0: if spec.expOut.endsWith(".json"): - let path = base / spec.expOut - let want = json.parseFile(path) - let have = json.parseJson(res) - var jsc = JsonComparator() - if not jsc.cmp(want, have, "root") and notRejectedError(jsc.path): - echo "test $1: output wrong, have \n$2\nwant\n$3\n" % - [spec.name, have.pretty, want.pretty] - echo "path: $1, error: $2" % - [jsc.path, jsc.error] + let path = base / spec.expOut + try: + let want = json.parseFile(path) + let have = json.parseJson(res) + var jsc = JsonComparator() + if not jsc.cmp(want, have, "root") and notRejectedError(jsc.path): + echo "test $1: output wrong, have \n$2\nwant\n$3\n" % + [spec.name, have.pretty, want.pretty] + echo "path: $1, error: $2" % + [jsc.path, jsc.error] + return false + except JsonParsingError as exc: + echo "test $1: ERROR: $2" % [spec.name, exc.msg] + echo "test $1: OUTPUT: $2" % [spec.name, res] return false else: # compare as regular text @@ -460,7 +470,7 @@ const name : "Revert In Create In Init Create2", base : "testdata/00-512", input : t8nInput( - "alloc.json", "txs.rlp", "env.json", "Berlin", "0" + "alloc.json", "txs.rlp", "env.json", "Berlin", "0", "0" ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json", @@ -469,7 +479,7 @@ const name : "Revert In Create In Init", base : "testdata/00-513", input : t8nInput( - "alloc.json", "txs.rlp", "env.json", "Berlin", "0" + "alloc.json", "txs.rlp", "env.json", "Berlin", "0", "0" ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json", @@ -478,7 +488,7 @@ const name : "Init collision 3", base : "testdata/00-514", input : t8nInput( - "alloc.json", "txs.rlp", "env.json", "Berlin", "0" + "alloc.json", "txs.rlp", "env.json", "Berlin", "0", "0" ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json", @@ -496,7 +506,7 @@ const name : "GasUsedHigherThanBlockGasLimitButNotWithRefundsSuicideLast_Frontier", base : "testdata/00-516", input : t8nInput( - "alloc.json", "txs.rlp", "env.json", "Frontier", "5000000000000000000", + "alloc.json", "txs.rlp", "env.json", "Frontier", "5000000000000000000", "0" ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json", @@ -609,6 +619,33 @@ const output: T8nOutput(result: true), expOut: "exp.json", ), + TestSpec( + name : "Different --state.chainid and tx.chainid", + base : "testdata/00-525", + input : t8nInput( + "alloc.json", "txs.rlp", "env.json", "Prague", + ), + output: T8nOutput(result: true), + expOut: "exp1.json", + ), + TestSpec( + name : "Prague execution requests", + base : "testdata/00-525", + input : t8nInput( + "alloc.json", "txs.rlp", "env.json", "Prague", "", "7078815900" + ), + output: T8nOutput(result: true), + expOut: "exp2.json", + ), + TestSpec( + name : "Prague depositContractAddress", + base : "testdata/00-525", + input : t8nInput( + "alloc.json", "txs.rlp", "env_dca.json", "Prague", "", "7078815900" + ), + output: T8nOutput(result: true), + expOut: "exp3.json", + ), ] proc main() = diff --git a/tools/t8n/testdata/00-525/alloc.json b/tools/t8n/testdata/00-525/alloc.json new file mode 100644 index 000000000..ecfe5f9c8 --- /dev/null +++ b/tools/t8n/testdata/00-525/alloc.json @@ -0,0 +1,72 @@ +{ + "0xcf49fda3be353c69b41ed96333cd24302da4556f" : { + "balance" : "0xF51370DC5C37F0000", + "code" : "0x", + "nonce" : "0x07", + "storage" : { + } + }, + "0x4242424242424242424242424242424242424242": { + "balance": "0", + "code": "0x60806040526004361061003f5760003560e01c806301ffc9a71461004457806322895118146100a4578063621fd130146101ba578063c5f2892f14610244575b600080fd5b34801561005057600080fd5b506100906004803603602081101561006757600080fd5b50357fffffffff000000000000000000000000000000000000000000000000000000001661026b565b604080519115158252519081900360200190f35b6101b8600480360360808110156100ba57600080fd5b8101906020810181356401000000008111156100d557600080fd5b8201836020820111156100e757600080fd5b8035906020019184600183028401116401000000008311171561010957600080fd5b91939092909160208101903564010000000081111561012757600080fd5b82018360208201111561013957600080fd5b8035906020019184600183028401116401000000008311171561015b57600080fd5b91939092909160208101903564010000000081111561017957600080fd5b82018360208201111561018b57600080fd5b803590602001918460018302840111640100000000831117156101ad57600080fd5b919350915035610304565b005b3480156101c657600080fd5b506101cf6110b5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102095781810151838201526020016101f1565b50505050905090810190601f1680156102365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025057600080fd5b506102596110c7565b60408051918252519081900360200190f35b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806102fe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f8564090700000000000000000000000000000000000000000000000000000000145b92915050565b6030861461035d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118056026913960400191505060405180910390fd5b602084146103b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603681526020018061179c6036913960400191505060405180910390fd5b6060821461040f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806118786029913960400191505060405180910390fd5b670de0b6b3a7640000341015610470576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806118526026913960400191505060405180910390fd5b633b9aca003406156104cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001806117d26033913960400191505060405180910390fd5b633b9aca00340467ffffffffffffffff811115610535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602781526020018061182b6027913960400191505060405180910390fd5b6060610540826114ba565b90507f649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c589898989858a8a6105756020546114ba565b6040805160a0808252810189905290819060208201908201606083016080840160c085018e8e80828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910187810386528c815260200190508c8c808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690920188810386528c5181528c51602091820193918e019250908190849084905b83811015610648578181015183820152602001610630565b50505050905090810190601f1680156106755780820380516001836020036101000a031916815260200191505b5086810383528881526020018989808284376000838201819052601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092018881038452895181528951602091820193918b019250908190849084905b838110156106ef5781810151838201526020016106d7565b50505050905090810190601f16801561071c5780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390a1600060028a8a600060801b604051602001808484808284377fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941691909301908152604080517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0818403018152601090920190819052815191955093508392506020850191508083835b602083106107fc57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016107bf565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610859573d6000803e3d6000fd5b5050506040513d602081101561086e57600080fd5b5051905060006002806108846040848a8c6116fe565b6040516020018083838082843780830192505050925050506040516020818303038152906040526040518082805190602001908083835b602083106108f857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016108bb565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610955573d6000803e3d6000fd5b5050506040513d602081101561096a57600080fd5b5051600261097b896040818d6116fe565b60405160009060200180848480828437919091019283525050604080518083038152602092830191829052805190945090925082918401908083835b602083106109f457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016109b7565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610a51573d6000803e3d6000fd5b5050506040513d6020811015610a6657600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b60208310610ada57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610a9d565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610b37573d6000803e3d6000fd5b5050506040513d6020811015610b4c57600080fd5b50516040805160208101858152929350600092600292839287928f928f92018383808284378083019250505093505050506040516020818303038152906040526040518082805190602001908083835b60208310610bd957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610b9c565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610c36573d6000803e3d6000fd5b5050506040513d6020811015610c4b57600080fd5b50516040518651600291889160009188916020918201918291908601908083835b60208310610ca957805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610c6c565b6001836020036101000a0380198251168184511680821785525050505050509050018367ffffffffffffffff191667ffffffffffffffff1916815260180182815260200193505050506040516020818303038152906040526040518082805190602001908083835b60208310610d4e57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610d11565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610dab573d6000803e3d6000fd5b5050506040513d6020811015610dc057600080fd5b5051604080516020818101949094528082019290925280518083038201815260609092019081905281519192909182918401908083835b60208310610e3457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610df7565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015610e91573d6000803e3d6000fd5b5050506040513d6020811015610ea657600080fd5b50519050858114610f02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260548152602001806117486054913960600191505060405180910390fd5b60205463ffffffff11610f60576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117276021913960400191505060405180910390fd5b602080546001019081905560005b60208110156110a9578160011660011415610fa0578260008260208110610f9157fe5b0155506110ac95505050505050565b600260008260208110610faf57fe5b01548460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061102557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610fe8565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa158015611082573d6000803e3d6000fd5b5050506040513d602081101561109757600080fd5b50519250600282049150600101610f6e565b50fe5b50505050505050565b60606110c26020546114ba565b905090565b6020546000908190815b60208110156112f05781600116600114156111e6576002600082602081106110f557fe5b01548460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061116b57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161112e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa1580156111c8573d6000803e3d6000fd5b5050506040513d60208110156111dd57600080fd5b505192506112e2565b600283602183602081106111f657fe5b015460405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b6020831061126b57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161122e565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa1580156112c8573d6000803e3d6000fd5b5050506040513d60208110156112dd57600080fd5b505192505b6002820491506001016110d1565b506002826112ff6020546114ba565b600060401b6040516020018084815260200183805190602001908083835b6020831061135a57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161131d565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790527fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000095909516920191825250604080518083037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8018152601890920190819052815191955093508392850191508083835b6020831061143f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611402565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01801990921691161790526040519190930194509192505080830381855afa15801561149c573d6000803e3d6000fd5b5050506040513d60208110156114b157600080fd5b50519250505090565b60408051600880825281830190925260609160208201818036833701905050905060c082901b8060071a60f81b826000815181106114f457fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060061a60f81b8260018151811061153757fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060051a60f81b8260028151811061157a57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060041a60f81b826003815181106115bd57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060031a60f81b8260048151811061160057fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060021a60f81b8260058151811061164357fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060011a60f81b8260068151811061168657fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508060001a60f81b826007815181106116c957fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535050919050565b6000808585111561170d578182fd5b83861115611719578182fd5b505082019391909203915056fe4465706f736974436f6e74726163743a206d65726b6c6520747265652066756c6c4465706f736974436f6e74726163743a207265636f6e7374727563746564204465706f7369744461746120646f6573206e6f74206d6174636820737570706c696564206465706f7369745f646174615f726f6f744465706f736974436f6e74726163743a20696e76616c6964207769746864726177616c5f63726564656e7469616c73206c656e6774684465706f736974436f6e74726163743a206465706f7369742076616c7565206e6f74206d756c7469706c65206f6620677765694465706f736974436f6e74726163743a20696e76616c6964207075626b6579206c656e6774684465706f736974436f6e74726163743a206465706f7369742076616c756520746f6f20686967684465706f736974436f6e74726163743a206465706f7369742076616c756520746f6f206c6f774465706f736974436f6e74726163743a20696e76616c6964207369676e6174757265206c656e677468a2646970667358221220dceca8706b29e917dacf25fceef95acac8d90d765ac926663ce4096195952b6164736f6c634300060b0033", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000022": "0xf5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b", + "0x0000000000000000000000000000000000000000000000000000000000000023": "0xdb56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71", + "0x0000000000000000000000000000000000000000000000000000000000000024": "0xc78009fdf07fc56a11f122370658a353aaa542ed63e44c4bc15ff4cd105ab33c", + "0x0000000000000000000000000000000000000000000000000000000000000025": "0x536d98837f2dd165a55d5eeae91485954472d56f246df256bf3cae19352a123c", + "0x0000000000000000000000000000000000000000000000000000000000000026": "0x9efde052aa15429fae05bad4d0b1d7c64da64d03d7a1854a588c2cb8430c0d30", + "0x0000000000000000000000000000000000000000000000000000000000000027": "0xd88ddfeed400a8755596b21942c1497e114c302e6118290f91e6772976041fa1", + "0x0000000000000000000000000000000000000000000000000000000000000028": "0x87eb0ddba57e35f6d286673802a4af5975e22506c7cf4c64bb6be5ee11527f2c", + "0x0000000000000000000000000000000000000000000000000000000000000029": "0x26846476fd5fc54a5d43385167c95144f2643f533cc85bb9d16b782f8d7db193", + "0x000000000000000000000000000000000000000000000000000000000000002a": "0x506d86582d252405b840018792cad2bf1259f1ef5aa5f887e13cb2f0094f51e1", + "0x000000000000000000000000000000000000000000000000000000000000002b": "0xffff0ad7e659772f9534c195c815efc4014ef1e1daed4404c06385d11192e92b", + "0x000000000000000000000000000000000000000000000000000000000000002c": "0x6cf04127db05441cd833107a52be852868890e4317e6a02ab47683aa75964220", + "0x000000000000000000000000000000000000000000000000000000000000002d": "0xb7d05f875f140027ef5118a2247bbb84ce8f2f0f1123623085daf7960c329f5f", + "0x000000000000000000000000000000000000000000000000000000000000002e": "0xdf6af5f5bbdb6be9ef8aa618e4bf8073960867171e29676f8b284dea6a08a85e", + "0x000000000000000000000000000000000000000000000000000000000000002f": "0xb58d900f5e182e3c50ef74969ea16c7726c549757cc23523c369587da7293784", + "0x0000000000000000000000000000000000000000000000000000000000000030": "0xd49a7502ffcfb0340b1d7885688500ca308161a7f96b62df9d083b71fcc8f2bb", + "0x0000000000000000000000000000000000000000000000000000000000000031": "0x8fe6b1689256c0d385f42f5bbe2027a22c1996e110ba97c171d3e5948de92beb", + "0x0000000000000000000000000000000000000000000000000000000000000032": "0x8d0d63c39ebade8509e0ae3c9c3876fb5fa112be18f905ecacfecb92057603ab", + "0x0000000000000000000000000000000000000000000000000000000000000033": "0x95eec8b2e541cad4e91de38385f2e046619f54496c2382cb6cacd5b98c26f5a4", + "0x0000000000000000000000000000000000000000000000000000000000000034": "0xf893e908917775b62bff23294dbbe3a1cd8e6cc1c35b4801887b646a6f81f17f", + "0x0000000000000000000000000000000000000000000000000000000000000035": "0xcddba7b592e3133393c16194fac7431abf2f5485ed711db282183c819e08ebaa", + "0x0000000000000000000000000000000000000000000000000000000000000036": "0x8a8d7fe3af8caa085a7639a832001457dfb9128a8061142ad0335629ff23ff9c", + "0x0000000000000000000000000000000000000000000000000000000000000037": "0xfeb3c337d7a51a6fbf00b9e34c52e1c9195c969bd4e7a0bfd51d5c5bed9c1167", + "0x0000000000000000000000000000000000000000000000000000000000000038": "0xe71f0aa83cc32edfbefa9f4d3e0174ca85182eec9f3a09f6a6c0df6377a510d7", + "0x0000000000000000000000000000000000000000000000000000000000000039": "0x31206fa80a50bb6abe29085058f16212212a60eec8f049fecb92d8c8e0a84bc0", + "0x000000000000000000000000000000000000000000000000000000000000003a": "0x21352bfecbeddde993839f614c3dac0a3ee37543f9b412b16199dc158e23b544", + "0x000000000000000000000000000000000000000000000000000000000000003b": "0x619e312724bb6d7c3153ed9de791d764a366b389af13c58bf8a8d90481a46765", + "0x000000000000000000000000000000000000000000000000000000000000003c": "0x7cdd2986268250628d0c10e385c58c6191e6fbe05191bcc04f133f2cea72c1c4", + "0x000000000000000000000000000000000000000000000000000000000000003d": "0x848930bd7ba8cac54661072113fb278869e07bb8587f91392933374d017bcbe1", + "0x000000000000000000000000000000000000000000000000000000000000003e": "0x8869ff2c22b28cc10510d9853292803328be4fb0e80495e8bb8d271f5b889636", + "0x000000000000000000000000000000000000000000000000000000000000003f": "0xb5fe28e79f1b850f8658246ce9b6a1e7b49fc06db7143e8fe0b4f2b0c5523a5c", + "0x0000000000000000000000000000000000000000000000000000000000000040": "0x985e929f70af28d0bdd1a90a808f977f597c7c778c489e98d3bd8910d31ac0f7" + } + }, + "0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500" + }, + "0x0aae40965e6800cd9b1f4b05ff21581047e3f91e": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460575767ffffffffffffffff5f3511605357600143035f3511604b575f35612000014311604b57611fff5f3516545f5260205ff35b5f5f5260205ff35b5f5ffd5b5f35611fff60014303165500" + }, + "0x09Fc772D0857550724b07B850a4323f39112aAaA": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460c7573615156028575f545f5260205ff35b36603814156101f05760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146101f057600182026001905f5b5f821115608057810190830284830290049160010191906065565b9093900434106101f057600154600101600155600354806003026004013381556001015f35815560010160203590553360601b5f5260385f601437604c5fa0600101600355005b6003546002548082038060101160db575060105b5f5b81811461017f5780604c02838201600302600401805490600101805490600101549160601b83528260140152807fffffffffffffffffffffffffffffffff0000000000000000000000000000000016826034015260401c906044018160381c81600701538160301c81600601538160281c81600501538160201c81600401538160181c81600301538160101c81600201538160081c81600101535360010160dd565b9101809214610191579060025561019c565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14156101c957505f5b6001546002828201116101de5750505f6101e4565b01600290035b5f555f600155604c025ff35b5f5ffd", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + }, + "0x01aBEa29659e5e97C95107F20bb753cD3e09bBBb": { + "balance": "0", + "nonce": "1", + "code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460cf573615156028575f545f5260205ff35b366060141561019a5760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461019a57600182026001905f5b5f821115608057810190830284830290049160010191906065565b90939004341061019a57600154600101600155600354806004026004013381556001015f358155600101602035815560010160403590553360601b5f5260605f60143760745fa0600101600355005b6003546002548082038060011160e3575060015b5f5b8181146101295780607402838201600402600401805490600101805490600101805490600101549260601b84529083601401528260340152906054015260010160e5565b910180921461013b5790600255610146565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff141561017357505f5b6001546001828201116101885750505f61018e565b01600190035b5f555f6001556074025ff35b5f5ffd", + "storage": { + "0x0000000000000000000000000000000000000000000000000000000000000000": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + } +} diff --git a/tools/t8n/testdata/00-525/env.json b/tools/t8n/testdata/00-525/env.json new file mode 100644 index 000000000..5b72a6929 --- /dev/null +++ b/tools/t8n/testdata/00-525/env.json @@ -0,0 +1,23 @@ +{ + "blockHashes": { + }, + "currentBaseFee": "0x7", + "currentBlobGasUsed": "0x0", + "currentCoinbase": "0xf97e180c050e5ab072211ad2c213eb5aee4df134", + "currentDifficulty": "0x0", + "currentExcessBlobGas": "0x2b80000", + "currentGasLimit": "0x1c9c380", + "currentNumber": "0x1", + "currentRandom": "0x89e03b95990c23f0dbc63247c17d9699464d25d10f9d24a676265bdd82bfb18a", + "currentTimestamp": "0x672bc100", + "parentBaseFee": "0x7", + "parentBeaconBlockRoot": "0x4368de4abb7ed9d11d92d42713a3b3c6e0a271e20d6de882161c2ae1b3a9051f", + "parentBlobGasUsed": "0xc0000", + "parentDifficulty": "0x0", + "parentExcessBlobGas": "0x2b20000", + "parentGasLimit": "0x1c9c380", + "parentGasUsed": "0x430f97", + "parentTimestamp": "0x672bc0f4", + "withdrawals": [ + ] +} diff --git a/tools/t8n/testdata/00-525/env_dca.json b/tools/t8n/testdata/00-525/env_dca.json new file mode 100644 index 000000000..f17788daf --- /dev/null +++ b/tools/t8n/testdata/00-525/env_dca.json @@ -0,0 +1,24 @@ +{ + "blockHashes": { + }, + "currentBaseFee": "0x7", + "currentBlobGasUsed": "0x0", + "currentCoinbase": "0xf97e180c050e5ab072211ad2c213eb5aee4df134", + "currentDifficulty": "0x0", + "currentExcessBlobGas": "0x2b80000", + "currentGasLimit": "0x1c9c380", + "currentNumber": "0x1", + "currentRandom": "0x89e03b95990c23f0dbc63247c17d9699464d25d10f9d24a676265bdd82bfb18a", + "currentTimestamp": "0x672bc100", + "parentBaseFee": "0x7", + "parentBeaconBlockRoot": "0x4368de4abb7ed9d11d92d42713a3b3c6e0a271e20d6de882161c2ae1b3a9051f", + "parentBlobGasUsed": "0xc0000", + "parentDifficulty": "0x0", + "parentExcessBlobGas": "0x2b20000", + "parentGasLimit": "0x1c9c380", + "parentGasUsed": "0x430f97", + "parentTimestamp": "0x672bc0f4", + "withdrawals": [ + ], + "depositContractAddress": "0x4242424242424242424242424242424242424242" +} diff --git a/tools/t8n/testdata/00-525/exp1.json b/tools/t8n/testdata/00-525/exp1.json new file mode 100644 index 000000000..31a149c09 --- /dev/null +++ b/tools/t8n/testdata/00-525/exp1.json @@ -0,0 +1,28 @@ +{ + "result": { + "stateRoot": "0x08fd46faf1bc68f8f3b6c78710d91b825cb22375aa8a3db99ddd9084cbbbfd75", + "txRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "receipts": [], + "currentDifficulty": null, + "gasUsed": "0x0", + "rejected": [ + { + "index": 0, + "error": "invalid chain id: have 7078815900 want 1" + } + ], + "currentBaseFee": "0x7", + "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "currentExcessBlobGas": "0x2b80000", + "blobGasUsed": "0x0", + "requestsHash": "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f", + "requests": [ + "0x", + "0x", + "0x" + ] + } +} diff --git a/tools/t8n/testdata/00-525/exp2.json b/tools/t8n/testdata/00-525/exp2.json new file mode 100644 index 000000000..a3ee77a37 --- /dev/null +++ b/tools/t8n/testdata/00-525/exp2.json @@ -0,0 +1,44 @@ +{ + "result": { + "stateRoot": "0xdbeeef4c53f45167aea35bccfa9329f4a9b59fa7b115dc2f6462eea7316c2600", + "txRoot": "0xe67cc7032923c32bc107773c80dbe2afc754eeed4203ccee50605b9fe15a5bb5", + "receiptsRoot": "0xead5884f735e5e8e703878f0c89b54919d06c2cee8e373d632e730d42b380e0c", + "logsHash": "0x6fb31d3ef4580565e54b679a3bb580d1a4c345faab2cfc7868304e0e5da23f4c", + "logsBloom": "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000", + "receipts": [ + { + "root": "0x", + "status": "0x1", + "cumulativeGasUsed": "0x14aea", + "logsBloom": "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000", + "logs": [ + { + "address": "0x4242424242424242424242424242424242424242", + "topics": [ + "0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003081521c60874daf5b425c21e44caf045c4d475e8b33a557a28cee3c46ef9cf9bd95b4c75a0bb629981b40d0102452dd4c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020020000000000000000000000332e43696a505ef45b9319973785f837ce5267b90000000000000000000000000000000000000000000000000000000000000008000065cd1d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000608c8f2647f342d2c3e8fd07c6b3b9b16383ac11c4be6a6962c7fc18a789daee5fac20ee0bbe4a10383759aaffacacb72b0d67f998730cdf4995fe73afe434dfce2803b343606f67fc4995597c0af9e0fe9ed00006e5889bec29171f670e7d9be200000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000" + } + ], + "transactionHash": "0x75b5508fdcec7682f238fb1ccdc9a087f3f8b601fd52d5c0684123698d89f0a6", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0x14aea", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x0", + "type": "0x2" + } + ], + "currentDifficulty": null, + "gasUsed": "0x14aea", + "currentBaseFee": "0x7", + "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "currentExcessBlobGas": "0x2b80000", + "blobGasUsed": "0x0", + "requestsHash": "0x6036c41849da9c076ed79654d434017387a88fb833c2856b32e18218b3341c5f", + "requests": [ + "0x", + "0x", + "0x" + ] + } +} diff --git a/tools/t8n/testdata/00-525/exp3.json b/tools/t8n/testdata/00-525/exp3.json new file mode 100644 index 000000000..f45453427 --- /dev/null +++ b/tools/t8n/testdata/00-525/exp3.json @@ -0,0 +1,44 @@ +{ + "result": { + "stateRoot": "0xdbeeef4c53f45167aea35bccfa9329f4a9b59fa7b115dc2f6462eea7316c2600", + "txRoot": "0xe67cc7032923c32bc107773c80dbe2afc754eeed4203ccee50605b9fe15a5bb5", + "receiptsRoot": "0xead5884f735e5e8e703878f0c89b54919d06c2cee8e373d632e730d42b380e0c", + "logsHash": "0x6fb31d3ef4580565e54b679a3bb580d1a4c345faab2cfc7868304e0e5da23f4c", + "logsBloom": "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000", + "receipts": [ + { + "root": "0x", + "status": "0x1", + "cumulativeGasUsed": "0x14aea", + "logsBloom": "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000", + "logs": [ + { + "address": "0x4242424242424242424242424242424242424242", + "topics": [ + "0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003081521c60874daf5b425c21e44caf045c4d475e8b33a557a28cee3c46ef9cf9bd95b4c75a0bb629981b40d0102452dd4c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020020000000000000000000000332e43696a505ef45b9319973785f837ce5267b90000000000000000000000000000000000000000000000000000000000000008000065cd1d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000608c8f2647f342d2c3e8fd07c6b3b9b16383ac11c4be6a6962c7fc18a789daee5fac20ee0bbe4a10383759aaffacacb72b0d67f998730cdf4995fe73afe434dfce2803b343606f67fc4995597c0af9e0fe9ed00006e5889bec29171f670e7d9be200000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000" + } + ], + "transactionHash": "0x75b5508fdcec7682f238fb1ccdc9a087f3f8b601fd52d5c0684123698d89f0a6", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0x14aea", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x0", + "type": "0x2" + } + ], + "currentDifficulty": null, + "gasUsed": "0x14aea", + "currentBaseFee": "0x7", + "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "currentExcessBlobGas": "0x2b80000", + "blobGasUsed": "0x0", + "requestsHash": "0xa5c19ed76c01fe25a67b7ef8c227caa34951e8c7e74168408b5be0861dac686d", + "requests": [ + "0x81521c60874daf5b425c21e44caf045c4d475e8b33a557a28cee3c46ef9cf9bd95b4c75a0bb629981b40d0102452dd4c020000000000000000000000332e43696a505ef45b9319973785f837ce5267b9000065cd1d0000008c8f2647f342d2c3e8fd07c6b3b9b16383ac11c4be6a6962c7fc18a789daee5fac20ee0bbe4a10383759aaffacacb72b0d67f998730cdf4995fe73afe434dfce2803b343606f67fc4995597c0af9e0fe9ed00006e5889bec29171f670e7d9be20000000000000000", + "0x", + "0x" + ] + } +} diff --git a/tools/t8n/testdata/00-525/txs.rlp b/tools/t8n/testdata/00-525/txs.rlp new file mode 100644 index 000000000..6410c11e6 --- /dev/null +++ b/tools/t8n/testdata/00-525/txs.rlp @@ -0,0 +1 @@ +"0xf90226b9022302f9021f8501a5ee289c07840e07899f840e07899f8302c0c19442424242424242424242424242424242424242428906f05b59d3b2000000b901a422895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001206c240a071b7048221c3f53bb0e66debee5330def076d51c9958c776e3f13d5d4000000000000000000000000000000000000000000000000000000000000003081521c60874daf5b425c21e44caf045c4d475e8b33a557a28cee3c46ef9cf9bd95b4c75a0bb629981b40d0102452dd4c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020020000000000000000000000332e43696a505ef45b9319973785f837ce5267b900000000000000000000000000000000000000000000000000000000000000608c8f2647f342d2c3e8fd07c6b3b9b16383ac11c4be6a6962c7fc18a789daee5fac20ee0bbe4a10383759aaffacacb72b0d67f998730cdf4995fe73afe434dfce2803b343606f67fc4995597c0af9e0fe9ed00006e5889bec29171f670e7d9be2c001a0e36549b612e7fd2c1b0635025782f6c4841317a1a4b4614b3a39b95754fca7f6a014ca51a1714612ee97e1b5a785bd0c8e388f46539d36cc8ef014127a0bfcf05a" \ No newline at end of file diff --git a/tools/t8n/transition.nim b/tools/t8n/transition.nim index d3bc5b08f..58ab9bcc8 100644 --- a/tools/t8n/transition.nim +++ b/tools/t8n/transition.nim @@ -150,7 +150,7 @@ proc defaultTraceStreamFilename(conf: T8NConf, txIndex: int, txHash: Hash32): (string, string) = let - txHash = "0x" & toLowerAscii($txHash) + txHash = toLowerAscii($txHash) baseDir = if conf.outputBaseDir.len > 0: conf.outputBaseDir else: @@ -167,8 +167,9 @@ proc traceToFileStream(path: string, txIndex: int): Stream = # replace whatever `.ext` to `-${txIndex}.jsonl` let file = path.splitFile - fName = "$1/$2-$3.jsonl" % [file.dir, file.name, $txIndex] - createDir(file.dir) + folder = if file.dir.len == 0: "." else: file.dir + fName = "$1/$2-$3.jsonl" % [folder, file.name, $txIndex] + if file.dir.len > 0: createDir(file.dir) newFileStream(fName, fmWrite) proc setupTrace(conf: T8NConf, txIndex: int, txHash: Hash32, vmState: BaseVMState): bool = @@ -355,10 +356,11 @@ proc exec(ctx: TransContext, for rec in result.result.receipts: allLogs.add rec.logs let - depositReqs = parseDepositLogs(allLogs).valueOr: + depositReqs = parseDepositLogs(allLogs, vmState.com.depositContractAddress).valueOr: raise newError(ErrorEVM, error) requestsHash = calcRequestsHash(depositReqs, withdrawalReqs, consolidationReqs) result.result.requestsHash = Opt.some(requestsHash) + result.result.requests = Opt.some([depositReqs, withdrawalReqs, consolidationReqs]) template wrapException(body: untyped) = when wrapExceptionEnabled: @@ -424,11 +426,6 @@ proc transitionAction*(ctx: var TransContext, conf: T8NConf) = if conf.inputAlloc.len == 0 and conf.inputEnv.len == 0 and conf.inputTxs.len == 0: raise newError(ErrorConfig, "either one of input is needeed(alloc, txs, or env)") - let config = parseChainConfig(conf.stateFork) - config.chainId = conf.stateChainId.ChainId - - let com = CommonRef.new(newCoreDbRef DefaultDbMemory, config) - # We need to load three things: alloc, env and transactions. # May be either in stdin input or in files. @@ -446,7 +443,7 @@ proc transitionAction*(ctx: var TransContext, conf: T8NConf) = if conf.inputTxs != stdinSelector and conf.inputTxs.len > 0: if conf.inputTxs.endsWith(".rlp"): let data = readFile(conf.inputTxs) - ctx.parseTxsRlp(data.strip(chars={'"'})) + ctx.parseTxsRlp(data.strip(chars={'"', ' ', '\r', '\n', '\t'})) else: ctx.parseTxsJson(conf.inputTxs) @@ -465,6 +462,12 @@ proc transitionAction*(ctx: var TransContext, conf: T8NConf) = excessBlobGas: ctx.env.parentExcessBlobGas, ) + let config = parseChainConfig(conf.stateFork) + config.depositContractAddress = ctx.env.depositContractAddress + config.chainId = conf.stateChainId.ChainId + + let com = CommonRef.new(newCoreDbRef DefaultDbMemory, config) + # Sanity check, to not `panic` in state_transition if com.isLondonOrLater(ctx.env.currentNumber): if ctx.env.currentBaseFee.isSome: diff --git a/tools/t8n/types.nim b/tools/t8n/types.nim index 1ed23477f..eb8eba6c1 100644 --- a/tools/t8n/types.nim +++ b/tools/t8n/types.nim @@ -52,6 +52,7 @@ type parentBlobGasUsed*: Opt[uint64] parentExcessBlobGas*: Opt[uint64] parentBeaconBlockRoot*: Opt[Hash32] + depositContractAddress*: Opt[Address] TxObject* = object `type`*: Opt[uint64] @@ -117,6 +118,7 @@ type blobGasUsed*: Opt[uint64] currentExcessBlobGas*: Opt[uint64] requestsHash*: Opt[Hash32] + requests*: Opt[array[3, seq[byte]]] const ErrorEVM* = 2.T8NExitCode