2023-11-01 03:32:09 +00:00
|
|
|
# Nimbus
|
2024-01-13 01:41:57 +00:00
|
|
|
# Copyright (c) 2019-2024 Status Research & Development GmbH
|
2023-11-01 03:32:09 +00:00
|
|
|
# Licensed under either of
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
|
|
|
|
# http://opensource.org/licenses/MIT)
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except
|
|
|
|
# according to those terms.
|
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
{.push raises: [].}
|
2024-06-18 11:14:02 +00:00
|
|
|
|
2018-12-03 10:54:19 +00:00
|
|
|
import
|
2022-12-02 04:39:12 +00:00
|
|
|
std/[strutils, json],
|
2024-08-01 10:41:20 +00:00
|
|
|
nimcrypto/utils as ncrutils,
|
|
|
|
results,
|
|
|
|
web3/conversions,
|
2024-10-04 14:34:31 +00:00
|
|
|
eth/common/transaction_utils,
|
2024-08-01 10:41:20 +00:00
|
|
|
./beacon/web3_eth_conv,
|
2022-12-02 04:39:12 +00:00
|
|
|
./common/common,
|
2024-08-01 10:41:20 +00:00
|
|
|
./constants,
|
|
|
|
./core/executor,
|
2023-12-12 19:12:56 +00:00
|
|
|
./db/[core_db, ledger],
|
2024-08-01 10:41:20 +00:00
|
|
|
./evm/[code_bytes, state, types],
|
2023-08-02 10:17:40 +00:00
|
|
|
./evm/tracer/legacy_tracer,
|
2024-06-17 07:56:39 +00:00
|
|
|
./transaction,
|
2024-08-01 10:41:20 +00:00
|
|
|
./utils/utils
|
2018-12-03 16:22:08 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
when not CoreDbEnableCaptJournal:
|
|
|
|
{.error: "Compiler flag missing for tracer, try -d:dbjapi_enabled".}
|
2018-12-03 16:22:08 +00:00
|
|
|
|
2024-03-22 17:31:56 +00:00
|
|
|
type
|
2024-08-01 10:41:20 +00:00
|
|
|
CaptCtxRef = ref object
|
|
|
|
db: CoreDbRef # not `nil`
|
2024-10-01 21:03:10 +00:00
|
|
|
root: common.Hash32
|
2024-08-01 10:41:20 +00:00
|
|
|
ctx: CoreDbCtxRef # not `nil`
|
|
|
|
cpt: CoreDbCaptRef # not `nil`
|
|
|
|
restore: CoreDbCtxRef # `nil` unless `ctx` activated
|
2024-03-22 17:31:56 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
const
|
|
|
|
senderName = "sender"
|
|
|
|
recipientName = "recipient"
|
|
|
|
minerName = "miner"
|
|
|
|
uncleName = "uncle"
|
|
|
|
internalTxName = "internalTx"
|
2024-03-21 10:45:57 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
proc dumpMemoryDB*(node: JsonNode, cpt: CoreDbCaptRef) {.gcsafe.}
|
|
|
|
proc toJson*(receipts: seq[Receipt]): JsonNode {.gcsafe.}
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Private helpers
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
proc init(
|
|
|
|
T: type CaptCtxRef;
|
|
|
|
com: CommonRef;
|
2024-10-01 21:03:10 +00:00
|
|
|
root: common.Hash32;
|
2024-09-10 05:24:45 +00:00
|
|
|
): T =
|
2024-08-01 10:41:20 +00:00
|
|
|
let ctx = block:
|
2024-12-18 10:56:46 +00:00
|
|
|
when false:
|
|
|
|
let rc = com.db.ctx.newCtxByKey(root)
|
|
|
|
if rc.isErr:
|
|
|
|
raiseAssert "newCptCtx: " & $$rc.error
|
|
|
|
rc.value
|
|
|
|
else:
|
|
|
|
{.warning: "TODO make a temporary context? newCtxByKey has been obsoleted".}
|
|
|
|
com.db.ctx
|
2024-08-01 10:41:20 +00:00
|
|
|
T(db: com.db, root: root, cpt: com.db.pushCapture(), ctx: ctx)
|
|
|
|
|
|
|
|
proc init(
|
|
|
|
T: type CaptCtxRef;
|
|
|
|
com: CommonRef;
|
2024-10-01 21:03:10 +00:00
|
|
|
topHeader: Header;
|
2024-11-07 01:24:21 +00:00
|
|
|
): T =
|
|
|
|
let header = com.db.getBlockHeader(topHeader.parentHash).expect("top header parent exists")
|
|
|
|
T.init(com, header.stateRoot)
|
2024-08-01 10:41:20 +00:00
|
|
|
|
|
|
|
proc activate(cc: CaptCtxRef): CaptCtxRef {.discardable.} =
|
|
|
|
## Install/activate new context `cc.ctx`, old one in `cc.restore`
|
|
|
|
doAssert not cc.isNil
|
|
|
|
doAssert cc.restore.isNil # otherwise activated, already
|
2024-12-18 10:56:46 +00:00
|
|
|
if true:
|
|
|
|
raiseAssert "TODO activte context"
|
|
|
|
# cc.restore = cc.ctx.swapCtx cc.db
|
2024-08-01 10:41:20 +00:00
|
|
|
cc
|
|
|
|
|
|
|
|
proc release(cc: CaptCtxRef) =
|
2024-12-18 10:56:46 +00:00
|
|
|
# if not cc.restore.isNil: # switch to original context (if any)
|
|
|
|
# let ctx = cc.restore.swapCtx(cc.db)
|
|
|
|
# doAssert ctx == cc.ctx
|
|
|
|
if true:
|
|
|
|
raiseAssert "TODO release context"
|
|
|
|
# cc.ctx.forget() # dispose
|
2024-08-01 10:41:20 +00:00
|
|
|
cc.cpt.pop() # discard top layer of actions tracer
|
|
|
|
|
|
|
|
# -------------------
|
2024-03-21 10:45:57 +00:00
|
|
|
|
2024-09-29 12:37:09 +00:00
|
|
|
proc `%`(x: addresses.Address|Bytes32|Bytes256|Hash32): JsonNode =
|
|
|
|
result = %toHex(x)
|
2018-12-25 10:31:51 +00:00
|
|
|
|
|
|
|
proc toJson(receipt: Receipt): JsonNode =
|
|
|
|
result = newJObject()
|
|
|
|
|
|
|
|
result["cumulativeGasUsed"] = %receipt.cumulativeGasUsed
|
2024-06-14 07:31:08 +00:00
|
|
|
result["bloom"] = %receipt.logsBloom
|
2018-12-25 10:31:51 +00:00
|
|
|
result["logs"] = %receipt.logs
|
|
|
|
|
|
|
|
if receipt.hasStateRoot:
|
2024-09-29 12:37:09 +00:00
|
|
|
result["root"] = %(receipt.stateRoot.toHex)
|
2018-12-25 10:31:51 +00:00
|
|
|
else:
|
|
|
|
result["status"] = %receipt.status
|
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
proc dumpReceiptsImpl(
|
|
|
|
chainDB: CoreDbRef;
|
2024-10-01 21:03:10 +00:00
|
|
|
header: Header;
|
2024-11-07 01:24:21 +00:00
|
|
|
): JsonNode =
|
2018-12-25 10:31:51 +00:00
|
|
|
result = newJArray()
|
2024-11-07 01:24:21 +00:00
|
|
|
let receiptList = chainDB.getReceipts(header.receiptsRoot).
|
|
|
|
expect("receipts exists")
|
|
|
|
for receipt in receiptList:
|
2018-12-25 10:31:51 +00:00
|
|
|
result.add receipt.toJson
|
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Private functions
|
|
|
|
# ------------------------------------------------------------------------------
|
2018-12-03 10:54:19 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
proc captureAccount(
|
|
|
|
n: JsonNode;
|
|
|
|
db: LedgerRef;
|
2024-10-16 06:51:38 +00:00
|
|
|
address: Address;
|
2024-08-01 10:41:20 +00:00
|
|
|
name: string;
|
|
|
|
) =
|
2018-12-12 03:40:37 +00:00
|
|
|
var jaccount = newJObject()
|
|
|
|
jaccount["name"] = %name
|
2024-09-29 12:37:09 +00:00
|
|
|
jaccount["address"] = %(address.to0xHex)
|
2020-06-01 06:45:32 +00:00
|
|
|
|
|
|
|
let nonce = db.getNonce(address)
|
|
|
|
let balance = db.getBalance(address)
|
|
|
|
let codeHash = db.getCodeHash(address)
|
|
|
|
let storageRoot = db.getStorageRoot(address)
|
|
|
|
|
2024-01-13 01:41:57 +00:00
|
|
|
jaccount["nonce"] = %(conversions.`$`(nonce.Web3Quantity))
|
2020-06-01 06:45:32 +00:00
|
|
|
jaccount["balance"] = %("0x" & balance.toHex)
|
2018-12-11 09:53:05 +00:00
|
|
|
|
|
|
|
let code = db.getCode(address)
|
2024-09-29 12:37:09 +00:00
|
|
|
jaccount["codeHash"] = %(codeHash.to0xHex)
|
2024-08-01 10:41:20 +00:00
|
|
|
jaccount["code"] = %("0x" & code.bytes.toHex(true))
|
2024-09-29 12:37:09 +00:00
|
|
|
jaccount["storageRoot"] = %(storageRoot.to0xHex)
|
2018-12-11 09:53:05 +00:00
|
|
|
|
|
|
|
var storage = newJObject()
|
|
|
|
for key, value in db.storage(address):
|
2019-01-11 06:53:18 +00:00
|
|
|
storage["0x" & key.dumpHex] = %("0x" & value.dumpHex)
|
2018-12-12 03:40:37 +00:00
|
|
|
jaccount["storage"] = storage
|
2018-12-11 09:53:05 +00:00
|
|
|
|
2018-12-12 03:40:37 +00:00
|
|
|
n.add jaccount
|
2018-12-11 09:53:05 +00:00
|
|
|
|
2018-12-12 15:18:46 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
proc traceTransactionImpl(
|
|
|
|
com: CommonRef;
|
2024-10-01 21:03:10 +00:00
|
|
|
header: Header;
|
2024-08-01 10:41:20 +00:00
|
|
|
transactions: openArray[Transaction];
|
|
|
|
txIndex: uint64;
|
|
|
|
tracerFlags: set[TracerFlags] = {};
|
2024-11-07 01:24:21 +00:00
|
|
|
): JsonNode =
|
2024-08-01 10:41:20 +00:00
|
|
|
if header.txRoot == EMPTY_ROOT_HASH:
|
|
|
|
return newJNull()
|
2024-03-07 19:24:05 +00:00
|
|
|
|
2018-12-03 16:22:08 +00:00
|
|
|
let
|
2023-08-02 10:17:40 +00:00
|
|
|
tracerInst = newLegacyTracer(tracerFlags)
|
2024-08-01 10:41:20 +00:00
|
|
|
cc = activate CaptCtxRef.init(com, header)
|
2024-08-16 06:22:51 +00:00
|
|
|
vmState = BaseVMState.new(header, com, storeSlotHash = true).valueOr: return newJNull()
|
2024-03-22 17:31:56 +00:00
|
|
|
stateDb = vmState.stateDB
|
2024-06-07 08:24:32 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
defer: cc.release()
|
2018-12-26 03:34:16 +00:00
|
|
|
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
doAssert(transactions.calcTxRoot == header.txRoot)
|
|
|
|
doAssert(transactions.len != 0)
|
2018-12-03 10:54:19 +00:00
|
|
|
|
2018-12-11 09:53:05 +00:00
|
|
|
var
|
|
|
|
gasUsed: GasInt
|
2018-12-12 09:41:18 +00:00
|
|
|
before = newJArray()
|
|
|
|
after = newJArray()
|
2018-12-11 09:53:05 +00:00
|
|
|
stateDiff = %{"before": before, "after": after}
|
2024-08-01 10:41:20 +00:00
|
|
|
stateCtx = CaptCtxRef(nil)
|
2018-12-11 09:53:05 +00:00
|
|
|
|
2020-06-22 00:48:23 +00:00
|
|
|
let
|
|
|
|
miner = vmState.coinbase()
|
2019-04-23 12:50:45 +00:00
|
|
|
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
for idx, tx in transactions:
|
2024-10-04 14:34:31 +00:00
|
|
|
let sender = tx.recoverSender().expect("valid signature")
|
2021-05-04 06:27:18 +00:00
|
|
|
let recipient = tx.getRecipient(sender)
|
2018-12-11 09:53:05 +00:00
|
|
|
|
2024-06-14 07:31:08 +00:00
|
|
|
if idx.uint64 == txIndex:
|
2023-08-02 10:17:40 +00:00
|
|
|
vmState.tracer = tracerInst # only enable tracer on target tx
|
2018-12-12 03:40:37 +00:00
|
|
|
before.captureAccount(stateDb, sender, senderName)
|
|
|
|
before.captureAccount(stateDb, recipient, recipientName)
|
2020-06-22 00:48:23 +00:00
|
|
|
before.captureAccount(stateDb, miner, minerName)
|
2020-06-01 06:45:32 +00:00
|
|
|
stateDb.persist()
|
2024-10-27 18:56:28 +00:00
|
|
|
stateDiff["beforeRoot"] = %(stateDb.getStateRoot().toHex)
|
2024-11-22 13:15:35 +00:00
|
|
|
discard com.db.ctx.getAccounts.getStateRoot() # lazy hashing!
|
2024-10-27 18:56:28 +00:00
|
|
|
stateCtx = CaptCtxRef.init(com, stateDb.getStateRoot())
|
2018-12-11 09:53:05 +00:00
|
|
|
|
2022-01-10 09:04:06 +00:00
|
|
|
let rc = vmState.processTransaction(tx, sender, header)
|
2022-04-08 04:54:11 +00:00
|
|
|
gasUsed = if rc.isOk: rc.value else: 0
|
2018-12-12 03:40:37 +00:00
|
|
|
|
2024-06-14 07:31:08 +00:00
|
|
|
if idx.uint64 == txIndex:
|
2024-11-22 13:15:35 +00:00
|
|
|
discard com.db.ctx.getAccounts.getStateRoot() # lazy hashing!
|
2018-12-12 03:40:37 +00:00
|
|
|
after.captureAccount(stateDb, sender, senderName)
|
|
|
|
after.captureAccount(stateDb, recipient, recipientName)
|
2020-06-22 00:48:23 +00:00
|
|
|
after.captureAccount(stateDb, miner, minerName)
|
2023-08-02 10:17:40 +00:00
|
|
|
tracerInst.removeTracedAccounts(sender, recipient, miner)
|
2020-06-01 06:45:32 +00:00
|
|
|
stateDb.persist()
|
2024-10-27 18:56:28 +00:00
|
|
|
stateDiff["afterRoot"] = %(stateDb.getStateRoot().toHex)
|
2018-12-12 03:40:37 +00:00
|
|
|
break
|
2018-12-03 10:54:19 +00:00
|
|
|
|
2018-12-25 07:31:12 +00:00
|
|
|
# internal transactions:
|
2024-03-22 17:31:56 +00:00
|
|
|
let
|
2024-08-01 10:41:20 +00:00
|
|
|
cx = activate stateCtx
|
2024-10-27 18:56:28 +00:00
|
|
|
ldgBefore = LedgerRef.init(com.db, storeSlotHash = true)
|
2024-08-01 10:41:20 +00:00
|
|
|
defer: cx.release()
|
2024-03-22 17:31:56 +00:00
|
|
|
|
2023-08-02 10:17:40 +00:00
|
|
|
for idx, acc in tracedAccountsPairs(tracerInst):
|
2024-08-01 10:41:20 +00:00
|
|
|
before.captureAccount(ldgBefore, acc, internalTxName & $idx)
|
2018-12-25 07:31:12 +00:00
|
|
|
|
2023-08-02 10:17:40 +00:00
|
|
|
for idx, acc in tracedAccountsPairs(tracerInst):
|
2018-12-25 07:31:12 +00:00
|
|
|
after.captureAccount(stateDb, acc, internalTxName & $idx)
|
|
|
|
|
2023-08-02 10:17:40 +00:00
|
|
|
result = tracerInst.getTracingResult()
|
2018-12-03 16:22:08 +00:00
|
|
|
result["gas"] = %gasUsed
|
2018-12-25 10:31:51 +00:00
|
|
|
|
|
|
|
if TracerFlags.DisableStateDiff notin tracerFlags:
|
|
|
|
result["stateDiff"] = stateDiff
|
2018-12-03 16:22:08 +00:00
|
|
|
|
2018-12-04 01:53:21 +00:00
|
|
|
# now we dump captured state db
|
2018-12-04 02:01:56 +00:00
|
|
|
if TracerFlags.DisableState notin tracerFlags:
|
2024-08-01 10:41:20 +00:00
|
|
|
result.dumpMemoryDB(cx.cpt)
|
2018-12-11 10:05:49 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
|
|
|
|
proc dumpBlockStateImpl(
|
|
|
|
com: CommonRef;
|
|
|
|
blk: EthBlock;
|
|
|
|
dumpState = false;
|
2024-11-07 01:24:21 +00:00
|
|
|
): JsonNode =
|
2024-10-01 21:03:10 +00:00
|
|
|
template header: Header = blk.header
|
2024-08-01 10:41:20 +00:00
|
|
|
|
2018-12-12 03:40:37 +00:00
|
|
|
let
|
2024-08-01 10:41:20 +00:00
|
|
|
cc = activate CaptCtxRef.init(com, header)
|
|
|
|
|
|
|
|
# only need a stack dump when scanning for internal transaction address
|
2023-08-02 10:17:40 +00:00
|
|
|
captureFlags = {DisableMemory, DisableStorage, EnableAccount}
|
|
|
|
tracerInst = newLegacyTracer(captureFlags)
|
2024-08-16 06:22:51 +00:00
|
|
|
vmState = BaseVMState.new(header, com, tracerInst, storeSlotHash = true).valueOr:
|
2024-08-01 10:41:20 +00:00
|
|
|
return newJNull()
|
2020-06-22 00:48:23 +00:00
|
|
|
miner = vmState.coinbase()
|
2024-08-01 10:41:20 +00:00
|
|
|
|
|
|
|
defer: cc.release()
|
2018-12-12 03:40:37 +00:00
|
|
|
|
|
|
|
var
|
2018-12-12 09:41:18 +00:00
|
|
|
before = newJArray()
|
|
|
|
after = newJArray()
|
2024-10-27 18:56:28 +00:00
|
|
|
stateBefore = LedgerRef.init(com.db, storeSlotHash = true)
|
2018-12-12 03:40:37 +00:00
|
|
|
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
for idx, tx in blk.transactions:
|
2024-10-04 14:34:31 +00:00
|
|
|
let sender = tx.recoverSender().expect("valid signature")
|
2021-05-04 06:27:18 +00:00
|
|
|
let recipient = tx.getRecipient(sender)
|
2018-12-12 09:41:18 +00:00
|
|
|
before.captureAccount(stateBefore, sender, senderName & $idx)
|
|
|
|
before.captureAccount(stateBefore, recipient, recipientName & $idx)
|
2018-12-12 03:40:37 +00:00
|
|
|
|
2020-06-22 00:48:23 +00:00
|
|
|
before.captureAccount(stateBefore, miner, minerName)
|
2018-12-12 03:40:37 +00:00
|
|
|
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
for idx, uncle in blk.uncles:
|
2018-12-12 03:40:37 +00:00
|
|
|
before.captureAccount(stateBefore, uncle.coinbase, uncleName & $idx)
|
|
|
|
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
discard vmState.processBlock(blk)
|
2018-12-12 03:40:37 +00:00
|
|
|
|
2021-10-28 09:42:39 +00:00
|
|
|
var stateAfter = vmState.stateDB
|
2019-02-02 09:20:45 +00:00
|
|
|
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
for idx, tx in blk.transactions:
|
2024-10-04 14:34:31 +00:00
|
|
|
let sender = tx.recoverSender().expect("valid signature")
|
2021-05-04 06:27:18 +00:00
|
|
|
let recipient = tx.getRecipient(sender)
|
2018-12-12 09:41:18 +00:00
|
|
|
after.captureAccount(stateAfter, sender, senderName & $idx)
|
|
|
|
after.captureAccount(stateAfter, recipient, recipientName & $idx)
|
2023-08-02 10:17:40 +00:00
|
|
|
tracerInst.removeTracedAccounts(sender, recipient)
|
2018-12-12 03:40:37 +00:00
|
|
|
|
2020-06-22 00:48:23 +00:00
|
|
|
after.captureAccount(stateAfter, miner, minerName)
|
2023-08-02 10:17:40 +00:00
|
|
|
tracerInst.removeTracedAccounts(miner)
|
2018-12-12 03:40:37 +00:00
|
|
|
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
for idx, uncle in blk.uncles:
|
2018-12-12 03:40:37 +00:00
|
|
|
after.captureAccount(stateAfter, uncle.coinbase, uncleName & $idx)
|
2023-08-02 10:17:40 +00:00
|
|
|
tracerInst.removeTracedAccounts(uncle.coinbase)
|
2018-12-12 03:40:37 +00:00
|
|
|
|
2018-12-25 07:31:12 +00:00
|
|
|
# internal transactions:
|
2023-08-02 10:17:40 +00:00
|
|
|
for idx, acc in tracedAccountsPairs(tracerInst):
|
2018-12-25 07:31:12 +00:00
|
|
|
before.captureAccount(stateBefore, acc, internalTxName & $idx)
|
|
|
|
|
2023-08-02 10:17:40 +00:00
|
|
|
for idx, acc in tracedAccountsPairs(tracerInst):
|
2018-12-25 07:31:12 +00:00
|
|
|
after.captureAccount(stateAfter, acc, internalTxName & $idx)
|
|
|
|
|
2018-12-12 03:40:37 +00:00
|
|
|
result = %{"before": before, "after": after}
|
2018-12-12 04:16:40 +00:00
|
|
|
|
2018-12-12 15:18:46 +00:00
|
|
|
if dumpState:
|
2024-08-01 10:41:20 +00:00
|
|
|
result.dumpMemoryDB(cc.cpt)
|
|
|
|
|
2018-12-12 15:18:46 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
proc traceBlockImpl(
|
|
|
|
com: CommonRef;
|
|
|
|
blk: EthBlock;
|
|
|
|
tracerFlags: set[TracerFlags] = {};
|
2024-11-07 01:24:21 +00:00
|
|
|
): JsonNode =
|
2024-10-01 21:03:10 +00:00
|
|
|
template header: Header = blk.header
|
2024-08-01 10:41:20 +00:00
|
|
|
|
2018-12-12 04:16:40 +00:00
|
|
|
let
|
2024-08-01 10:41:20 +00:00
|
|
|
cc = activate CaptCtxRef.init(com, header)
|
2023-08-02 10:17:40 +00:00
|
|
|
tracerInst = newLegacyTracer(tracerFlags)
|
2024-08-16 06:22:51 +00:00
|
|
|
# Tracer needs a database where the reverse slot hash table has been set up
|
|
|
|
vmState = BaseVMState.new(header, com, tracerInst, storeSlotHash = true).valueOr:
|
2024-08-01 10:41:20 +00:00
|
|
|
return newJNull()
|
2024-03-22 17:31:56 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
defer: cc.release()
|
2018-12-12 04:16:40 +00:00
|
|
|
|
2022-09-03 18:15:35 +00:00
|
|
|
if header.txRoot == EMPTY_ROOT_HASH: return newJNull()
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
doAssert(blk.transactions.calcTxRoot == header.txRoot)
|
|
|
|
doAssert(blk.transactions.len != 0)
|
2018-12-12 04:16:40 +00:00
|
|
|
|
|
|
|
var gasUsed = GasInt(0)
|
|
|
|
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
for tx in blk.transactions:
|
2022-01-10 09:04:06 +00:00
|
|
|
let
|
2024-10-04 14:34:31 +00:00
|
|
|
sender = tx.recoverSender().expect("valid signature")
|
2022-01-10 09:04:06 +00:00
|
|
|
rc = vmState.processTransaction(tx, sender, header)
|
2022-04-08 04:54:11 +00:00
|
|
|
if rc.isOk:
|
2022-01-10 09:04:06 +00:00
|
|
|
gasUsed = gasUsed + rc.value
|
2018-12-12 04:16:40 +00:00
|
|
|
|
2023-08-02 10:17:40 +00:00
|
|
|
result = tracerInst.getTracingResult()
|
2018-12-12 04:31:53 +00:00
|
|
|
result["gas"] = %gasUsed
|
|
|
|
|
2018-12-12 15:18:46 +00:00
|
|
|
if TracerFlags.DisableState notin tracerFlags:
|
2024-08-01 10:41:20 +00:00
|
|
|
result.dumpMemoryDB(cc.cpt)
|
|
|
|
|
|
|
|
proc traceTransactionsImpl(
|
|
|
|
com: CommonRef;
|
2024-10-01 21:03:10 +00:00
|
|
|
header: Header;
|
2024-08-01 10:41:20 +00:00
|
|
|
transactions: openArray[Transaction];
|
2024-11-07 01:24:21 +00:00
|
|
|
): JsonNode =
|
2018-12-25 10:31:51 +00:00
|
|
|
result = newJArray()
|
Consolidate block type for block processing (#2325)
This PR consolidates the split header-body sequences into a single EthBlock
sequence and cleans up the fallout from that which significantly reduces
block processing overhead during import thanks to less garbage collection
and fewer copies of things all around.
Notably, since the number of headers must always match the number of bodies,
we also get rid of a pointless degree of freedom that in the future could
introduce unnecessary bugs.
* only read header and body from era file
* avoid several unnecessary copies along the block processing way
* simplify signatures, cleaning up unused arguemnts and returns
* use `stew/assign2` in a few strategic places where the generated
nim assignent is slow and add a few `move` to work around poor
analysis in nim 1.6 (will need to be revisited for 2.0)
```
stats-20240607_2223-a814aa0b.csv vs stats-20240608_0714-21c1d0a9.csv
bps_x bps_y tps_x tps_y bpsd tpsd timed
block_number
(498305, 713245] 1,540.52 1,809.73 2,361.58 2775.340189 17.63% 17.63% -14.92%
(713245, 928185] 730.36 865.26 1,715.90 2028.973852 18.01% 18.01% -15.21%
(928185, 1143126] 663.03 789.10 2,529.26 3032.490771 19.79% 19.79% -16.28%
(1143126, 1358066] 393.46 508.05 2,152.50 2777.578119 29.13% 29.13% -22.50%
(1358066, 1573007] 370.88 440.72 2,351.31 2791.896052 18.81% 18.81% -15.80%
(1573007, 1787947] 283.65 335.11 2,068.93 2441.373402 17.60% 17.60% -14.91%
(1787947, 2002888] 287.29 342.11 2,078.39 2474.179448 18.99% 18.99% -15.91%
(2002888, 2217828] 293.38 343.16 2,208.83 2584.77457 17.16% 17.16% -14.61%
(2217828, 2432769] 140.09 167.86 1,081.87 1296.336926 18.82% 18.82% -15.80%
blocks: 1934464, baseline: 3h13m1s, contender: 2h43m47s
bpsd (mean): 19.55%
tpsd (mean): 19.55%
Time (total): -29m13s, -15.14%
```
2024-06-09 14:32:20 +00:00
|
|
|
for i in 0 ..< transactions.len:
|
2024-08-01 10:41:20 +00:00
|
|
|
result.add traceTransactionImpl(
|
|
|
|
com, header, transactions, i.uint64, {DisableState})
|
2018-12-25 10:31:51 +00:00
|
|
|
|
2024-08-01 10:41:20 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Public functions
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
proc traceBlock*(
|
|
|
|
com: CommonRef;
|
|
|
|
blk: EthBlock;
|
|
|
|
tracerFlags: set[TracerFlags] = {};
|
|
|
|
): JsonNode =
|
2024-11-07 01:24:21 +00:00
|
|
|
com.traceBlockImpl(blk, tracerFlags)
|
2024-08-01 10:41:20 +00:00
|
|
|
|
|
|
|
proc toJson*(receipts: seq[Receipt]): JsonNode =
|
|
|
|
result = newJArray()
|
|
|
|
for receipt in receipts:
|
|
|
|
result.add receipt.toJson
|
|
|
|
|
|
|
|
proc dumpMemoryDB*(node: JsonNode, cpt: CoreDbCaptRef) =
|
|
|
|
var n = newJObject()
|
|
|
|
for (k,v) in cpt.kvtLog:
|
|
|
|
n[k.toHex(false)] = %v
|
|
|
|
node["state"] = n
|
|
|
|
|
2024-10-01 21:03:10 +00:00
|
|
|
proc dumpReceipts*(chainDB: CoreDbRef, header: Header): JsonNode =
|
2024-11-07 01:24:21 +00:00
|
|
|
chainDB.dumpReceiptsImpl header
|
2024-08-01 10:41:20 +00:00
|
|
|
|
|
|
|
proc traceTransaction*(
|
|
|
|
com: CommonRef;
|
2024-10-01 21:03:10 +00:00
|
|
|
header: Header;
|
2024-08-01 10:41:20 +00:00
|
|
|
txs: openArray[Transaction];
|
|
|
|
txIndex: uint64;
|
|
|
|
tracerFlags: set[TracerFlags] = {};
|
|
|
|
): JsonNode =
|
2024-11-07 01:24:21 +00:00
|
|
|
com.traceTransactionImpl(header, txs, txIndex,tracerFlags)
|
2024-08-01 10:41:20 +00:00
|
|
|
|
|
|
|
proc dumpBlockState*(
|
|
|
|
com: CommonRef;
|
|
|
|
blk: EthBlock;
|
|
|
|
dumpState = false;
|
|
|
|
): JsonNode =
|
2024-11-07 01:24:21 +00:00
|
|
|
com.dumpBlockStateImpl(blk, dumpState)
|
2024-08-01 10:41:20 +00:00
|
|
|
|
|
|
|
proc traceTransactions*(
|
|
|
|
com: CommonRef;
|
2024-10-01 21:03:10 +00:00
|
|
|
header: Header;
|
2024-08-01 10:41:20 +00:00
|
|
|
transactions: openArray[Transaction];
|
|
|
|
): JsonNode =
|
2024-11-07 01:24:21 +00:00
|
|
|
com.traceTransactionsImpl(header, transactions)
|
2024-08-01 10:41:20 +00:00
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# End
|
|
|
|
# ------------------------------------------------------------------------------
|