Skip to content
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

How to determine if the node is in the "looking for assume-valid-target" stage? #4485

Closed
yanguoyu opened this issue Jun 18, 2024 · 3 comments · Fixed by #4486
Closed

How to determine if the node is in the "looking for assume-valid-target" stage? #4485

yanguoyu opened this issue Jun 18, 2024 · 3 comments · Fixed by #4486
Labels
t:enhancement Type: Feature, refactoring.

Comments

@yanguoyu
Copy link

yanguoyu commented Jun 18, 2024

Feature Request

Is your feature request related to a problem? Please describe.

To better show the synchronization process, we will inform the user that they are in the early synchronization stage, which is 'looking for assume-valid-target'. So we need to know how to get that the ckb node is looking for assume-valid-target

Describe the solution you'd like

Now we are using log matching for determination. But the log changes several times. So I want to know if there is a more accurate way to determine this.

Describe alternatives you've considered

Could we use the sync_status to get the best_known_block_number , and check whether the best_known_block_number is less than the assume-valid-target block number?

@eval-exec
Copy link
Collaborator

eval-exec commented Jun 18, 2024

Could we use the sync_status to get the best_known_block_number , and check whether the best_known_block_number is less than the assume-valid-target block number?

Technically possible.
However, strictly speaking, it's possible that when best_known_block_number > assume-valid-target number, best_known_block_number and assume-valid-target are not on the same chain (though this probability is extremely low)."

@yanguoyu
Copy link
Author

Could we use the sync_status to get the best_known_block_number , and check whether the best_known_block_number is less than the assume-valid-target block number?

Technically possible. However, strictly speaking, it's possible that when best_known_block_number > assume-valid-target number, best_known_block_number and assume-valid-target are not on the same chain (though this probability is extremely low)."

Are you planning to expose an interface to retrieve this state?

@eval-exec
Copy link
Collaborator

Could we use the sync_status to get the best_known_block_number , and check whether the best_known_block_number is less than the assume-valid-target block number?

Technically possible. However, strictly speaking, it's possible that when best_known_block_number > assume-valid-target number, best_known_block_number and assume-valid-target are not on the same chain (though this probability is extremely low)."

Are you planning to expose an interface to retrieve this state?

Yes, we are currently planning to expose assume_valid_target_found: bool in the sync_state RPC interface to determine if CKB has found an assume-valid-target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:enhancement Type: Feature, refactoring.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants