Skip to content

eth: add debug_syncTarget API #32126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We��ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nthumann
Copy link
Contributor

@nthumann nthumann commented Jul 1, 2025

closes #31375

Usage:

# set to an old target
> debug.syncTarget(eth.getBlockByNumber('latest').hash)
Error: sync target is already known in the chain
        at web3.js:6352:9(39)
        at send (web3.js:5116:62(29))
        at <eval>:1:17(7)


# success set a sync target
> debug.syncTarget( '0xb08a431304065baacc343026263f3ad5c7cdfafe05bdc1b8cec2be923951f8f0' )
null

# with a non-exist target
> debug.syncTarget( '0xb08a431304065baacc343026263f3ad5c7cdfafe05bdc1b8cec2be923951f8f1' )
Error: failed to retrieve header for target 0xb08a431304065baacc343026263f3ad5c7cdfafe05bdc1b8cec2be923951f8f1: failed to fetch sync target
        at web3.js:6352:9(39)
        at send (web3.js:5116:62(29))
        at <eval>:1:17(3)
@nthumann nthumann requested a review from rjl493456442 as a code owner July 1, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant