better logging for running client (#2781)
* better logging for running client * logs for persistance + more data * persistance logs fixed * blobgas * blobGas is Opt * suggestions added * fcU fixed
This commit is contained in:
parent
d828dead2d
commit
ba1cbed14f
|
@ -196,12 +196,22 @@ proc forkchoiceUpdated*(ben: BeaconEngineRef,
|
|||
bundle.blobsBundle,
|
||||
bundle.executionRequests)
|
||||
|
||||
info "Created payload for sealing",
|
||||
id = id.toHex,
|
||||
hash = bundle.executionPayload.blockHash.short,
|
||||
info "Created payload for block proposal",
|
||||
number = bundle.executionPayload.blockNumber,
|
||||
attr = attrs
|
||||
hash = bundle.executionPayload.blockHash.short,
|
||||
txs = bundle.executionPayload.transactions.len,
|
||||
gasUsed = bundle.executionPayload.gasUsed,
|
||||
blobGasUsed = bundle.executionPayload.blobGasUsed.get(Quantity(0)),
|
||||
id = id.toHex,
|
||||
attrs = attrs
|
||||
|
||||
return validFCU(Opt.some(id), blockHash)
|
||||
|
||||
info "Fork choice updated",
|
||||
requested = header.number,
|
||||
hash = blockHash.short,
|
||||
head = ben.chain.latestNumber,
|
||||
base = ben.chain.baseNumber,
|
||||
baseHash = ben.chain.baseHash.short
|
||||
|
||||
return validFCU(Opt.none(Bytes8), blockHash)
|
||||
|
|
|
@ -12,7 +12,7 @@ import
|
|||
../web3_eth_conv,
|
||||
eth/common/hashes,
|
||||
../beacon_engine,
|
||||
web3/execution_types,
|
||||
web3/[execution_types, primitives],
|
||||
../payload_conv,
|
||||
./api_utils,
|
||||
chronicles
|
||||
|
@ -196,4 +196,12 @@ proc newPayload*(ben: BeaconEngineRef,
|
|||
let blockHash = latestValidHash(db, parent, ttd)
|
||||
return invalidStatus(blockHash, vres.error())
|
||||
|
||||
info "New payload received and validated",
|
||||
number = header.number,
|
||||
hash = blockHash.short,
|
||||
parent = header.parentHash.short,
|
||||
txs = blk.transactions.len,
|
||||
gasUsed = header.gasUsed,
|
||||
blobGas = header.blobGasUsed.get(0'u64)
|
||||
|
||||
return validStatus(blockHash)
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
{.push raises: [].}
|
||||
|
||||
import
|
||||
chronicles,
|
||||
std/tables,
|
||||
../../common,
|
||||
../../db/core_db,
|
||||
|
@ -212,6 +213,7 @@ proc writeBaggage(c: ForkedChainRef, target: Hash32) =
|
|||
|
||||
shouldNotKeyError:
|
||||
var prevHash = target
|
||||
var count = 0'u64
|
||||
while prevHash != c.baseHash:
|
||||
let blk = c.blocks[prevHash]
|
||||
c.db.persistTransactions(header.number, header.txRoot, blk.blk.transactions)
|
||||
|
@ -224,6 +226,13 @@ proc writeBaggage(c: ForkedChainRef, target: Hash32) =
|
|||
for tx in blk.blk.transactions:
|
||||
c.txRecords.del(rlpHash(tx))
|
||||
prevHash = header.parentHash
|
||||
count.inc
|
||||
|
||||
notice "Finalized blocks persisted",
|
||||
numberOfBlocks = count,
|
||||
last = target.short,
|
||||
baseNumber = c.baseHeader.number,
|
||||
baseHash = c.baseHash.short
|
||||
|
||||
func updateBase(c: ForkedChainRef,
|
||||
newBaseHash: Hash32,
|
||||
|
@ -620,6 +629,9 @@ func latestHash*(c: ForkedChainRef): Hash32 =
|
|||
func baseNumber*(c: ForkedChainRef): BlockNumber =
|
||||
c.baseHeader.number
|
||||
|
||||
func baseHash*(c: ForkedChainRef): Hash32 =
|
||||
c.baseHash
|
||||
|
||||
func txRecords*(c: ForkedChainRef, txHash: Hash32): (Hash32, uint64) =
|
||||
c.txRecords.getOrDefault(txHash, (Hash32.default, 0'u64))
|
||||
|
||||
|
|
Loading…
Reference in New Issue