Commit graph

146 commits

Author SHA1 Message Date
Marius van der Wijden
e40aa46e88
eth/catalyst: implement testing_buildBlockV1 (#33656)
implements
https://github.com/ethereum/execution-apis/pull/710/changes#r2712256529

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2026-02-23 15:56:31 +01:00
Jonny Rhea
c709c19b40
eth/catalyst: add initial OpenTelemetry tracing for newPayload (#33521)
This PR adds initial OpenTelemetry tracing to the Engine API, focusing
on engine_newPayload*.

```
jsonrpc.engine/newPayloadV4 
|  |- engine.newPayload  [block.number, block.hash, tx.count]
|     |- core.blockchain.InsertBlockWithoutSetHead
|        |- bc.processor.Process
|        |  |- core.ApplyTransactionWithEVM  [tx.hash, tx.index]
|        |  |- core.ApplyTransactionWithEVM  [tx.hash, tx.index]
|        |  |- ...  (one per transaction)
|        |  |- core.postExecution
|        |- bc.validator.ValidateState
```

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2026-02-17 17:08:57 +01:00
Andrew Davis
a8a4804895
ethstats: report newPayload processing time to stats server (#33395)
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
Add NewPayloadEvent to track engine API newPayload block processing
times and report them to ethstats. This enables monitoring of block
processing performance.

https://notes.ethereum.org/@savid/block-observability

related: https://github.com/ethereum/go-ethereum/pull/33231

---------

Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
2026-01-05 17:49:30 +01:00
Marco Munizaga
b2843a11d6
eth/catalyst: implement getBlobsV3 (#33404)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This is used by cell-level dissemination (aka partial messages) to give
the CL all blobs the EL knows about and let CL communicate efficiently
about any other missing blobs. In other words, partial responses from
the EL is useful now.

See the related (closed) PR:
https://github.com/ethereum/execution-apis/pull/674 and the new PR:
https://github.com/ethereum/execution-apis/pull/719
2025-12-31 09:48:50 +08:00
rjl493456442
bf141fbfb1
core, eth: add lock protection in snap sync (#33428)
Fixes #33396, #33397, #33398
2025-12-19 09:36:48 +01:00
Jeevan
dd7daace9d
eth/catalyst: return empty response for GetBlobsV2 before Osaka (#33444)
Fix #33420
2025-12-19 14:42:51 +08:00
rjl493456442
bd77b77ede
core/txpool/blobpool: remove legacy sidecar conversion (#33352)
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 removes the legacy sidecar conversion logic.

After the Osaka fork, the blobpool will accept only blob sidecar version
1.
Any remaining version 0 blob transactions, if they still exist, will no
longer
be eligible for inclusion.

Note that conversion at the RPC layer is still supported, and version 0
blob
transactions will be automatically converted to version 1 there.
2025-12-18 12:33:07 -07:00
Jonny Rhea
7aae33eacf
eth/catalyst: fix invalid timestamp log message (#33440)
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 a typo in the NewPayload invalid timestamp warning where the
parent timestamp was incorrectly logged as the block timestamp.
2025-12-17 16:24:10 -07:00
rjl493456442
228933a660
eth/downloader: keep current syncmode in downloader only (#33157)
This moves the tracking of the current syncmode into the downloader, fixing an
issue where the syncmode being requested through the engine API could go
out-of-sync with the actual mode being performed by downloader.

Fixes #32629

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-12-08 22:49:57 +01:00
Felix Lange
fbbaa3c849
eth/catalyst: fix tests for getPayload change (#33322)
Fixes a test/lint regression introduced by #32754
2025-11-28 15:06:11 +01:00
lightclient
28376aea78
eth/catalyst: check fork timestamps during engine_getPayload (#32754)
This adds checks into getPayload to ensure the correct version is called
for the fork which applies to the payload.

---------

Co-authored-by: jsvisa <delweng@gmail.com>
2025-11-28 14:02:24 +01:00
georgehao
b5c3b32eeb
eth/catalyst: remove the outdated comments of ForkchoiceUpdatedV1 (#33251) 2025-11-24 22:02:13 +08:00
Csaba Kiraly
00f6f2b32f
eth/catalyst: remove useless log on enabling Engine API (#32901) 2025-10-14 11:01:43 +08:00
Delweng
265db06242
eth/catalyst: check osaka in engine_getBlobsV1 (#32731)
ref
https://github.com/ethereum/execution-apis/blob/main/src/engine/osaka.md#cancun-api

> Client software MUST return -38005: Unsupported fork error if the
Osaka fork has been activated.

---------

Signed-off-by: Delweng <delweng@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-29 11:56:39 +02:00
Csaba Kiraly
1601f398d4
core/txpool/blobpool: remove conversion in GetBlobs (#32578)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This disables blob proof conversion in `GetBlobs` by default, making it
conditional.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-09-19 16:21:15 +02:00
rjl493456442
2a82964727
eth/catalyst, beacon/engine: enable BPO and Osaka on stateless APIs (#32636)
Addresses https://github.com/ethereum/go-ethereum/issues/32630

This pull request enables the stateless engine APIs for Osaka and the
following BPOs. Apart from that, a few more descriptions have been added
in the engine APIs, making it easier to follow the spec change.
2025-09-19 00:16:01 +02:00
Felix Lange
6924eeaee0
eth/catalyst: allow fcuV3 for BPO forks (#32615)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
This fixes an issue with the engine API after BPO forks have passed.
2025-09-15 16:26:09 +02:00
lightclient
8a19582c8d
eth/catalyst: enable newpayloadV4 on BPOs (#32589)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Fixes an issue I accidentally introduced in #32579. Essentially, because
we gate the engine methods based on particular forks and I did not add
the BPOs as allowed forks to the method.
2025-09-11 22:09:56 +02:00
Csaba Kiraly
70f177a527
core/txpool/blobpool: fix getblobs error handling (#32538)
Another getBlobs PR on top of
https://github.com/ethereum/go-ethereum/pull/32190 to avoid some minor
regressions.

- bring back more log messages from before
- continue processing also on some internal errors
- ensure v2 complies with spec even if there are internal errors

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-04 09:42:03 +02:00
rjl493456442
00516c71fb
core/txpool/blobpool, eth/catalyst: place null for missing blob (#32536)
This pull request fixes a regression, introduced in #32190

Specifically, in GetBlobsV1 engine API, if any blob is missing, the null
should be placed in
response, unfortunately a behavioral change was introduced in #32190,
returning an error
instead.

What's more, a more comprehensive test suite is added to cover both
`GetBlobsV1` and
`GetBlobsV2` endpoints.
2025-09-03 09:44:00 +02:00
maskpp
7d4852b9eb
eth/catalyst: return methods by reflect (#32300)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
Return the exposed methods in `ConsensusAPI` by reflection.
2025-08-19 06:54:19 -06:00
maskpp
e9dca3b181
eth/catalyst: avoid load the same blob tx multi times (#32190)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
- If all the `vhashes` are in the same `sidecar`, then it will load the
same blob tx many times. This PR aims to upgrade this.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-08-05 13:07:45 +08:00
rjl493456442
0dacfef8ac
all: define constructor for BlobSidecar (#32213)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
The main purpose of this change is to enforce the version setting when
constructing the blobSidecar, avoiding creating sidecar with wrong/default 
version tag.
2025-07-17 11:19:20 +08:00
maskpp
fe0ae06c77
core/types: fix CellProofsAt method (#32198) 2025-07-15 09:07:23 +08:00
nthumann
2055196cea
eth/catalyst: fix the log message in newPayloadV4 (#32125)
It should be `newPayloadV4 must only be called for prague payloads` for
the V4 payload error
2025-07-01 15:04:05 +08:00
Marius van der Wijden
4ea9eea75f
eth/catalyst: fetch header on forkchoiceUpdated (#31928)
closes https://github.com/ethereum/go-ethereum/issues/31254

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-06-18 15:06:49 +08:00
Marius van der Wijden
c7e6c08e54
eth/catalyst: implement getBlobsV2 (#31791)
Implements `engine_getBlobsV2` which is needed for PeerDAS.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-06-09 11:34:24 +02:00
Marius van der Wijden
23f07d8c93
eth/catalyst: use atomics instead of locks (#31955)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run
2025-06-04 12:18:20 +08:00
William Morriss
ef464179a1
eth/catalyst: change warning to error for 'too many bad block attempts' (#31940)
This situation was failing quietly for me recently when I had a partial
data corruption issue. Changing the log level to Error would increase
visibility for me.
2025-06-03 14:36:00 +02:00
Marius van der Wijden
a4959685a2
eth/catalyst: move witness methods from engine api (#31867)
No functional changes, just moves the witness methods into its own file
2025-05-21 11:53:29 +02:00
Marius van der Wijden
16b0d9e982
eth/catalyst: refactor engine api checks (#31182)
This PR contains three refactors:
- refactor the latest fork check that we use quite extensively 
- refactor the nil checks in NewPayloads

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-05-14 08:50:02 -06:00
rjl493456442
0ac4a84a1f
beacon/engine: omit empty witness in payload response (#31739)
Fixes https://github.com/ethereum/go-ethereum/issues/31737
2025-04-29 13:21:18 +02:00
Sina M
fc12dbe40b
eth/catalyst: fix validation of type 0 request (#31103)
I caught this error on Hive. It was introduced by
https://github.com/ethereum/go-ethereum/pull/31071 because after adding
the equality check the request type 0 will be rejected.
2025-01-31 18:34:22 +01:00
Péter Szilágyi
39638c81c5
all: nuke total difficulty (#30744)
The total difficulty is the sum of all block difficulties from genesis
to a certain block. This value was used in PoW for deciding which chain
is heavier, and thus which chain to select. Since PoS has a different
fork selection algorithm, all blocks since the merge have a difficulty
of 0, and all total difficulties are the same for the past 2 years.

Whilst the TDs are mostly useless nowadays, there was never really a
reason to mess around removing them since they are so tiny. This
reasoning changes when we go down the path of pruned chain history. In
order to reconstruct any TD, we **must** retrieve all the headers from
chain head to genesis and then iterate all the difficulties to compute
the TD.

In a world where we completely prune past chain segments (bodies,
receipts, headers), it is not possible to reconstruct the TD at all. In
a world where we still keep chain headers and prune only the rest,
reconstructing it possible as long as we process (or download) the chain
forward from genesis, but trying to snap sync the head first and
backfill later hits the same issue, the TD becomes impossible to
calculate until genesis is backfilled.

All in all, the TD is a messy out-of-state, out-of-consensus computed
field that is overall useless nowadays, but code relying on it forces
the client into certain modes of operation and prevents other modes or
other optimizations. This PR completely nukes out the TD from the node.
It doesn't compute it, it doesn't operate on it, it's as if it didn't
even exist.

Caveats:

- Whenever we have APIs that return TD (devp2p handshake, tracer, etc.)
we return a TD of 0.
- For era files, we recompute the TD during export time (fairly quick)
to retain the format content.
- It is not possible to "verify" the merge point (i.e. with TD gone, TTD
is useless). Since we're not verifying PoW any more, just blindly trust
it, not verifying but blindly trusting the many year old merge point
seems just the same trust model.
- Our tests still need to be able to generate pre and post merge blocks,
so they need a new way to split the merge without TTD. The PR introduces
a settable ttdBlock field on the consensus object which is used by tests
as the block where originally the TTD happened. This is not needed for
live nodes, we never want to generate old blocks.
- One merge transition consensus test was disabled. With a
non-operational TD, testing how the client reacts to TTD is useless, it
cannot react.

Questions:

- Should we also drop total terminal difficulty from the genesis json?
It's a number we cannot react on any more, so maybe it would be cleaner
to get rid of even more concepts.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-01-28 18:55:41 +01:00
Sina M
33756802f6
eth/catalyst: fail on duplicate request types (#31071)
Refer to: https://github.com/ethereum/execution-apis/pull/623
2025-01-23 20:38:09 +01:00
Sina M
9b68875d68
beacon/engine: check for empty requests (#31010)
According to
https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#engine_newpayloadv4:

> Elements of the list MUST be ordered by request_type in ascending
order. Elements with empty request_data MUST be excluded from the list.

---------

Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2025-01-15 11:45:20 -07:00
Felix Lange
4afab7ef76
eth/downloader: move SyncMode to package eth/ethconfig (#30847)
Lots of packages depend on eth/downloader just for the SyncMode type.
Since we have a dedicated package for eth protocol configuration, it
makes more sense to define SyncMode there, turning eth/downloader into
more of a leaf package.
2024-12-03 09:30:26 +01:00
lightclient
5347280319
cmd/evm: improve block/state test runner (#30633)
* unify `staterunner` and `blockrunner` CLI flags, especially around
tracing
* added support for struct logger or json logging (although having issue
#30658)
* new --cross-check flag to validate the stateless witness collection
  / execution matches stateful
* adds support for tracing the stateless execution when a tracer is set
  (to more easily debug differences)
* --human for more readable test summary
* directory or file input, so if you pass tests/spec-tests/fixtures/blockchain_tests it will execute all
blockchain tests
2024-12-02 15:18:02 +01:00
Péter Szilágyi
dac54e31a7
build, internal, version: break ci.go/version->common dependency (#30638)
This PR tries to break the ci.go to common dependency by moving the
version number out of params.
2024-10-20 19:28:39 +03:00
Péter Szilágyi
afea3bd49c
beacon/engine, core/txpool, eth/catalyst: add engine_getBlobsV1 API (#30537) 2024-10-17 19:27:35 +03:00
lightclient
e26468f6f6
beacon/engine,eth/catalyst: hex marshal requests in engine api (#30603)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-10-17 10:05:17 +02:00
Felix Lange
2936b41514
all: implement flat deposit requests encoding (#30425)
This implements recent changes to EIP-7685, EIP-6110, and
execution-apis.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: Shude Li <islishude@gmail.com>
2024-10-09 12:24:58 +02:00
Péter Szilágyi
9326a118c7
beacon, core, eth, miner: integrate witnesses into production Geth (#30069)
This PR integrates witness-enabled block production, witness-creating
payload execution and stateless cross-validation into the `engine` API.
The purpose of the PR is to enable the following use-cases (for API
details, please see next section):

- Cross validating locally created blocks:
- Call `forkchoiceUpdatedWithWitness` instead of `forkchoiceUpdated` to
trigger witness creation too.
- Call `getPayload` as before to retrieve the new block and also the
above created witness.
- Call `executeStatelessPayload` against another client to
cross-validate the block.

- Cross validating locally processed blocks:
- Call `newPayloadWithWitness` instead of `newPayload` to trigger
witness creation too.
- Call `executeStatelessPayload` against another client to
cross-validate the block.

- Block production for stateless clients (local or MEV builders):
- Call `forkchoiceUpdatedWithWitness` instead of `forkchoiceUpdated` to
trigger witness creation too.
- Call `getPayload` as before to retrieve the new block and also the
above created witness.
- Propagate witnesses across the consensus libp2p network for stateless
Ethereum.

- Stateless validator validation:
- Call `executeStatelessPayload` with the propagated witness to
statelessly validate the block.

*Note, the various `WithWitness` methods could also *just be* an
additional boolean flag on the base methods, but this PR wanted to keep
the methods separate until a final consensus is reached on how to
integrate in production.*

---

The following `engine` API types are introduced:

```go
// StatelessPayloadStatusV1 is the result of a stateless payload execution.
type StatelessPayloadStatusV1 struct {
	Status          string      `json:"status"`
	StateRoot       common.Hash `json:"stateRoot"`
	ReceiptsRoot    common.Hash `json:"receiptsRoot"`
	ValidationError *string     `json:"validationError"`
}
```

- Add `forkchoiceUpdatedWithWitnessV1,2,3` with same params and returns
as `forkchoiceUpdatedV1,2,3`, but triggering a stateless witness
building if block production is requested.
- Extend `getPayloadV2,3` to return `executionPayloadEnvelope` with an
additional `witness` field of type `bytes` iff created via
`forkchoiceUpdatedWithWitnessV2,3`.
- Add `newPayloadWithWitnessV1,2,3,4` with same params and returns as
`newPayloadV1,2,3,4`, but triggering a stateless witness creation during
payload execution to allow cross validating it.
- Extend `payloadStatusV1` with a `witness` field of type `bytes` if
returned by `newPayloadWithWitnessV1,2,3,4`.
- Add `executeStatelessPayloadV1,2,3,4` with same base params as
`newPayloadV1,2,3,4` and one more additional param (`witness`) of type
`bytes`. The method returns `statelessPayloadStatusV1`, which mirrors
`payloadStatusV1` but replaces `latestValidHash` with `stateRoot` and
`receiptRoot`.
2024-09-20 16:43:42 +03:00
lightclient
c70b0a9138
beacon/engine/types: remove PayloadV4 (#30415)
h/t @MariusVanDerWijden for finding and fixing this on devnet 3.

I made the mistake of thinking `PayloadVersion` was correlated with the
`GetPayloadVX` method, but it actually tracks which version of
`PayloadAttributes` were passed to `forkchoiceUpdated`. So far, Prague
does not necessitate a new version of fcu, so there is no need for
`PayloadV4`.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2024-09-10 21:52:20 +03:00
lightclient
dfd33c7792
all: implement EIP-6110, execution layer triggered deposits (#29431)
This PR implements EIP-6110: Supply validator deposits on chain. It also sketches
out the base for Prague in the engine API types.
2024-09-04 14:33:51 +02:00
lightclient
84565dc899
eth/catalyst: ensure period zero mode leaves no pending txs in pool (#30264)
closes #29475, replaces #29657, #30104 

Fixes two issues. First is a deadlock where the txpool attempts to reorg, but can't complete because there are no readers left for the new txs subscription. Second, resolves a problem with on demand mode where txs may be left pending when there are more pending txs than block space.

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-08-19 15:32:15 -06:00
Delweng
10586952df
eth/catalyst: get params.ExcessBlobGas but check with params.BlobGasUsed (#30267)
Seems it is checked with the wrong argument

Signed-off-by: jsvisa <delweng@gmail.com>
2024-08-05 11:14:22 -06:00
Aayush Rajasekaran
37590b2c55
eth/catalyst: fix params in failure log (#30131) 2024-07-09 15:19:55 +03:00
ids
81349ff6e5
eth/catalyst: fix typo (#29580) 2024-04-19 09:58:14 +02:00
law wang
fadd9d8b81
eth/catalyst: fix log (#29549)
log:output the correct variable

Co-authored-by: steven <steven@stevendeMacBook-Pro.local>
2024-04-16 11:21:20 +02:00