Commit graph

2385 commits

Author SHA1 Message Date
이호재
f1df7a0e26
eth: return error instead of panicking on debug_executionWitness (#35544)
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-08-17 14:22:20 +08:00
Bosul Mun
aa1f2fcf51
eth/fetcher: validate announced blob tx size against announcer's protocol version (#35524)
eth/72 announces blob transactions without the blob payload while eth/71
includes it, so the same transaction is announced with different
sizes. Compare each announcement against the size expected for that
peer's version instead of a single size so that honest peers on either version
are no longer dropped on delivery.
2026-08-13 17:42:52 +02:00
Jochem Brouwer
393555b097
eth: don't read a blob pool that is still initialising (#35509)
Some checks are pending
/ 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
/ Linux Build (push) Waiting to run
`BlobPool.Init` builds the lookup, index and store without holding
`p.lock`, and `eth/backend.go` publishes the pool to `blobpool.NewCache`
before `txpool.New` runs Init. Cache.update spawns a goroutine calling
`getByVhash`, so it can read the pool mid-construction:

```
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x28]
    blobpool.(*BlobPool).getByVhash(...)  blobpool.go:1303
    blobpool.(*Cache).update.func1()      cache.go:429
```

`Init` fills the lookup inside `billy.Open`, whose index callback runs
`parseTransaction` -> `trackTransaction`, and assigns `p.store` only
once `billy.Open` returns. For that window a lookup hit names a
transaction whose store does not exist yet, and `p.store.Get`
dereferences nil.

Build the cache after `txpool.New` so no reader exists while `Init` runs
-- `getByVhash` has exactly one caller -- and have `getByVhash` read the
store under the same lock as the lookup, returning nil when it is not
set.

A benchmark harness that restarts the client once per test hit this on
1-4% of starts; a node that starts once rarely will.
2026-08-13 13:26:11 +02:00
rjl493456442
35fe1bf69c
core/state: unset the block-level accessList in Finalise (#35498)
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 explicitly clears the referenced block access list at the end of
each transaction. This is essential because accounts are shadow-copied
into the global block access list, and it prevents accidental mutations
through stale references in StateDB.
2026-08-13 10:56:10 +08:00
SillyZir
4307ee86f8
eth/syncer: only synthesize finalized/safe markers with an explicit sync target (#35433)
Fixes #35418.

After a restart, the syncer sets the finalized marker to head−64 and the
safe marker to head−32 on every downloader sync event, ignoring epoch
boundaries. Since this service is registered unconditionally and
`api_backend` serves `CurrentFinalBlock()` verbatim,
`eth_getBlockByNumber("finalized")` can return a mid-epoch block that
was never finalized and can still be reorged.

The synthesized markers exist to make `finalized`/`safe` usable when no
consensus client is attached. This change scopes them to exactly that
case: they are only set when an explicit sync target has been specified
(`--synctarget`), which is the only mode where no CL supplies real
checkpoints. Normal nodes now never override consensus-client
checkpoints.

`TestSyncerDoesNotInventFinalityMarkers` syncs a node to head with no CL
finality input and asserts the chain's finalized/safe markers stay
unset; it fails on master (finalized invented at head−64) and passes
with this change.

---------

Co-authored-by: SillyZir <269283839+SillyZir@users.noreply.github.com>
Co-authored-by: Jonny Rhea <5555162+jrhea@users.noreply.github.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-08-12 10:57:13 -05:00
rjl493456442
ee0607cdcc
cmd, core, eth, internal: deprecate state sizer (#35520)
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
StateSize is a development tool for calculating and tracking the size of
the state. It was requested by ethPandaOps a while ago, but it has since
been superseded by another approach that captures state changes via a
live tracer. Therefore, this tool can be retired to reduce maintenance
overhead.
2026-08-12 19:36:55 +08:00
0xSHKWON
ceced06cb0
eth/downloader: don't signal sync startup before fetchers register for cancellation (#35515)
Close the started signal only after the fetchers are registered on
cancelWg, so suspend's Cancel actually waits for them instead of racing
the registration.
2026-08-12 15:31:51 +08:00
Jochem Brouwer
8f1a3fee9f
eth/catalyst: make headBlock reorging to finalized possible (#35519)
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-08-12 13:22:38 +08:00
Chase Wright
87ab9435f5
eth/catalyst: pass targetGasLimit through in testing_buildBlockV1 (#35501)
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
`testing_buildBlockV1` decodes `targetGasLimit` from the payload
attributes but does not pass it to `miner.BuildPayloadArgs`. The miner
then falls back to its configured gas ceiling, so the field is silently
ignored. The engine API path (`forkchoiceUpdated`) already passes it
through.

This matters for fixture generation in ethereum/execution-apis, where
`testing_buildBlockV1` builds Amsterdam test blocks and the gas limit
must honor the CL-provided target (see ethereum/execution-apis#857 and
ethereum/execution-apis#862).

The new test builds an Amsterdam block with a target inside the
per-block adjustment bound and checks the payload hits it exactly.
2026-08-11 20:28:01 +08:00
rjl493456442
c3185d9030
core/rawdb: retain BAL in bad blocks (#35423)
This PR introduces the functionalities to persist the local-built bad
blocks alongside additional execution details.
2026-08-11 19:58:26 +08:00
rjl493456442
42c5059b58
eth/protocols/snap: add tests and comments (#35477)
This PR updates some descriptions of snap sync v2, attaching two unit
tests.
2026-08-11 15:15:31 +08:00
0xSHKWON
b3e26093ec
eth/downloader: don't log stale access list reservations as errors (#35493)
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
Since #35386 blocks are delivered without waiting for their access list,
a reserved BAL task can outlive its block and hit the stale branch of
`reserveHeaders`, which logs at error level — demote that case to debug.

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2026-08-10 13:11:14 +08:00
daixiheguu
7e520c4310
eth/protocols/snap: advance catch-up pivot after batch commit (#35463)
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-08-08 16:24:04 +08:00
rjl493456442
2a439ba452
eth/downloader: implement BAL downloading (#35386)
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
This PR implements the BAL downloader. Once the Amsterdam fork is
enabled, BALs are scheduled for download for BAL-eligible blocks.

Unlike mandatory components such as block bodies, BALs are optional and
are downloaded on a best-effort basis. If a block's essential components
are ready for delivery before its BAL has been retrieved, the block will
be delivered without the BAL.
2026-08-06 14:36:01 +02:00
cui
b14428613b
eth/catalyst: use IsAmsterdam when sealing simulated beacon blocks (#35392)
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-08-06 16:20:18 +08:00
0xSHKWON
9b702a9955
eth/downloader: hold pivotLock when reading pivot header in progress report (#35462) 2026-08-05 14:02:01 +08:00
rjl493456442
6434bc91d4
core, eth: rename regular gas to execution gas (#35457)
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2026-08-04 14:35:06 +08:00
Jonny Rhea
b483fe9e71
eth/syncer: fix nil deref when the target block is missing (#35442)
i didn't try to trigger the nil deref, but fixing it shouldn't be
controversial
2026-08-04 14:16:45 +08:00
Jonny Rhea
b988c00bf4
eth/protocols/snap: purge stale sync state when snap sync v2 is re-enabled (#35316)
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
If snap sync v2 is re-enabled after a previous sync already completed
and committed its pivot, the leftover journal is now discarded instead
of resumed.
2026-07-29 10:59:18 +08:00
Bosul Mun
38271784c2
eth/protocols: fix Cells/GetCells RLP encoding (#35428)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run
This PR aligns the `Cells` and `GetCells` message implementations with
the spec: https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getcells-0x14

Previously, `GetCellsPacket` and `CellsPacket` embedded `GetCellsRequest` 
and `CellsResponse`. This caused them to be encoded as nested lists, which
does not match the wire format defined by the spec. This PR inlines their fields
to flatten the RLP layout of `Cells` and `GetCells`.
2026-07-28 13:13:32 +08:00
Jonny Rhea
d6f222a081
core, core/vm: precompile result caching (#35388)
Blocks heavy in precompile calls (e.g. Aztec's proof settlement txs)
spend most of their processing time on operations (ECMUL, pairings, KZG
point evaluation, MODEXP) that the state prefetcher has already computed
and thrown away.

This PR adds a precompile result cache shared between the prefetcher and
block processing (and the miner), following the JumpDestCache pattern.
Note that cached precompiles are keyed by address and input, with
entries partitioned by the active precompile set, so a fork that changes
the behavior behind an address can never be served results from before
it.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-07-28 10:47:33 +08:00
cui
cd65ccad96
eth/downloader: hold pivotLock when marking pivot committed (#35405)
commitPivotBlock updated committed without pivotLock, while other pivot
transitions serialize through that lock. Take the lock around the store
to keep pivot commitment consistent with pivotHeader updates.
2026-07-24 16:19:35 +08:00
Jonny Rhea
ff44a796a1
core: coordinate the state prefetcher with block processing (#35404)
This PR coordinates the prefetcher with the main tx executor. Block
processing publishes the index of the transaction it is executing,
prefetch workers skip anything already reached and transactions above 1M
gas are promoted to the front of the prefetch queue while the rest keeps
block order.
2026-07-24 15:43:46 +08:00
cui
b2ee83931b
eth/catalyst: allow reorg depth equal to maxReorgDepth (#35391)
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 deep-reorg check used depth >= maxReorgDepth, rejecting reorgs at
exactly the configured limit. Use > so a depth equal to maxReorgDepth is
still accepted.
2026-07-23 22:49:48 +08:00
cui
e317407d16
eth/fetcher: clear partial map when dropping last waitlist peer (#35399)
Some checks are pending
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Docker Image (push) Waiting to run
When a peer drop removes the last waiter for a hash, waitlist and
waittime were cleaned up but partial could retain a stale entry. Delete
it too so the hash is fully forgotten.
2026-07-23 10:22:47 +02:00
rjl493456442
81ab8b594e
eth/downloader: disable snap mode after committing pivot block (#35402)
This PR improves the sync mode management, disabling the snap mode once 
the pivot block is committed. 

Originally the mode will only be flipped from snap to full once the entire sync 
cycle is completed. However, it's theoretically possible to cancel the sync cycle
after committing the pivot but before inserting the remaining blocks. It drags
the following sync cycle back to the snap mode.

The snap mode should only be used if the head state is missing and unrecoverable. 
Enabling the snap mode for multiple times should be strictly prevented.

What's more, it brings a fix to pivot block management, that once the
pivot block is committed, the pivot block marker should be no longer advanced,
preventing the situation that the real pivot state is below the pivot marker.
2026-07-23 14:30:20 +08:00
cui
a9ca080d7f
eth/fetcher: count unique hashes in blob queueing metric (#35393)
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
blobFetcherQueueingHashes used len(announces), which is the number of
peers with pending announces, not the number of queued hashes. Count
unique hashes across peers instead.

---------

Co-authored-by: Bosul Mun <bsbs8645@snu.ac.kr>
2026-07-22 13:20:43 +02:00
0xoasis
a38a90bc60
eth/protocols/eth: track announced tx hashes only after send (#35384)
Commit 1f87331fb moved the known-transaction marking in
`sendPooledTransactionHashes` to after a successful send, so hashes are
not marked known to the peer if the announcement fails to go out.

The sparse blobpool change (d91b71fb3) reintroduced the original
track-before-send ordering when adding the eth/72 packet variant,
causing failed announcements to suppress future re-announcements of the
same hashes to that peer.

This restores the send-first ordering for both eth/71 and eth/72 packet
versions, and adds a regression test covering success and failure paths
on both protocol versions.

## Checklist

- [x] Restored mark-known-after-send for ETH71 and ETH72
- [x] Added `TestSendPooledTransactionHashes` covering success and
closed-pipe failure

---------

Co-authored-by: Bosul Mun <bsbs8645@snu.ac.kr>
2026-07-20 15:40:04 +02:00
Marius van der Wijden
4363b81e6f
eth/catalyst: pass TargetGasLimit via engine api (#35372)
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
Pass targetGasLimit via engine api

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-07-20 15:08:23 +08:00
0xoasis
4911ab04fc
cmd/geth, eth/ethconfig: preserve zero engine reorg depth (#35373)
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-07-20 10:53:19 +08:00
Bosul Mun
d91b71fb36
core/txpool/blobpool, eth: implement sparse blobpool (#34047)
This is the implementation of EIP-8070 Sparse Blobpool. It introduces
protocol version eth/72 which relays blob transaction cells instead of
full blobs.

The blobpool now store 'incomplete' transactions, where only some of
the cells are provided. The stored cell indexes are taken from the
custody bitmap, which is provided by the consensus layer in
forkchoiceUpdatedV4. This method will be called once Glamsterdam
activates, and the default custody is full custody, so for now there
is no change in the amount of stored cells for now.

The main entities added are the BlobBuffer and BlobFetcher, which work
together to track and fetch missing cells from connected peers. The
partial transactions become available for inclusion in blocks when
they are covered by enough peers that hold all cells.

This change also introduces engine_getBlobsV4, which allows for
cell-based responses (and partial blobs with only some of the cells).
We maintain backward compatibility with getBlobsV3 which expects full
blob responses by recovering the blob from available cells. Since this
process is resource-intensive, we proactively cache the conversion so
it is ready in time for getBlobsV3 calls. This mechanism will be
removed once support for getBlobsV4 is universal across all consensus
layer implementations.

devp2p tests for eth/72 are not part of this initial change. This is
to avoid breaking test success status for execution clients that do
not have eth/72 implemented yet. The tests will be added in a
subsequent change.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2026-07-15 14:41:04 +02:00
Jonny Rhea
d5d936d76c
eth/catalyst: handle bogota fork in payloadVersion (#35355)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Docker Image (push) Waiting to run
#34057 added the Bogota fork, but didn't add it to payloadVersion.
This PR fixes the CI error.
2026-07-14 17:24:07 +02:00
cui
6e6fcef0ba
eth/protocols/eth: discard message before size check (#35289)
- Move `msg.Discard` defer ahead of the max message size check in
`handleMessage`.
- Ensures oversized messages are released when the handler returns
early.
2026-07-14 09:06:57 -05:00
lightclient
0d1cf34ec6
all: add bogota fork to config (#34057)
Adds stubs for Bogota fork.
2026-07-14 14:37:29 +02:00
danceratopz
abfb2de574
eth/catalyst, eth/ethconfig, cmd: make engine API max reorg depth configurable (#35335)
Some checks are pending
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
2026-07-14 15:48:30 +08:00
Marius van der Wijden
68f711b9de
beacon/engine: correct rlp encoding/decoding (#35348)
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
Correctly passes BAL around in engine api

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-07-13 15:31:10 +02:00
Marius van der Wijden
f9382c2d1b
eth/tracers/logger: respect logging limit (#35349)
Necessary for building fuzzers that don't take 10s of seconds for
tracing a test
2026-07-13 19:51:38 +08:00
Stefan
b34a925e9e
beacon/engine, eth/catalyst: return block access lists in payload bodies v2 (#35347) 2026-07-13 15:55:39 +08:00
Csaba Kiraly
111e7b8b48
eth: protect high-value peers from random dropping based on tx inclusion stats (#34702)
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 peer dropper periodically disconnects random peers to create churn.
This was previously blind to peer quality.
This PR adds peer-score based peer protection, handling the
multi-dimensionality problem of peer scoring through the concept of
protected peer pools.

---------

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Co-authored-by: healthykim <bsbs8645@snu.ac.kr>
2026-07-09 18:54:27 +02:00
cui
6c80ee6c50
eth/protocols/snap: fix access list sync progress double counting (#35323) 2026-07-09 10:52:28 +08:00
rjl493456442
76e3dc6b5b
core: improve chain reset head (#35252)
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 does a few things:

- reject `debug_setHead` if the target is even before the pivot block
(if non-nil)
- reject `debug_setHead` if in path mode, the target is not recoverable
- decouple the chain rewinding and state recovery in path mode and
recover the state in one shot

---------

Co-authored-by: jonny rhea <5555162+jrhea@users.noreply.github.com>
2026-07-08 16:44:34 -05:00
rjl493456442
0c88fee429
eth/downloader, eth/protocols/snap: snap v2 catchup failure (#35321)
Fixes https://github.com/ethereum/go-ethereum/issues/35319
2026-07-08 10:47:39 -05:00
rjl493456442
4d2181aa41
cmd, core, eth, miner: apply 7997 in block building (#35285)
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
This PR applies the 7997 irregular state transition in t8n, block
building, simulation and tracing.
2026-07-07 14:40:25 +02:00
cui
69d88aee93
eth/tracers: include log index in erc7562 tracer output (#35200)
Populate the Index field on captured logs, matching callTracer
behaviour.
2026-07-06 11:31:08 +02:00
rjl493456442
3006c4411b
eth/protocols/eth: fix blockAccessList empty marker (#35286)
This PR addresses an issue in the eth71 `BlockAccessListsMsg` handler,

specifically: 
- if the requested bal is not accessible in the server side, 0x80
(EmptyString) will be returned as the marker
- at the client side, old message definition
`rlp.RawList[RawBlockAccessList]` assumes all the elements are List
- the message with 0x80 (kind = string) won't be decoded correctly
- the peer will be disconnected

The message definition has been changed to `rlp.RawList[rlp.RawValue]`,
which is aligned with the one in SNAP/2 protocol.
2026-07-03 11:15:07 +02:00
Rafael Matias
7e625dd548
cmd: add amsterdam override flag (#35213)
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
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
2026-07-01 11:55:12 +02:00
Marius van der Wijden
0fbad29b94
params: remove named hardforks from bpo schedule (#35029) 2026-07-01 16:51:05 +08:00
cui
dd672c6867
eth: prealloc seen map in handleTransactions (#35237)
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-07-01 10:34:08 +08:00
rjl493456442
a63e2f1247
eth/downloader: fix test panic (#35215)
This PR addresses the panic in tests. As the eventLoop is spun up when
the downloader was closed, the sub will be nil and make the panic
happens.

```
  goroutine 421 [running]:
  github.com/ethereum/go-ethereum/eth/downloader.(*DownloaderAPI).eventLoop(0xcb0e4d0)
      /opt/actions-runner/_work/go-ethereum/go-ethereum/eth/downloader/api.go:91 +0x127
  created by github.com/ethereum/go-ethereum/eth/downloader.NewDownloaderAPI in goroutine 352
      /opt/actions-runner/_work/go-ethereum/go-ethereum/eth/downloader/api.go:50 +0xf2
```
2026-06-25 13:10:54 +02:00
rjl493456442
12241bde26
core: add debug log and repair the missing hash and receipts (#35190)
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
This PR improves the block download used by snap sync. Specifically,
blocks and their associated data (receipts and canonical hash mappings)
are now written directly to the database without checking existence.

The current implementation could fail in cases where the block header
and body were already present (has.Block returns true), but the
corresponding canonical hash mapping was missing. One possible scenario
is when a newPayload event is processed without a subsequent
forkChoiceUpdate.

It is still unclear why Geth may re-enter snap sync after Engine API
events have been processed after the sync. Anyway, bypassing the
existence is a reasonable change.

What's more, in the downloader, the presence of canonical hash is also
considered for deciding the range of blocks to be downloaded.
Specifically:

- in the full sync, the block with header and body available but
canonical hash missing will be re-inserted;
- in the snap sync, the block with header, body and receipt available
but canonical hash missing will be re-inserted;
2026-06-23 14:46:38 +08:00