From 12aea42c00abe790882349b476143e70c480a879 Mon Sep 17 00:00:00 2001 From: jangko Date: Tue, 11 Apr 2023 10:43:36 +0700 Subject: [PATCH 1/2] fix t8n's EthAddress parser --- tools/t8n/helpers.nim | 10 ++++++++-- tools/t8n/t8n_test.nim | 9 +++++++++ tools/t8n/testdata/00-515/alloc.json | 8 ++++++++ tools/t8n/testdata/00-515/env.json | 17 +++++++++++++++++ tools/t8n/testdata/00-515/txs.json | 1 + 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tools/t8n/testdata/00-515/alloc.json create mode 100644 tools/t8n/testdata/00-515/env.json create mode 100644 tools/t8n/testdata/00-515/txs.json diff --git a/tools/t8n/helpers.nim b/tools/t8n/helpers.nim index 0e4e4ab4b..e8c936908 100644 --- a/tools/t8n/helpers.nim +++ b/tools/t8n/helpers.nim @@ -34,8 +34,14 @@ proc parseHexOrInt[T](x: string): T = else: parseInt(x).T -template fromJson(T: type EthAddress, n: JsonNode, field: string): EthAddress = - hexToByteArray(n[field].getStr(), sizeof(T)) +proc fromJson(T: type EthAddress, n: JsonNode, field: string): EthAddress = + let x = n[field].getStr() + var xlen = x.len + if x.startsWith("0x"): + xlen = xlen - 2 + if xlen != sizeof(T) * 2: + raise newError(ErrorJson, "malformed Eth address " & x) + hexToByteArray(x, sizeof(T)) template fromJson(T: type Blob, n: JsonNode, field: string): Blob = hexToSeqByte(n[field].getStr()) diff --git a/tools/t8n/t8n_test.nim b/tools/t8n/t8n_test.nim index 2cc5d5a92..068792445 100644 --- a/tools/t8n/t8n_test.nim +++ b/tools/t8n/t8n_test.nim @@ -448,6 +448,15 @@ const output: T8nOutput(alloc: true, result: true), expOut: "exp.json", ), + TestSpec( + name : "Malicious withdrawals address", + base : "testdata/00-515", + input : t8nInput( + "alloc.json", "txs.json", "env.json", "Shanghai", "", + ), + output: T8nOutput(alloc: false, result: false), + expExitCode: ErrorJson.int, + ), ] proc main() = diff --git a/tools/t8n/testdata/00-515/alloc.json b/tools/t8n/testdata/00-515/alloc.json new file mode 100644 index 000000000..d67655a8a --- /dev/null +++ b/tools/t8n/testdata/00-515/alloc.json @@ -0,0 +1,8 @@ +{ + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "0x0", + "code": "0x", + "nonce": "0xac", + "storage": {} + } +} diff --git a/tools/t8n/testdata/00-515/env.json b/tools/t8n/testdata/00-515/env.json new file mode 100644 index 000000000..fc2ad69c0 --- /dev/null +++ b/tools/t8n/testdata/00-515/env.json @@ -0,0 +1,17 @@ +{ + "currentCoinbase": "0xc94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "currentDifficulty": null, + "currentRandom": "0xdeadc0de", + "currentGasLimit": "0x750a163df65e8a", + "currentBaseFee": "0x500", + "currentNumber": "1", + "currentTimestamp": "1000", + "withdrawals": [ + { + "index" : "0x0", + "validatorIndex" : "0x0", + "amount" : "0x2710", + "address" : "0x00c94f5374fce5edbc8e2a8697c15331677e6ebf0b" + } + ] +} diff --git a/tools/t8n/testdata/00-515/txs.json b/tools/t8n/testdata/00-515/txs.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/tools/t8n/testdata/00-515/txs.json @@ -0,0 +1 @@ +[] From 918c1309c828ecf7e17151fcdc6dd5d509550960 Mon Sep 17 00:00:00 2001 From: jangko Date: Tue, 11 Apr 2023 15:28:45 +0700 Subject: [PATCH 2/2] fix processTransaction's gasLimit --- nimbus/core/executor/executor_helpers.nim | 2 + nimbus/core/executor/process_block.nim | 7 +- nimbus/core/executor/process_transaction.nim | 24 ++++- nimbus/core/tx_pool/tx_tasks/tx_packer.nim | 13 +++ nimbus/evm/state.nim | 3 +- nimbus/evm/types.nim | 1 + tests/test_rpc.nim | 7 +- tests/test_txpool.nim | 17 +-- tools/t8n/t8n_test.nim | 9 ++ tools/t8n/testdata/00-516/alloc.json | 16 +++ tools/t8n/testdata/00-516/env.json | 13 +++ tools/t8n/testdata/00-516/exp.json | 107 +++++++++++++++++++ tools/t8n/testdata/00-516/txs.rlp | 1 + 13 files changed, 201 insertions(+), 19 deletions(-) create mode 100644 tools/t8n/testdata/00-516/alloc.json create mode 100644 tools/t8n/testdata/00-516/env.json create mode 100644 tools/t8n/testdata/00-516/exp.json create mode 100644 tools/t8n/testdata/00-516/txs.rlp diff --git a/nimbus/core/executor/executor_helpers.nim b/nimbus/core/executor/executor_helpers.nim index f6e81d388..711e63e3f 100644 --- a/nimbus/core/executor/executor_helpers.nim +++ b/nimbus/core/executor/executor_helpers.nim @@ -55,6 +55,8 @@ proc makeReceipt*(vmState: BaseVMState; txType: TxType): Receipt = else: rec.isHash = true rec.hash = vmState.stateDB.rootHash + # we set the status for the t8n output consistency + rec.status = vmState.status rec.receiptType = txType rec.cumulativeGasUsed = vmState.cumulativeGasUsed diff --git a/nimbus/core/executor/process_block.nim b/nimbus/core/executor/process_block.nim index c3b0de726..29f83f2f1 100644 --- a/nimbus/core/executor/process_block.nim +++ b/nimbus/core/executor/process_block.nim @@ -17,6 +17,7 @@ import ../../utils/utils, ../../vm_state, ../../vm_types, + ../../utils/debug, ../clique, ../dao, ./calculate_reward, @@ -45,10 +46,12 @@ proc processTransactions*(vmState: BaseVMState; for txIndex, tx in transactions: var sender: EthAddress if not tx.getSender(sender): - return err("Could not get sender for tx with index " & $(txIndex) & ": " & $(tx)) + let debugTx =tx.debug() + return err("Could not get sender for tx with index " & $(txIndex) & ": " & debugTx) let rc = vmState.processTransaction(tx, sender, header) if rc.isErr: - return err("Error processing tx with index " & $(txIndex) & ": " & $(tx)) + let debugTx =tx.debug() + return err("Error processing tx with index " & $(txIndex) & ": " & debugTx) vmState.receipts[txIndex] = vmState.makeReceipt(tx.txType) ok() diff --git a/nimbus/core/executor/process_transaction.nim b/nimbus/core/executor/process_transaction.nim index 263df070a..6b7a6423a 100644 --- a/nimbus/core/executor/process_transaction.nim +++ b/nimbus/core/executor/process_transaction.nim @@ -34,15 +34,17 @@ proc eip1559BaseFee(header: BlockHeader; fork: EVMFork): UInt256 = if FkLondon <= fork: result = header.baseFee -proc commitOrRollbackDependingOnGasUsed(vmState: BaseVMState, accTx: SavePoint, gasLimit: GasInt, gasBurned: GasInt, priorityFee: GasInt): Result[GasInt, void] {.raises: [Defect, RlpError].} = +proc commitOrRollbackDependingOnGasUsed(vmState: BaseVMState, accTx: SavePoint, + header: BlockHeader, tx: Transaction, + gasBurned: GasInt, priorityFee: GasInt): Result[GasInt, void] {.raises: [Defect, RlpError].} = # Make sure that the tx does not exceed the maximum cumulative limit as # set in the block header. Again, the eip-1559 reference does not mention # an early stop. It would rather detect differing values for the block # header `gasUsed` and the `vmState.cumulativeGasUsed` at a later stage. - if gasLimit < vmState.cumulativeGasUsed + gasBurned: + if header.gasLimit < vmState.cumulativeGasUsed + gasBurned: vmState.stateDB.rollback(accTx) debug "invalid tx: block header gasLimit reached", - maxLimit = gasLimit, + maxLimit = header.gasLimit, gasUsed = vmState.cumulativeGasUsed, addition = gasBurned return err() @@ -51,6 +53,10 @@ proc commitOrRollbackDependingOnGasUsed(vmState: BaseVMState, accTx: SavePoint, vmState.stateDB.commit(accTx) vmState.stateDB.addBalance(vmState.coinbase(), gasBurned.u256 * priorityFee.u256) vmState.cumulativeGasUsed += gasBurned + + # Return remaining gas to the block gas counter so it is + # available for the next transaction. + vmState.gasPool += tx.gasLimit - gasBurned return ok(gasBurned) proc asyncProcessTransactionImpl( @@ -66,7 +72,7 @@ proc asyncProcessTransactionImpl( #trace "Sender", sender #trace "txHash", rlpHash = ty.rlpHash - + let roDB = vmState.readOnlyStateDB baseFee256 = header.eip1559BaseFee(fork) @@ -81,6 +87,14 @@ proc asyncProcessTransactionImpl( if tx.to.isSome: await ifNecessaryGetCode(vmState, tx.to.get) + # buy gas, then the gas goes into gasMeter + if vmState.gasPool < tx.gasLimit: + debug "gas limit reached", + gasLimit = vmState.gasPool, + gasNeeded = tx.gasLimit + return + vmState.gasPool -= tx.gasLimit + # Actually, the eip-1559 reference does not mention an early exit. # # Even though database was not changed yet but, a `persist()` directive @@ -94,7 +108,7 @@ proc asyncProcessTransactionImpl( accTx = vmState.stateDB.beginSavepoint gasBurned = tx.txCallEvm(sender, vmState, fork) - res = commitOrRollbackDependingOnGasUsed(vmState, accTx, header.gasLimit, gasBurned, priorityFee) + res = commitOrRollbackDependingOnGasUsed(vmState, accTx, header, tx, gasBurned, priorityFee) if vmState.generateWitness: vmState.stateDB.collectWitnessData() diff --git a/nimbus/core/tx_pool/tx_tasks/tx_packer.nim b/nimbus/core/tx_pool/tx_tasks/tx_packer.nim index 0a77ccbb0..b71c1ff51 100644 --- a/nimbus/core/tx_pool/tx_tasks/tx_packer.nim +++ b/nimbus/core/tx_pool/tx_tasks/tx_packer.nim @@ -129,6 +129,11 @@ proc runTxCommit(pst: TxPackerStateRef; item: TxItemRef; gasBurned: GasInt) if vmState.receipts.len <= inx: vmState.receipts.setLen(inx + receiptsExtensionSize) + # Return remaining gas to the block gas counter so it is + # available for the next transaction. + vmState.gasPool += item.tx.gasLimit - gasBurned + + # gasUsed accounting vmState.cumulativeGasUsed += gasBurned vmState.receipts[inx] = vmState.makeReceipt(item.tx.txType) @@ -170,6 +175,14 @@ proc vmExecGrabItem(pst: TxPackerStateRef; item: TxItemRef): Result[bool,void] xp = pst.xp vmState = xp.chain.vmState + # Verify we have enough gas in gasPool + if vmState.gasPool < item.tx.gasLimit: + # skip this transaction and + # continue with next account + # if we don't have enough gas + return ok(false) + vmState.gasPool -= item.tx.gasLimit + # Validate transaction relative to the current vmState if not xp.classifyValidatePacked(vmState, item): return ok(false) # continue with next account diff --git a/nimbus/evm/state.nim b/nimbus/evm/state.nim index f99f7b461..c68611c3d 100644 --- a/nimbus/evm/state.nim +++ b/nimbus/evm/state.nim @@ -39,6 +39,7 @@ proc init( self.parent = parent self.timestamp = timestamp self.gasLimit = gasLimit + self.gasPool = gasLimit self.fee = fee self.prevRandao = prevRandao self.blockDifficulty = difficulty @@ -67,7 +68,7 @@ proc init( ac = ac, parent = parent, timestamp = timestamp, - gasLimit = gasLimit, + gasLimit = gasLimit, fee = fee, prevRandao= prevRandao, difficulty= difficulty, diff --git a/nimbus/evm/types.nim b/nimbus/evm/types.nim index 3e764fae1..0dd65b5ef 100644 --- a/nimbus/evm/types.nim +++ b/nimbus/evm/types.nim @@ -38,6 +38,7 @@ type BaseVMState* = ref object of RootObj prevHeaders* : seq[BlockHeader] com* : CommonRef + gasPool* : GasInt parent* : BlockHeader timestamp* : EthTime gasLimit* : GasInt diff --git a/tests/test_rpc.nim b/tests/test_rpc.nim index ef846ee3d..c0ef5e3bb 100644 --- a/tests/test_rpc.nim +++ b/tests/test_rpc.nim @@ -55,7 +55,7 @@ proc setupEnv(com: CommonRef, signer, ks2: EthAddress, ctx: EthContext): TestEnv Return let - vmHeader = BlockHeader(parentHash: parentHash) + vmHeader = BlockHeader(parentHash: parentHash, gasLimit: 5_000_000) vmState = BaseVMState.new( parent = BlockHeader(stateRoot: parent.stateRoot), header = vmHeader, @@ -75,7 +75,7 @@ proc setupEnv(com: CommonRef, signer, ks2: EthAddress, ctx: EthContext): TestEnv ) unsignedTx2 = Transaction( txType : TxLegacy, - nonce : 0, + nonce : 1, gasPrice: 1_200, gasLimit: 70_000, value : 2.u256, @@ -91,7 +91,8 @@ proc setupEnv(com: CommonRef, signer, ks2: EthAddress, ctx: EthContext): TestEnv vmState.cumulativeGasUsed = 0 for txIndex, tx in txs: let sender = tx.getSender() - discard vmState.processTransaction(tx, sender, vmHeader) + let rc = vmState.processTransaction(tx, sender, vmHeader) + doAssert(rc.isOk, "Invalid transaction") vmState.receipts[txIndex] = makeReceipt(vmState, tx.txType) let diff --git a/tests/test_txpool.nim b/tests/test_txpool.nim index cb3bec2ef..3c43b825c 100644 --- a/tests/test_txpool.nim +++ b/tests/test_txpool.nim @@ -211,6 +211,7 @@ proc runTxLoader(noisy = true; capture = loadSpecs) = check 0.GasPrice <= minGasPrice check minGasPrice <= maxGasPrice + proc runTxPoolTests(noisy = true) = let elapNoisy = false @@ -688,7 +689,7 @@ proc runTxPackerTests(noisy = true) = # verify incremental packing check lastItem.info != newItem.info - check saveStats.packed <= newStats.packed + check saveStats.packed >= newStats.packed noisy.say "***", "2st bLock size=", newTotal, " stats=", newStats.pp @@ -752,7 +753,7 @@ proc runTxPackerTests(noisy = true) = " max=", xq.maxGasLimit, " slack=", xq.maxGasLimit - xq.gasCumulative - check smallerBlockSize < xq.gasCumulative + check smallerBlockSize <= xq.gasCumulative check 0 < xq.profitability # Well, this ratio should be above 100 but might be slightly less @@ -780,7 +781,7 @@ proc runTxPackerTests(noisy = true) = # Force maximal block size. Accidentally, the latest tx should have # a `gasLimit` exceeding the available space on the block `gasLimit` # which will be checked below. - xq.flags = xq.flags + {packItemsMaxGasLimit} + xq.flags = xq.flags #+ {packItemsMaxGasLimit} # Invoke packer let blk = xq.ethBlock @@ -814,7 +815,7 @@ proc runTxPackerTests(noisy = true) = bdy = BlockBody(transactions: blk.txs) hdr = block: var rc = blk.header - rc.gasLimit = blk.header.gasUsed + rc.gasLimit = blk.header.gasLimit rc.testKeySign # Make certain that some tx was set up so that its gasLimit overlaps @@ -825,7 +826,7 @@ proc runTxPackerTests(noisy = true) = setTraceLevel() # Test low-level function for adding the new block to the database - xq.chain.maxMode = (packItemsMaxGasLimit in xq.flags) + #xq.chain.maxMode = (packItemsMaxGasLimit in xq.flags) xq.chain.clearAccounts check xq.chain.vmState.processBlock(poa, hdr, bdy).isOK @@ -886,9 +887,9 @@ when isMainModule: noisy.runTxPoolTests noisy.runTxPackerTests - #runTxPoolCliqueTest() - #runTxPoolPosTest() - #noisy.runTxHeadDelta + runTxPoolCliqueTest() + runTxPoolPosTest() + noisy.runTxHeadDelta #noisy.runTxLoader(dir = ".") #noisy.runTxPoolTests diff --git a/tools/t8n/t8n_test.nim b/tools/t8n/t8n_test.nim index 068792445..82269f960 100644 --- a/tools/t8n/t8n_test.nim +++ b/tools/t8n/t8n_test.nim @@ -457,6 +457,15 @@ const output: T8nOutput(alloc: false, result: false), expExitCode: ErrorJson.int, ), + TestSpec( + name : "GasUsedHigherThanBlockGasLimitButNotWithRefundsSuicideLast_Frontier", + base : "testdata/00-516", + input : t8nInput( + "alloc.json", "txs.rlp", "env.json", "Frontier", "5000000000000000000", + ), + output: T8nOutput(alloc: true, result: true), + expOut: "exp.json", + ), ] proc main() = diff --git a/tools/t8n/testdata/00-516/alloc.json b/tools/t8n/testdata/00-516/alloc.json new file mode 100644 index 000000000..881a2dba0 --- /dev/null +++ b/tools/t8n/testdata/00-516/alloc.json @@ -0,0 +1,16 @@ +{ + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x4a723dc6b40b8a9a000000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x02540be400", + "code" : "0x73a94f5374fce5edbc8e2a8697c15331677e6ebf0bff", + "nonce" : "0x00", + "storage" : { + } + } +} \ No newline at end of file diff --git a/tools/t8n/testdata/00-516/env.json b/tools/t8n/testdata/00-516/env.json new file mode 100644 index 000000000..28c086c8a --- /dev/null +++ b/tools/t8n/testdata/00-516/env.json @@ -0,0 +1,13 @@ +{ + "currentCoinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "currentNumber" : "0x01", + "currentTimestamp" : "0x5db6fbd9", + "currentGasLimit" : "0x023dd4", + "previousHash" : "0xce1f26f798dd03c8782d63b3e42e79a64eaea5694ea686ac5d7ce3df5171d1ae", + "parentTimestamp" : "0x54c98c81", + "parentDifficulty" : "0x020000", + "parentUncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "blockHashes" : { + "0" : "0xce1f26f798dd03c8782d63b3e42e79a64eaea5694ea686ac5d7ce3df5171d1ae" + } +} \ No newline at end of file diff --git a/tools/t8n/testdata/00-516/exp.json b/tools/t8n/testdata/00-516/exp.json new file mode 100644 index 000000000..4e2f71715 --- /dev/null +++ b/tools/t8n/testdata/00-516/exp.json @@ -0,0 +1,107 @@ +{ + "alloc": { + "0x8888f1f195afa192cfee860698584c030f4c9db1": { + "balance": "0x45639182450739e0" + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "0x4a723dc6b40b8a99ecc5e4", + "nonce": "0x6" + }, + "0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b": { + "code": "0x73a94f5374fce5edbc8e2a8697c15331677e6ebf0bff", + "balance": "0x2540be400" + }, + "0xbbbf5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "0x3c" + } + }, + "result": { + "stateRoot": "0x01302fffb8d883bc90239b365b1a3ab589fdb5027eb611dc76ad1c80d0617088", + "txRoot": "0x4f808a207db7e3d77f93191e5b51533ee9c6b6ec143d99ef869de4d74ca70d46", + "receiptsRoot": "0x078d3e92ea6a94eddfbbce62275dda41f0321c91dc39ab4356eb00b7ae053c84", + "logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "receipts": [ + { + "root": "0x503d6f5102f2655eb2e416816ecdcfa409c308f08f5568c9ff58968752b816a9", + "status": "0x1", + "cumulativeGasUsed": "0x5208", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logs": null, + "transactionHash": "0xd7627098e82f73dce927000f301f4ecba5c5d9ebd4dc6441923997edb527d14e", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0x5208", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x0" + }, + { + "root": "0xb50c809975adf6096ae520fe9d2a1dd4bd506cf89d71797b98d16e67728e0f00", + "status": "0x1", + "cumulativeGasUsed": "0xa410", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logs": null, + "transactionHash": "0x70124c1b866b394d0cf7a2b0a43d2f793ae596e81882b47365ba64bf0a455367", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0x5208", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x1" + }, + { + "root": "0xc08bde0cb31e13b8e99c33630fdb3d207dff2318ae57e826031cd25e52052ab1", + "status": "0x1", + "cumulativeGasUsed": "0xf618", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logs": null, + "transactionHash": "0x956941fdd970385645166c2bab8a8801d0de9344798c19e384b3f63693617bd4", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0x5208", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x2" + }, + { + "root": "0x7c044706eb426811e7113de82ddde25a48e348f40f85cdd5a019cf1e1e9e6c27", + "status": "0x1", + "cumulativeGasUsed": "0x14820", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logs": null, + "transactionHash": "0x6663fb65a878bdc382667788eabcde3b445e46a8ee8bf14e5fe44b9453a0f8e9", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0x5208", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x3" + }, + { + "root": "0xd15b67b3a578738c2fc34693e638c83d4a1fa07bcf4bf97022d8adbc9f32d8c1", + "status": "0x1", + "cumulativeGasUsed": "0x19a28", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logs": null, + "transactionHash": "0xb9a44da77e17296e75c32392781b7463303f9bf5e5127a28a475f9de4c25d895", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0x5208", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x4" + }, + { + "root": "0xb583fdc2123544386f58e863f5f2cb508ff5d012ecc77c4b6b9627a8d722ca6a", + "status": "0x1", + "cumulativeGasUsed": "0x1ec30", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "logs": null, + "transactionHash": "0xad384166e58d188e68db9a5329133b2456a77929f4ab72bb2546f5b04430479f", + "contractAddress": "0x0000000000000000000000000000000000000000", + "gasUsed": "0x5208", + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionIndex": "0x5" + } + ], + "rejected": [ + { + "index": 6, + "error": "processTransaction failed" + } + ], + "currentDifficulty": "0x20000", + "gasUsed": "0x1ec30" + } +} \ No newline at end of file diff --git a/tools/t8n/testdata/00-516/txs.rlp b/tools/t8n/testdata/00-516/txs.rlp new file mode 100644 index 000000000..6b4f700cc --- /dev/null +++ b/tools/t8n/testdata/00-516/txs.rlp @@ -0,0 +1 @@ +"0xf902a7f85f800a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ba01117bd549fe17f8383012bf168dabd9e70851fdf2f332e5bfea89318dddd6c77a001364d3a0e23f462052127c53a5473c428e2211806c927601562f840eb6b899cf85f010a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ba04fa966bf34b93abc1bcd665554b7f316b50f928477b50be0f3285ead29d18c5ba017bba0eeec1625ab433746955e125d46d80b7fdc97386c51266f842d8e02192ef85f020a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca004377418ae981cc32b1312b4a427a1d69a821b28db8584f5f2bd8c6d42458adaa053a1dba1af177fac92f3b6af0a9fa46a22adf56e686c93794b6a012bf254abf5f85f030a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca04fe13febd28a05f4fcb2f451d7ddc2dda56486d9f8c79a62b0ba4da775122615a0651b2382dd402df9ebc27f8cb4b2e0f3cea68dda2dca0ee9603608f0b6f51668f85f040a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ba078e6a0ba086a08f8450e208a399bb2f2d2a0d984acd2517c7c7df66ccfab567da013254002cd45a97fac049ae00afbc43ed0d9961d0c56a3b2382c80ce41c198ddf85f050a82520894bbbf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ba0a7174d8f43ea71c8e3ca9477691add8d80ac8e0ed89d8d8b572041eef81f4a54a0534ea2e28ec4da3b5b944b18c51ec84a5cf35f5b3343c5fb86521fd2d388f506f85f060a8255f094aaaf5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca0c40c1300a7cc64b842c9421a6c6e985b5531020d1a26c82f9c6a5200154e91dfa052c28fc6dc0dad9ea23fcce6510a9dc23b9903b1b19a126ac25f77a195b50f83" \ No newline at end of file