go-ethereum/core
CPerezz 3f5e27e7b0
core, core/state: instrument BAL slow-block metrics
Populates per-block state read/write counts in slow-block JSON for BAL
blocks (which #34892 left as TBD), and adds reader-level read timing.
Builds on top of bal-devnet-3 — most of the PR's earlier slow-block log
infrastructure was adapted into upstream by that commit, so this change
is now scoped to the metric population that the BAL alone can derive.

- BAL helpers: BlockAccessList.{UniqueAccountCount, UniqueStorageSlotCount,
  WrittenCounts}. WrittenCounts walks the BAL once and returns the
  block-aggregate write counts.

- Reader-level read timing: *reader times all synchronous Account/Storage/
  Code/CodeSize calls via atomic counters; exposed via ReadTimes()
  ReadDurations and the new state.ReadTimer interface. Replaces StateDB-
  level AccountReads/StorageReads/CodeReads tracking (the StateDB shouldn't
  time its dependencies — the reader is where the I/O happens).

- Reader-level code-load dedup: *reader.codeLoaded sync.Map records the
  first-seen byte length per address; CodeLoads() returns (count, bytes).
  Exposed via state.CodeLoadTracker. Replaces StateDB CodeLoaded/
  CodeLoadBytes tracking and the SnapshotCodeLoads aggregation pattern.

- BALStateTransition: caches BlockAccessList.WrittenCounts() once at
  construction; tracks accountDeleted/storageDeleted atomics for the
  parallel root-pass (the BAL alone can't distinguish a selfdestruct from
  a balance/nonce reset). Exposes Deletions() DeletionCounts. Drops the
  older accountUpdated/storageUpdated/codeUpdated/codeUpdateBytes counters
  (now derived from WrittenCounts).

- BAL block stats path (blockchain.go): populates StateCounts directly —
  AccountUpdated = WrittenCounts.Accounts - Deletions.Accounts (same for
  storage). AccountLoaded/StorageLoaded come from BAL. CodeLoaded/
  CodeLoadBytes come from the shared *reader (deduplicated across phase
  StateDBs naturally because they share one reader instance).

- Non-BAL block stats path: read durations come from the reader; counts
  from StateDB fields. StorageUpdated/StorageDeleted unified to int width.

- Hard type assertions: state.ReadTimer / state.CodeLoadTracker /
  state.ReaderStater consumers use direct casts (no silent zero
  fallback) — every Reader chain in production satisfies these
  interfaces.

- Meter alignment: account/storage Updated meters subtract Deletions to
  avoid double-reporting blocks under both Update and Delete dashboards.
2026-05-07 00:12:51 +02:00
..
filtermaps core/filtermaps: fix operator precedence in delete logging condition (#33280) 2025-12-06 04:21:38 +01:00
forkid params: set osaka and BPO1 & BPO2 mainnet dates (#33063) 2025-11-03 17:41:22 +01:00
history core/history: refactor pruning configuration (#34036) 2026-03-18 13:54:29 +01:00
overlay core/overlay: fix incorrect debug log key/value in LoadTransitionState (#32637) 2025-12-14 21:51:13 +01:00
rawdb all: fix rebasing issues 2026-03-31 17:56:41 -04:00
state core, core/state: instrument BAL slow-block metrics 2026-05-07 00:12:51 +02:00
stateless core, miner, trie: relocate witness stats (#34106) 2026-03-27 17:06:46 +01:00
tracing all: implement eip 7928 block access lists 2026-03-31 17:49:49 -04:00
txpool core: implement EIP-8037: state creation gas cost increase 2026-03-31 16:59:35 -04:00
types core, core/state: instrument BAL slow-block metrics 2026-05-07 00:12:51 +02:00
vm core/vm: fix two bugs 2026-04-09 15:05:13 +02:00
.gitignore Renamed chain => core 2014-12-04 10:28:02 +01:00
bench_test.go core: implement EIP-8037: state creation gas cost increase 2026-03-31 16:59:35 -04:00
bintrie_witness_test.go core: implement EIP-8037: state creation gas cost increase 2026-03-31 16:59:35 -04:00
block_validator.go core: perform BAL validation against gas limit for blocks which come with access lists 2026-04-05 15:33:42 -04:00
block_validator_test.go eth/catalyst: add initial OpenTelemetry tracing for newPayload (#33521) 2026-02-17 17:08:57 +01:00
blockchain.go core, core/state: instrument BAL slow-block metrics 2026-05-07 00:12:51 +02:00
blockchain_insert.go core: remove unused peek function in insertIterator (#33155) 2025-11-12 15:30:16 +08:00
blockchain_reader.go core, miner, tests: introduce codedb and simplify cachingDB (#33816) 2026-03-10 08:29:21 +01:00
blockchain_repair_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
blockchain_sethead_test.go core, miner, tests: introduce codedb and simplify cachingDB (#33816) 2026-03-10 08:29:21 +01:00
blockchain_snapshot_test.go triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
blockchain_stats.go core, core/state: instrument BAL slow-block metrics 2026-05-07 00:12:51 +02:00
blockchain_test.go fix some lint errors (TODO: merge this commit into the 7928 changes 2026-03-31 17:49:53 -04:00
chain_makers.go all: implement eip 7928 block access lists 2026-03-31 17:49:49 -04:00
chain_makers_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
dao_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
error.go core, internal/ethapi: fix incorrect max-initcode RPC error mapping (#34067) 2026-03-23 22:10:32 +08:00
eth_transfer_logs_test.go core, core/vm: implement EIP-7708 (#33645) 2026-03-23 22:29:53 +08:00
events.go ethstats: report newPayload processing time to stats server (#33395) 2026-01-05 17:49:30 +01:00
evm.go core: implement EIP-8037: state creation gas cost increase 2026-03-31 16:59:35 -04:00
gaspool.go core: fix tx-inclusion tests 2026-04-08 12:44:39 +02:00
gen_genesis.go all: implement eip 7928 block access lists 2026-03-31 17:49:49 -04:00
genesis.go all: implement eip 7928 block access lists 2026-03-31 17:49:49 -04:00
genesis_alloc.go params: add hoodi testnet definition (#31406) 2025-03-18 12:07:49 +01:00
genesis_test.go trie/bintrie: fix overflow management in slot key computation (#33951) 2026-03-05 14:43:31 +01:00
headerchain.go core/rawdb: reduce allocations in rawdb.ReadHeaderNumber (#31913) 2025-07-15 15:48:36 +02:00
headerchain_test.go core/state, core/tracing: new state update hook (#33490) 2026-01-08 11:07:19 +08:00
mkalloc.go accounts, cmd/geth, core: close opened files (#29598) 2024-04-30 15:47:21 +02:00
parallel_state_processor.go core, core/state: instrument BAL slow-block metrics 2026-05-07 00:12:51 +02:00
rlp_test.go crypto/keccak: vendor in golang.org/x/crypto/sha3 (#33323) 2026-02-03 14:55:27 -07:00
sender_cacher.go core: use sync.Once for SenderCacher initialization (#31029) 2025-01-16 14:36:45 +01:00
state_prefetcher.go core: implement eip-7778: block gas accounting without refunds (#33593) 2026-03-04 18:18:18 +08:00
state_processor.go core: fix rebasing issue 2026-04-08 16:19:24 +02:00
state_processor_test.go core: implement EIP-8037: state creation gas cost increase 2026-03-31 16:59:35 -04:00
state_transition.go core: fix 8037 transaction inclusion 2026-04-09 15:19:26 +02:00
stateless.go all: implement eip 7928 block access lists 2026-03-31 17:49:49 -04:00
txindexer.go core/rawdb: reduce allocations in rawdb.ReadHeaderNumber (#31913) 2025-07-15 15:48:36 +02:00
txindexer_test.go core/rawdb: integrate eradb backend for RPC (#31604) 2025-06-03 10:47:38 +02:00
types.go all: fix rebasing issues 2026-03-31 17:56:41 -04:00