go-ethereum/internal/ethapi
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
..
override internal/ethapi: support for beacon root and withdrawals in simulate api (#31304) 2025-03-24 19:08:53 +01:00
testdata eth/filters: add timestamp to derived logs (#31887) 2025-06-10 11:52:02 +02:00
addrlock.go all: update license information (#16089) 2018-02-14 13:49:11 +01:00
api.go eth: quick canceling block inserting when debug_setHead is invoked (#32067) 2025-06-23 14:04:21 +08:00
api_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
backend.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00
dbapi.go all: remove concept of public/private API definitions (#25053) 2022-06-21 12:05:43 +03:00
errors.go internal/ethapi: eth_multicall (#27720) 2024-09-06 11:31:00 +02:00
logtracer.go internal/ethapi: eth_multicall (#27720) 2024-09-06 11:31:00 +02:00
simulate.go eth/filters: add timestamp to derived logs (#31887) 2025-06-10 11:52:02 +02:00
simulate_test.go internal/ethapi: update default simulation timestamp increment to 12 (#30981) 2025-01-03 20:15:06 +08:00
transaction_args.go params,core: add max and target value to chain config (#31002) 2025-02-04 15:43:18 +01:00
transaction_args_test.go core: reduce load on txindexer from API (#31752) 2025-05-05 10:07:55 +08:00