Commit graph

3081 commits

Author SHA1 Message Date
Jared Wasinger
956f55fe83 improve bal validation to catch duplicate indices 2026-02-19 23:23:04 -05:00
Jared Wasinger
57c631e2a8 * factor bal size when enforcing block size limit while adding txs to payload in miner
* add support for three access list execution mode presets exposed via the --bal.executionmode flag:
- sequential: no performance acceleration
- full: parallel transaction execution, state root calculation, async warming of access list reads
- nobatchio: same as 'full', but without async warming of access list reads

* fix the way metrics are reported when executing access-list-containing blocks to be in-line with how it's done for other blocks.

* fix blockchain tests runner
2026-02-11 16:55:16 -05:00
MariusVanDerWijden
7ddef250f7 core: finally fix miner? 2026-02-05 16:46:44 +01:00
MariusVanDerWijden
8182ab0b06 core: clean up parallal state processor 2026-02-05 14:59:06 +01:00
MariusVanDerWijden
1d942bddf3 core: clean up parallal state processor 2026-02-05 14:55:54 +01:00
MariusVanDerWijden
97d384f1bb core: fix rebasing errors 2026-02-05 14:25:43 +01:00
MariusVanDerWijden
1509dd2d8c core: fix rebasing errors 2026-02-05 14:06:44 +01:00
MariusVanDerWijden
b236537fc4 core: implement eip-7778: block gas accounting without refunds 2026-02-05 14:02:16 +01:00
Jared Wasinger
d87d3195d9 attempt fix decoding bal 2026-02-05 13:59:41 +01:00
Jared Wasinger
2266891ece persist access list correctly 2026-02-05 13:59:41 +01:00
Jared Wasinger
669b26b280 simplify blockchain logic 2026-02-03 11:07:04 -05:00
Jared Wasinger
e68fb247b0 add new test network 'BPO2ToAmsterdamAtTime15k'. correct invocation of selfdestruct hook for tracers 2026-02-03 11:07:04 -05:00
Jared Wasinger
3e07bb4598 remove static guard from callcode 2026-02-03 11:07:04 -05:00
Jared Wasinger
012efa11ab eip-7708 fix: don't emit log when calling to self 2026-02-03 11:07:04 -05:00
felix
bca5642f56 core: fix initialization of parallelProcessor (#33723)
while trying to re-run 7843 tests again i saw geth panic (no clean hive
errors btw) and this fixes it. i think `parallelProcessor` field in
`BlockChain` was never initialized, so if u get a block with bal u run
`processBlockWithAccessList()` which then calls
`bc.parallelProcessor.Process(...)` which eventually calls
`p.chainConfig()` which then tries `p.chain.Config()` but `p.chain` is
still `nil`, ripbozo. i applied this fix and now geth again passes all
7843 tests. you also pass 179/184 tests of eip-8024, but those 5 failing
could be on our side and have nothing to do with this pr
2026-02-03 11:07:04 -05:00
Jared Wasinger
80af906c67 activate 8024 instructions in amsterdam. fix block tests 2026-02-03 11:07:04 -05:00
Jared Wasinger
33c864e227 fixes 2026-02-03 11:07:04 -05:00
Jared Wasinger
5a88101fa8 followup to last commit 2026-02-03 11:07:04 -05:00
Jared Wasinger
3435849244 a bunch of changes. mostly bal persistence and removing bal from block body object. wip... 2026-02-03 11:07:03 -05:00
Zsolt Felfoldi
7036b1cb39 core, params: add comments, move consts to params 2026-02-03 11:05:24 -05:00
Zsolt Felfoldi
593a6a77da core: emit logs for balance after selfdestruct 2026-02-03 11:05:24 -05:00
zsfelfoldi
6e3c6162b4 core: update according to latest specs 2026-02-03 11:05:24 -05:00
Zsolt Felfoldi
5ebefb21bf core: add test for ETH transfer logs 2026-02-03 11:05:24 -05:00
Zsolt Felfoldi
50b7009201 core, core/vm: implement EIP-7708 2026-02-03 11:05:24 -05:00
felix
d2dbbe48c4 core/vm: add amsterdam instruction set etc. (#33643)
had to make these changes to successfully test eip-7843 via `consume
engine`. could be useful to u.
edit: maybe the type change from `uint64` can be removed, i can fix that
on our end
2026-02-03 11:05:24 -05:00
MariusVanDerWijden
d322e378be harmonize spelling 2026-02-03 11:05:24 -05:00
MariusVanDerWijden
4a2a3d0e1f core/vm: implement eip-7843 2026-02-03 11:05:23 -05:00
MariusVanDerWijden
f7ce5467e3 core/vm: implement eip-7843 2026-02-03 10:49:46 -05:00
Jared Wasinger
4c36eaf532 all: all block access list changes up through devnet 1 including perf changes 2026-01-27 13:48:18 -05:00
rjl493456442
c2595381bf
core: extend the code reader statistics (#33659)
Some checks are pending
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
This PR extends the statistics of contract code read by adding these
fields:

- **CacheHitBytes**: the total number of bytes served by cache
- **CacheMissBytes**: the total number of bytes read on cache miss
- **CodeReadBytes**: the total number of bytes for contract code read
2026-01-26 11:25:53 +01:00
Csaba Kiraly
9a8e14e77e
core/txpool/legacypool: fix stale counter (#33653)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
Calling `pool.priced.Removed` is needed to keep is sync with
`pool.all.Remove`.
It was called in other occurances, but not here.

The counter is used for internal heap management. It was working even without this, just not calling reheap at the intended frequency.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2026-01-23 13:35:14 +01:00
Jonny Rhea
251b863107
core/vm: update EIP-8024 - Missing immediate byte is now treated as 0x00 (#33614)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This PR updates the EIP-8024 implementation to match the latest spec
clarification.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2026-01-22 12:16:02 -07:00
rjl493456442
1022c7637d
core, eth, internal, triedb/pathdb: enable eth_getProofs for history (#32727)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This PR enables the `eth_getProofs ` endpoint against the historical states.
2026-01-22 09:19:27 +08:00
Csaba Kiraly
35922bcd33
core/txpool/legacypool: reset gauges on clear (#33654)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-01-21 16:00:57 +08:00
DeFi Junkie
8fad02ac63
core/types: fix panic on invalid signature length (#33647)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Replace panic with error return in decodeSignature to prevent crashes on
invalid inputs, and update callers to propagate the error.
2026-01-21 06:57:02 +01:00
Csaba Kiraly
54ab4e3c7d
core/txpool/legacypool: add metric for accounts in txpool (#33646)
This PR adds metrics that count the number of accounts having transactions 
in the txpool. Together with the transaction count this can be used as a 
simple indicator of the diversity of transactions in the pool.

Note: as an alternative implementation, we could use a periodic or event
driven update of these Gauges using len.

I've preferred this implementation to match what we have for the pool
sizes.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2026-01-21 09:23:03 +08:00
forkfury
2eb1ccc6c4
core/state: ensure deterministic hook emission order in Finalise (#33644)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Fixes #33630

Sort self-destructed addresses before emitting hooks in Finalise() to
ensure deterministic ordering and fix flaky test
TestHooks_OnCodeChangeV2.

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
2026-01-20 20:36:07 +08:00
rjl493456442
500931bc82
core/vm: add read only protection for opcodes (#33637)
This PR reverts a part of changes brought by https://github.com/ethereum/go-ethereum/pull/33281/changes

Specifically, read-only protection should always be enforced at the opcode level, 
regardless of whether the check has already been performed during gas metering.

It should act as a gatekeeper, otherwise, it is easy to introduce errors by adding
new gas measurement logic without consistently applying the read-only protection.
2026-01-19 20:43:14 +08:00
rjl493456442
add1890a57
triedb/pathdb: enable trienode history (#32621)
It's the part-4 for trienode history. The trienode history persistence
has been enabled with this PR by flag `history.trienode <non-negative-number>`
2026-01-17 21:23:48 +08:00
jwasinger
715bf8e81e
core: invoke selfdestruct tracer hooks during finalisation (#32919)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
The core part of this PR that we need to adopt is to move the code and
nonce change hook invocations to occur at tx finalization, instead of
when the selfdestruct opcode is called.

Additionally:
* remove `SelfDestruct6780` now that it is essentially the same as
`SelfDestruct` just gated by `is new contract`
* don't duplicate `BalanceIncreaseSelfdestruct` (transfer to recipient
of selfdestruct) in the hooked statedb and in the opcode handler for the
selfdestruct opcode.
* balance is burned immediately when the beneficiary of the selfdestruct
is the sender, and the contract was created in the same transaction.
Previously we emit two balance increases to the recipient (see above
point), and a balance decrease from the sender.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
2026-01-16 15:10:08 -07:00
jwasinger
b6fb79cdf9
core/vm: in selfdestruct gas calculation, return early if there isn't enough gas to cover cold account access costs (#33450)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
There's no need to perform the subsequent state access on the target if
we already know that we are out of gas.

This aligns the state access behavior of selfdestruct with EIP-7928
2026-01-16 07:37:12 -07:00
jwasinger
23c3498836
core/vm: check if read-only in gas handlers (#33281)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This PR causes execution to terminate at the gas handler in the case of
sstore/call if they are invoked in a static execution context.

This aligns the behavior with EIP 7928 by ensuring that we don't record
any state reads in the access list from an SSTORE/CALL in this
circumstance.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2026-01-15 15:55:43 -07:00
MariusVanDerWijden
5b99d2bba4 core/txpool: drop peers on invalid KZG proofs
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>:
2026-01-13 17:12:08 +01:00
Jonny Rhea
c890637af9
core/rawdb: skip missing block bodies during tx unindexing (#33573)
This PR fixes an issue where the tx indexer would repeatedly try to
“unindex” a block with a missing body, causing a spike in CPU usage.
This change skips these blocks and advances the index tail. The fix was
verified both manually on a local development chain and with a new test.

resolves #33371
2026-01-12 14:25:22 +08:00
Csaba Kiraly
127d1f42bb
core: remove duplicate chainHeadFeed.Send code (#33563)
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
The code was simply duplicate, so we can remove some code lines here.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
2026-01-09 14:40:40 +01:00
Csaba Kiraly
b993cb6f38
core/txpool/blobpool: allow gaps in blobpool (#32717)
Allow the blobpool to accept blobs out of nonce order

Previously, we were dropping blobs that arrived out-of-order. However,
since fetch decisions are done on receiver side,
out-of-order delivery can happen, leading to inefficiencies.

This PR:
- adds an in-memory blob tx storage, similar to the queue in the
legacypool
- a limited number of received txs can be added to this per account
- txs waiting in the gapped queue are not processed further and not
propagated further until they are unblocked by adding the previos nonce
to the blobpool

The size of the in-memory storage is currently limited per account,
following a slow-start logic.
An overall size limit, and a TTL is also enforced for DoS protection.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
2026-01-09 10:43:15 +01:00
rjl493456442
9623dcbca2
core/state: add cache statistics of contract code reader (#33532) 2026-01-08 11:48:45 +08:00
Ng Wei Han
01b39c96bf
core/state, core/tracing: new state update hook (#33490)
### Description
Add a new `OnStateUpdate` hook which gets invoked after state is
committed.

### Rationale
For our particular use case, we need to obtain the state size metrics at
every single block when fuly syncing from genesis. With the current
state sizer, whenever the node is stopped, the background process must
be freshly initialized. During this re-initialization, it can skip some
blocks while the node continues executing blocks, causing gaps in the
recorded metrics.

Using this state update hook allows us to customize our own data
persistence logic, and we would never skip blocks upon node restart.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-01-08 11:07:19 +08:00
cui
957a3602d9
core/vm: avoid escape to heap (#33537)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2026-01-07 10:02:27 +08:00
rjl493456442
eaaa5b716d
core: re-organize the stats category (#33525)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Check out https://hackmd.io/dg7rizTyTXuCf2LSa2LsyQ for more details
2026-01-06 15:09:15 +08:00