go-ethereum/eth
Delweng 78b6059341
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Docker Image (push) Waiting to run
eth: quick canceling block inserting when debug_setHead is invoked (#32067)
If Geth is engaged in a long-run block synchronization, such as a full
syncing over a large number of blocks, invoking `debug_setHead` will
cause `downloader.Cancel` to wait for all fetchers to stop first.
This can be time-consuming, particularly for the block processing
thread.

To address this, we manually call `blockchain.StopInsert` to interrupt
the blocking processing thread and allow it to exit immediately, and
after that call `blockchain.ResumeInsert` to resume the block
downloading process.

Additionally, we add a sanity check for the input block number of
`debug_setHead` to ensure its validity.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-06-23 14:04:21 +08:00
..
catalyst eth/catalyst: fetch header on forkchoiceUpdated (#31928) 2025-06-18 15:06:49 +08:00
downloader eth: quick canceling block inserting when debug_setHead is invoked (#32067) 2025-06-23 14:04:21 +08:00
ethconfig core/rawdb: integrate eradb backend for RPC (#31604) 2025-06-03 10:47:38 +02:00
fetcher eth/fetcher: define BatchSize as a constant (#31742) 2025-04-30 11:02:11 +08:00
filters core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
gasestimator core, eth/gasestimator: introduce MaxGasUsed for estimation (#31735) 2025-05-02 17:43:06 +02:00
gasprice core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
protocols core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
tracers core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go eth: return null for not-found in BlockByNumberOrHash (#31949) 2025-06-02 16:11:19 +02:00
api_backend_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
api_debug.go eth: use headers in debug.GetModifiedAccountsBy* (#31765) 2025-05-16 19:35:17 +02:00
api_debug_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
api_miner.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
backend.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
dropper.go eth: add logic to drop peers randomly when saturated (#31476) 2025-04-14 12:45:27 +02:00
handler.go eth/protocols/eth: implement eth/69 (#29158) 2025-05-16 17:10:47 +02:00
handler_eth.go eth: check blob transaction validity on the peer goroutine when received (#31219) 2025-03-01 14:10:38 +01:00
handler_eth_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
handler_snap.go eth: check snap satelliteness, delegate drop to eth (#22235) 2021-02-02 10:44:36 +02:00
handler_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
peer.go eth/protocols/eth: implement eth/69 (#29158) 2025-05-16 17:10:47 +02:00
peerset.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
state_accessor.go eth: fix returned blockContext for empty blocks in stateAtTransaction (#31768) 2025-05-13 15:28:16 +02:00
sync.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
sync_test.go eth/protocols/eth: prevent hanging dispatch (#30918) 2025-01-06 16:31:53 +01:00