go-ethereum/internal
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
..
blocktest internal/blocktest: add package for shared test code (#27270) 2023-07-11 14:57:02 +02:00
build internal/build: add support for Github Actions CI environment (#31891) 2025-05-23 17:48:15 +02:00
cmdtest cmd/geth, internal: fix flaky console tests (#31784) 2025-05-08 15:15:36 +02:00
debug internal/debug: add debug_setMemoryLimit (#31441) 2025-04-22 12:57:17 +08:00
download cmd/geth, internal/era/eradl: add era1 downloader tool (#31823) 2025-05-15 22:53:26 +02:00
era core/rawdb: integrate eradb backend for RPC (#31604) 2025-06-03 10:47:38 +02:00
ethapi eth: quick canceling block inserting when debug_setHead is invoked (#32067) 2025-06-23 14:04:21 +08:00
flags cmd/workload: RPC workload tests for filters and history (#31189) 2025-02-27 00:07:14 +01:00
guide all: fix typos in docs and comments (#31548) 2025-04-02 13:52:40 -06:00
jsre internal: remove eth_{compile,getWork,submitWork} from console (#31856) 2025-05-19 15:55:17 +02:00
reexec internal/reexec: fix broken link to Docker/Moby in comment (#31859) 2025-05-20 15:58:00 +08:00
shutdowncheck eth, les: update unclean shutdown markers regularly (#24077) 2021-12-17 15:18:51 +01:00
syncx core: improve shutdown synchronization in BlockChain (#22853) 2021-10-07 15:47:50 +02:00
testlog internal/testlog: fix log output from sub-loggers (#31539) 2025-04-10 18:21:32 +02:00
testrand triedb/pathdb: improve tests (#29278) 2024-03-19 10:50:08 +08:00
utesting internal: run tests in parallel (#30381) 2024-09-16 08:44:47 +02:00
version build, internal, version: break ci.go/version->common dependency (#30638) 2024-10-20 19:28:39 +03:00
web3ext internal/web3ext: remove the legacy backtraceAt method (#31783) 2025-05-08 14:57:17 +08:00