Commit graph

14 commits

Author SHA1 Message Date
Jared Wasinger
b7118dccfe cleanup 2026-05-06 14:43:40 -04:00
Jared Wasinger
052a24c353 it builds 2026-05-06 12:32:45 -04:00
CPerezz
51fdf0e053
core: drop and tighten comments per PR feedback 2026-05-04 18:42:03 +02:00
CPerezz
aa13b208b1
core: deduplicate CodeLoaded/CodeLoadBytes for BAL blocks
The previous follow-up note: per-tx + pre-tx + post-tx StateDBs each
have their own stateObjects, so summing CodeLoaded/CodeLoadBytes
over-counts contracts whose code body was fetched by multiple phases.

Fix: snapshot per-StateDB the {address: codeLen} map of contracts whose
s.code is populated, plumb through the existing aggregation pipeline,
dedupe by address in resultHandler/prepareExecResult. The merged map's
size and value-sum become CodeLoaded and CodeLoadBytes respectively,
overriding the per-tx-summed values at the wiring site.

Empirical: a 3-tx block touching the same set of system contracts now
reports code=4, code_bytes=1098 (matches single-tx baseline) instead
of code=12, code_bytes=3294 under the prior over-count.
2026-05-01 10:40:40 +02:00
CPerezz
3d135baa36
core: clarify ProcessResultWithMetrics.Counts/Reads semantics 2026-05-01 02:08:12 +02:00
CPerezz
13733390da
core: extract state.ReadDurations triple
Replace the {Account, Storage, Code} time.Duration scalars threaded through
ProcessResultWithMetrics, txExecResult, processBlockPreTx and resultHandler
with a single ReadDurations struct + Add merge primitive. Same shape as
StateCounts. Adds (*StateDB).SnapshotReads() helper at the boundary.
2026-05-01 00:16:55 +02:00
CPerezz
1afcea992c
core/state: change StateCounts.Add to value receiver
The struct is 80 bytes (10 ints) — value semantics matches the type's
"snapshot, safe to pass by value" thesis stated in its doc comment, and
removes three unnecessary &-takings at call sites. No behavior change.
2026-04-30 14:03:23 +02:00
CPerezz
6730ab31e5
core: aggregate per-tx state-read durations through parallel pipeline 2026-04-30 14:03:22 +02:00
Jared Wasinger
6a79e3693b core: preface invalid bal errors so they are caught by the exception mapper 2026-04-05 18:14:18 -04:00
jwasinger
985cdac8a7
core: fix 8037 gas accounting (#34631)
To check whether a transaction can be applied, we validate that
`blockGasLimit > txGasLimit + (cumulativeRegularGasUsed +
cumulativeStateGasUsed)`. However, the check should only be applied to
the bottleneck resource, i.e. `blockGasLimit >
max(txRegularGasUsed+cumulativeRegularGasUsed, txStateGasUsed+
cumulativeStateGasUsed)`.

The changes here break multiple tests.  I am trying to determine why.

---------

Co-authored-by: qu0b <stefan@starflinger.eu>
2026-04-05 18:12:48 -04:00
Marius van der Wijden
8327e870e6 all: fix rebasing issues 2026-03-31 17:56:43 -04:00
Marius van der Wijden
18848bca26 all: fix rebasing issues 2026-03-31 17:56:41 -04:00
Marius van der Wijden
98f757bcc2 core: fix deadlock in parallel state processor 2026-03-31 17:53:30 -04:00
Jared Wasinger
265d74b75e all: implement eip 7928 block access lists 2026-03-31 17:49:49 -04:00