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

Display sync percentage in 'chia show -s' #18388

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Conversation

aqk
Copy link
Contributor

@aqk aqk commented Aug 1, 2024

Purpose:

No breaking changes

Current Behavior:

    Current Blockchain Status: Syncing 5109645/5496001 (386356 behind).

Displays number of blocks to be synced

New Behavior:

    Current Blockchain Status: Syncing 5109645/5496001 (386356 behind). (15.06% synced)

Displays number of blocks to be synced
AND
percentage of blockchain synced

Testing Notes:

@aqk aqk added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Aug 1, 2024
@aqk aqk requested a review from fchirica August 1, 2024 21:36
@aqk aqk requested a review from a team as a code owner August 1, 2024 21:36
@arvidn
Copy link
Contributor

arvidn commented Aug 5, 2024

a potential usability issue is that once you reach 100%, chances are that the new peak has moved away from you and you have to go back to syncing, and "restart" the percentage counter at 0%.

@aqk
Copy link
Contributor Author

aqk commented Aug 5, 2024

a potential usability issue is that once you reach 100%, chances are that the new peak has moved away from you and you have to go back to syncing, and "restart" the percentage counter at 0%.

When the node considers itself synced, an alternate message is displayed ("Full Node Synced")

@aqk aqk closed this Aug 5, 2024
@aqk aqk reopened this Aug 5, 2024
@arvidn
Copy link
Contributor

arvidn commented Aug 5, 2024

When the node considers itself synced, an alternate message is displayed ("Full Node Synced")

I'm talking about the case where you sync for a long enough time that the chain progresses significantly while you sync. Then you'll be at 100% (of the initial peak you targets). But then back to 0% for the next long sync, catching up.

@aqk
Copy link
Contributor Author

aqk commented Aug 5, 2024

When the node considers itself synced, an alternate message is displayed ("Full Node Synced")

I'm talking about the case where you sync for a long enough time that the chain progresses significantly while you sync. Then you'll be at 100% (of the initial peak you targets). But then back to 0% for the next long sync, catching up.

Ah yes - I notice there are three states:

  • "Full Node Synced"
  • Syncing
  • "Full node not synced"

I wonder if the code uses "Full node not synced" when the sync is stale (the case you mention above).

I'll simulate what you're talking about for print_blockchain_state, and change it in another PR if we need to.

@Starttoaster Starttoaster merged commit a6ba3a4 into main Aug 5, 2024
737 of 738 checks passed
@Starttoaster Starttoaster deleted the ak.display-sync-percent branch August 5, 2024 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants