diff --git a/nimbus/db/aristo/aristo_part/part_chain_rlp.nim b/nimbus/db/aristo/aristo_part/part_chain_rlp.nim index 893ef980a..4bd4acb05 100644 --- a/nimbus/db/aristo/aristo_part/part_chain_rlp.nim +++ b/nimbus/db/aristo/aristo_part/part_chain_rlp.nim @@ -13,7 +13,7 @@ import eth/common, results, - ".."/[aristo_desc, aristo_get, aristo_utils, aristo_compute, aristo_serialise] + ".."/[aristo_desc, aristo_get, aristo_utils, aristo_serialise] const ChainRlpNodesNoEntry* = { diff --git a/tools/t8n/helpers.nim b/tools/t8n/helpers.nim index 1c2632312..bb77d7ef6 100644 --- a/tools/t8n/helpers.nim +++ b/tools/t8n/helpers.nim @@ -264,7 +264,8 @@ proc parseTxJson(txo: TxObject, chainId: ChainId): Result[Transaction, string] = optional(accessList) required(authorizationList) - if tx.chainId != chainId: + # Ignore chainId if txType == TxLegacy + if tx.txType > TxLegacy and tx.chainId != chainId: return err("invalid chain id: have " & $tx.chainId & " want " & $chainId) let eip155 = txo.protected.get(true) @@ -285,10 +286,10 @@ proc readNestedTx(rlp: var Rlp, chainId: ChainId): Result[Transaction, string] = 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) + # Ignore chainId if txType == TxLegacy + if tx.txType > TxLegacy and tx.chainId != chainId: + return err("invalid chain id: have " & $tx.chainId & " want " & $chainId) + ok(tx) except RlpError as exc: err(exc.msg) diff --git a/tools/t8n/t8n_test.nim b/tools/t8n/t8n_test.nim index c49c86635..7840402cd 100644 --- a/tools/t8n/t8n_test.nim +++ b/tools/t8n/t8n_test.nim @@ -169,7 +169,7 @@ proc runTest(appDir: string, spec: TestSpec): bool = if spec.expOut.len > 0: if spec.expOut.endsWith(".json"): - let path = base / spec.expOut + let path = base / spec.expOut try: let want = json.parseFile(path) let have = json.parseJson(res) @@ -470,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", "0" + "alloc.json", "txs.rlp", "env.json", "Berlin", "0" ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json", @@ -479,7 +479,7 @@ const name : "Revert In Create In Init", base : "testdata/00-513", input : t8nInput( - "alloc.json", "txs.rlp", "env.json", "Berlin", "0", "0" + "alloc.json", "txs.rlp", "env.json", "Berlin", "0" ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json", @@ -488,7 +488,7 @@ const name : "Init collision 3", base : "testdata/00-514", input : t8nInput( - "alloc.json", "txs.rlp", "env.json", "Berlin", "0", "0" + "alloc.json", "txs.rlp", "env.json", "Berlin", "0" ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json", @@ -506,7 +506,7 @@ const name : "GasUsedHigherThanBlockGasLimitButNotWithRefundsSuicideLast_Frontier", base : "testdata/00-516", input : t8nInput( - "alloc.json", "txs.rlp", "env.json", "Frontier", "5000000000000000000", "0" + "alloc.json", "txs.rlp", "env.json", "Frontier", "5000000000000000000" ), output: T8nOutput(alloc: true, result: true), expOut: "exp.json",