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

docs: add syncing documentation #23344

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

docs: add syncing documentation #23344

wants to merge 6 commits into from

Conversation

ziscky
Copy link
Contributor

@ziscky ziscky commented Jan 13, 2025

Description

Closes: #8369


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • Documentation
    • Added a new section on "Syncing" within blockchain context.
    • Explained three types of syncing: Genesis Sync, State Sync, and Snapshot Sync.
    • Included metrics for monitoring syncing progress.
    • Provided configuration examples in TOML format for both block and state sync.
    • Described methods to check sync completion using API queries.

@ziscky ziscky requested a review from a team as a code owner January 13, 2025 10:52
Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

📝 Walkthrough

Walkthrough

The pull request introduces a new documentation section titled 18-syncing.md within the advanced learning resources, detailing the blockchain syncing processes. It covers three types of syncing: Genesis Sync, State Sync, and Snapshot Sync, along with metrics for monitoring progress and configuration examples in TOML format. The document also explains how to verify the completion of syncing through API queries.

Changes

File Change Summary
docs/learn/advanced/18-syncing.md New documentation section added explaining blockchain syncing processes, types of syncing, metrics for monitoring, configuration examples, and methods to check sync completion.

Assessment against linked issues

Objective Addressed Explanation
Update docs on blockchain sync progress
Update docs on state sync progress
Explain how to check blockchain sync status
Update default log levels Log level configuration not explicitly addressed in documentation.

Possibly related PRs

  • docs: update ADR 59 #22423: The changes in this PR update documentation related to ADR 59, which may involve aspects of syncing as it pertains to testing scopes, potentially connecting to the syncing processes described in the main PR.
  • docs: clarification on timeout timestamp #23322: This PR clarifies the timeout timestamp in transaction generation, which could relate to the syncing process by ensuring that transactions are valid within specified time constraints, relevant to the syncing methods outlined in the main PR.
  • docs: Add environment documentation link and description #23330: This PR enhances the UPGRADING.md documentation, which may include references to syncing mechanisms as part of the overall upgrade process, indirectly related to the syncing documentation in the main PR.

Suggested reviewers

  • akhilkumarpilli
  • sontrinh16

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
docs/learn/advanced/18-syncing.md (4)

5-7: Enhance the introduction with context and importance.

Consider expanding the introduction to explain why syncing is important for blockchain networks and when different sync methods should be used.

 # Syncing

-Syncing is the process of downloading the blockchain and state from a remote node.
+Syncing is the process of downloading the blockchain and state from a remote node. This process is crucial for new nodes joining the network to catch up with the current state and for existing nodes to stay up-to-date with the latest blockchain data.

11-14: Improve grammar and formatting in sync types description.

The descriptions need grammatical improvements for better clarity.

-1. Blockchain syncing.   
-    With block sync a node is downloading all of the data of an application from genesis and verifying it. 
-2. State syncing.   
-    With state sync your node will download data related to the head or near the head of the chain and verify the data. This leads to drastically shorter times for joining a network.
+1. Blockchain syncing:   
+    With block sync, a node downloads all data from genesis and verifies it. 
+2. State syncing:   
+    With state sync, your node downloads data related to the head or near the head of the chain and verifies it. This leads to drastically shorter times for joining a network.
🧰 Tools
🪛 LanguageTool

[formatting] ~12-~12: Consider inserting a comma here, unless the first half is essential to the meaning of the sentence.
Context: .... Blockchain syncing. With block sync a node is downloading all of the data o...

(WITH_THAT_COMMA)


[style] ~12-~12: Consider removing “of” to be more concise
Context: ... With block sync a node is downloading all of the data of an application from genesis and...

(ALL_OF_THE)


[grammar] ~12-~12: Before the countable noun ‘from’ an article or a possessive pronoun is necessary.
Context: ... all of the data of an application from genesis and verifying it. 2. State syncing. ...

(IN_NN_CC_VBG)


[formatting] ~14-~14: Consider inserting a comma here, unless the first half is essential to the meaning of the sentence.
Context: ...t. 2. State syncing. With state sync your node will download data related to...

(WITH_THAT_COMMA)


21-25: Maintain consistent list style using asterisks.

Replace dashes with asterisks for consistent unordered list formatting throughout the document.

-    - `blocksync_syncing`: Indicates whether a node is currently block syncing.
-    - `blocksync_num_txs`: Number of transactions in the latest block.
-    - `blocksync_total_txs`: Total number of transactions.
-    - `blocksync_block_size_bytes`: Size of the latest block in bytes.
-    - `blocksync_latest_block_height`: Height of the latest block.
+    * `blocksync_syncing`: Indicates whether a node is currently block syncing.
+    * `blocksync_num_txs`: Number of transactions in the latest block.
+    * `blocksync_total_txs`: Total number of transactions.
+    * `blocksync_block_size_bytes`: Size of the latest block in bytes.
+    * `blocksync_latest_block_height`: Height of the latest block.

Also applies to: 37-37

🧰 Tools
🪛 LanguageTool

[uncategorized] ~21-~21: Loose punctuation mark.
Context: ...lock Sync Metrics - blocksync_syncing: Indicates whether a node is currently b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~22-~22: Loose punctuation mark.
Context: ...tly block syncing. - blocksync_num_txs: Number of transactions in the latest bl...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...he latest block. - blocksync_total_txs: Total number of transactions. - `blocks...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ...sactions. - blocksync_block_size_bytes: Size of the latest block in bytes. - `b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...bytes. - blocksync_latest_block_height: Height of the latest block. ### Block ...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 Markdownlint (0.37.0)

21-21: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


22-22: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


23-23: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


24-24: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


25-25: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


63-63: Add a troubleshooting section.

Consider adding a section about common sync issues and their solutions, including:

  • Network connectivity problems
  • Insufficient disk space
  • Corrupt database handling
  • Common error messages and their meaning

Would you like me to provide a template for the troubleshooting section?

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c79e19d and b9fcff0.

📒 Files selected for processing (1)
  • docs/learn/advanced/18-syncing.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/learn/advanced/18-syncing.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

🪛 LanguageTool
docs/learn/advanced/18-syncing.md

[formatting] ~12-~12: Consider inserting a comma here, unless the first half is essential to the meaning of the sentence.
Context: .... Blockchain syncing. With block sync a node is downloading all of the data o...

(WITH_THAT_COMMA)


[style] ~12-~12: Consider removing “of” to be more concise
Context: ... With block sync a node is downloading all of the data of an application from genesis and...

(ALL_OF_THE)


[grammar] ~12-~12: Before the countable noun ‘from’ an article or a possessive pronoun is necessary.
Context: ... all of the data of an application from genesis and verifying it. 2. State syncing. ...

(IN_NN_CC_VBG)


[formatting] ~14-~14: Consider inserting a comma here, unless the first half is essential to the meaning of the sentence.
Context: ...t. 2. State syncing. With state sync your node will download data related to...

(WITH_THAT_COMMA)


[uncategorized] ~21-~21: Loose punctuation mark.
Context: ...lock Sync Metrics - blocksync_syncing: Indicates whether a node is currently b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~22-~22: Loose punctuation mark.
Context: ...tly block syncing. - blocksync_num_txs: Number of transactions in the latest bl...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...he latest block. - blocksync_total_txs: Total number of transactions. - `blocks...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ...sactions. - blocksync_block_size_bytes: Size of the latest block in bytes. - `b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...bytes. - blocksync_latest_block_height: Height of the latest block. ### Block ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~37-~37: Loose punctuation mark.
Context: ...tate Sync Metrics - statesync_syncing: Indicates whether a node is currently s...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 Markdownlint (0.37.0)
docs/learn/advanced/18-syncing.md

21-21: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


22-22: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


23-23: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


24-24: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


25-25: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


37-37: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


56-56: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


57-57: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


58-58: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: main
  • GitHub Check: main
  • GitHub Check: main
  • GitHub Check: main
  • GitHub Check: build (arm64)
  • GitHub Check: build (amd64)
  • GitHub Check: markdown-link-check
  • GitHub Check: dependency-review
  • GitHub Check: Summary

docs/learn/advanced/18-syncing.md Outdated Show resolved Hide resolved
docs/learn/advanced/18-syncing.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
docs/learn/advanced/18-syncing.md (3)

7-14: Improve clarity and formatting of the introduction

The introduction needs some grammatical improvements and better formatting:

-Syncing is the process of downloading the blockchain and state from a remote node.
+Syncing is the process of downloading the blockchain data and state from a remote node.

 There are two types of syncing:

-1. Blockchain syncing.   
-    With block sync a node is downloading all of the data of an application from genesis and verifying it. 
-2. State syncing.   
-    With state sync your node will download data related to the head or near the head of the chain and verify the data. This leads to drastically shorter times for joining a network.
+1. **Blockchain syncing:**   
+    With block sync, a node downloads and verifies all application data from genesis.
+2. **State syncing:**   
+    With state sync, your node downloads and verifies data near the chain's head, drastically reducing network join time.
🧰 Tools
🪛 LanguageTool

[formatting] ~12-~12: Consider inserting a comma here, unless the first half is essential to the meaning of the sentence.
Context: .... Blockchain syncing. With block sync a node is downloading all of the data o...

(WITH_THAT_COMMA)


[style] ~12-~12: Consider removing “of” to be more concise
Context: ... With block sync a node is downloading all of the data of an application from genesis and...

(ALL_OF_THE)


[grammar] ~12-~12: Before the countable noun ‘from’ an article or a possessive pronoun is necessary.
Context: ... all of the data of an application from genesis and verifying it. 2. State syncing. ...

(IN_NN_CC_VBG)


[formatting] ~14-~14: Consider inserting a comma here, unless the first half is essential to the meaning of the sentence.
Context: ...t. 2. State syncing. With state sync your node will download data related to...

(WITH_THAT_COMMA)


23-27: Use consistent list formatting and add metric types

The metrics should use consistent formatting and include their types for better clarity.

-Block Sync Metrics
+### Block Sync Metrics
 
-- `blocksync_syncing`: Indicates whether a node is currently block syncing.
-- `blocksync_num_txs`: Number of transactions in the latest block.
-- `blocksync_total_txs`: Total number of transactions.
-- `blocksync_block_size_bytes`: Size of the latest block in bytes.
-- `blocksync_latest_block_height`: Height of the latest block.
+* `blocksync_syncing` (boolean): Indicates whether a node is currently block syncing.
+* `blocksync_num_txs` (integer): Number of transactions in the latest block.
+* `blocksync_total_txs` (integer): Total number of transactions.
+* `blocksync_block_size_bytes` (integer): Size of the latest block in bytes.
+* `blocksync_latest_block_height` (integer): Height of the latest block.

-### State Sync Metrics
+### State Sync Metrics
 
-- `statesync_syncing`: Indicates whether a node is currently state syncing.
+* `statesync_syncing` (boolean): Indicates whether a node is currently state syncing.

Also applies to: 40-40

🧰 Tools
🪛 LanguageTool

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...lock Sync Metrics - blocksync_syncing: Indicates whether a node is currently b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~24-~24: Loose punctuation mark.
Context: ...tly block syncing. - blocksync_num_txs: Number of transactions in the latest bl...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...he latest block. - blocksync_total_txs: Total number of transactions. - `blocks...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~26-~26: Loose punctuation mark.
Context: ...sactions. - blocksync_block_size_bytes: Size of the latest block in bytes. - `b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...bytes. - blocksync_latest_block_height: Height of the latest block. ### Block ...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 Markdownlint (0.37.0)

23-23: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


24-24: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


25-25: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


26-26: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


27-27: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


69-90: Improve API examples formatting and clarity

The API examples need better formatting and clarification about the response fields.

-Query for the node status using the REST or GRPC API:  
+Query for the node status using either the REST or gRPC API:
 
 REST example:  
+
 ```bash  
 curl http://localhost:1317/cosmos/base/tendermint/v1beta1/syncing  

Expected response:
+

{  
  "syncing": false  
}  

GRPC example:
+

grpcurl -plaintext localhost:9090 cosmos.base.tendermint.v1beta1.Service/GetSyncing  

-The response includes SyncInfo.CatchingUp field
-Syncing is complete when this field is false
+The response field meanings:
+* REST API: The syncing field indicates if the node is still syncing (true) or has completed syncing (false).
+* gRPC API: The SyncInfo.CatchingUp field serves the same purpose as the REST API's syncing field.


<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint (0.37.0)</summary>

72-72: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

77-77: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

84-84: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

</details>

</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: .coderabbit.yml**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b9fcff05278da7e60807ae595c45609c42ea1a23 and aca8474c9aee735d0965f994e8edb9643df4f5a6.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `docs/learn/advanced/18-syncing.md` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>📓 Path-based instructions (1)</summary>

<details>
<summary>docs/learn/advanced/18-syncing.md (1)</summary>

Pattern `**/*.md`: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"


</details>

</details><details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>docs/learn/advanced/18-syncing.md</summary>

[formatting] ~12-~12: Consider inserting a comma here, unless the first half is essential to the meaning of the sentence.
Context: .... Blockchain syncing.        With block sync a node is downloading all of the data o...

(WITH_THAT_COMMA)

---

[style] ~12-~12: Consider removing “of” to be more concise
Context: ...  With block sync a node is downloading all of the data of an application from genesis and...

(ALL_OF_THE)

---

[grammar] ~12-~12: Before the countable noun ‘from’ an article or a possessive pronoun is necessary.
Context: ... all of the data of an application from genesis and verifying it.  2. State syncing.   ...

(IN_NN_CC_VBG)

---

[formatting] ~14-~14: Consider inserting a comma here, unless the first half is essential to the meaning of the sentence.
Context: ...t.  2. State syncing.        With state sync your node will download data related to...

(WITH_THAT_COMMA)

---

[uncategorized] ~23-~23: Loose punctuation mark.
Context: ...lock Sync Metrics  - `blocksync_syncing`: Indicates whether a node is currently b...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~24-~24: Loose punctuation mark.
Context: ...tly block syncing. - `blocksync_num_txs`: Number of transactions in the latest bl...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~25-~25: Loose punctuation mark.
Context: ...he latest block. - `blocksync_total_txs`: Total number of transactions. - `blocks...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~26-~26: Loose punctuation mark.
Context: ...sactions. - `blocksync_block_size_bytes`: Size of the latest block in bytes. - `b...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~27-~27: Loose punctuation mark.
Context: ...bytes. - `blocksync_latest_block_height`: Height of the latest block.  ### Block ...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ...sync:     version: "v0" ```  - `version`: The version of the block sync protocol ...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~40-~40: Loose punctuation mark.
Context: ...tate Sync Metrics  - `statesync_syncing`: Indicates whether a node is currently s...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~57-~57: Loose punctuation mark.
Context: ...     chunk_fetchers: "4" ```  - `enable`: Set to true to enable state sync. - `rp...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~58-~58: Loose punctuation mark.
Context: ...ue to enable state sync. - `rpc_servers`: Comma-separated list of RPC servers for...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~59-~59: Loose punctuation mark.
Context: ...servers for state sync. - `trust_height`: Block height to trust for state sync. -...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~60-~60: Loose punctuation mark.
Context: ... to trust for state sync. - `trust_hash`: Block hash to trust for state sync. - `...

(UNLIKELY_OPENING_PUNCTUATION)

---

[grammar] ~60-~60: The singular proper name ‘Block’ must be used with a third-person or a past tense verb.
Context: ...t for state sync. - `trust_hash`: Block hash to trust for state sync. - `trust_perio...

(HE_VERB_AGR)

---

[uncategorized] ~61-~61: Loose punctuation mark.
Context: ...o trust for state sync. - `trust_period`: Trust period for light client verificat...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~62-~62: Loose punctuation mark.
Context: ... client verification. - `discovery_time`: Time to spend discovering snapshots bef...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~63-~63: Loose punctuation mark.
Context: ...apshots before picking one. - `temp_dir`: Directory for temporary state sync file...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~64-~64: Loose punctuation mark.
Context: ...te sync files. - `chunk_request_timeout`: Timeout for chunk requests. - `chunk_fe...

(UNLIKELY_OPENING_PUNCTUATION)

---

[uncategorized] ~65-~65: Loose punctuation mark.
Context: ...t for chunk requests. - `chunk_fetchers`: Number of concurrent chunk fetchers.  #...

(UNLIKELY_OPENING_PUNCTUATION)

</details>

</details>
<details>
<summary>🪛 Markdownlint (0.37.0)</summary>

<details>
<summary>docs/learn/advanced/18-syncing.md</summary>

23-23: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

24-24: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

25-25: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

26-26: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

27-27: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

36-36: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

40-40: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

57-57: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

58-58: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

59-59: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

60-60: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

61-61: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

62-62: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

63-63: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

64-64: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

65-65: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

---

19-19: Punctuation: '.'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)

---

72-72: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

77-77: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

84-84: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (8)</summary>

* GitHub Check: tests (02)
* GitHub Check: test-x-epochs
* GitHub Check: test-x-slashing
* GitHub Check: build (arm64)
* GitHub Check: build (amd64)
* GitHub Check: dependency-review
* GitHub Check: markdown-link-check
* GitHub Check: Summary

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

docs/learn/advanced/18-syncing.md Outdated Show resolved Hide resolved
docs/learn/advanced/18-syncing.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to ask a validator for a review (eg @tac0turtle / Binary).

Comment on lines 9 to 14
There are two types of syncing:

1. Blockchain syncing.
With block sync a node is downloading all of the data of an application from genesis and verifying it.
2. State syncing.
With state sync your node will download data related to the head or near the head of the chain and verify the data. This leads to drastically shorter times for joining a network.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are two types of syncing:
1. Blockchain syncing.
With block sync a node is downloading all of the data of an application from genesis and verifying it.
2. State syncing.
With state sync your node will download data related to the head or near the head of the chain and verify the data. This leads to drastically shorter times for joining a network.
There are few types to sync a node:
1. Genesis Sync: operator downloads genesis, sets peers and syncs the blockchain by executing all blocks since genesis.
NOTE: requires a peer node that doesn't prune blocks (CometBFT state).
1. State Sync: operator need to set `trust_height` and `trust_hash` of a block that s/he trusts as well as `trust_period` - the time how long the operator will trust the given block height. The app will query peer nodes to stream state from that blocks as well as all following blocks. Once the state is downloaded, the node will start executing all blocks since the `trust_height`.
NOTE: requires a peer node that provides a state sync and is trusted by the validator.
1. Snapshot Sync: operator downloads a snapshot from snapshot provider (usually validators) s/he trusts. From there the operator needs to unpack the snapshot to the node directory, update config, set peers, set moniker, setup validator keys. Once the data directory is properly configured, the validator can start a node. The node will query blocks since the snapshot and execute them.
NOTE: requires a snapshot directory that is trusted by the validator.
Genesis Sync has zero trust assumptions, but it's the most resource heavy. It also requires a node with all blocks - many validators prune the blocks to optimize space.
Snapshot sync is the fastest and the most efficient: it downloads snapshot using a content delivery network or a protocol optimized for data dalivery, rather than streaming from existing nodes. Once you have a snapshot you can easily resync from the same snapshot if you have problems. State sync might be more complicated.

discovery_time: 15s
temp_dir: ""
chunk_request_timeout: 10s
chunk_fetchers: "4"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a toml syntax. The config snippet should be updated to a proper toml snippet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, same for "Block sync configuration" section earlier on

- `discovery_time`: Time to spend discovering snapshots before picking one.
- `temp_dir`: Directory for temporary state sync files.
- `chunk_request_timeout`: Timeout for chunk requests.
- `chunk_fetchers`: Number of concurrent chunk fetchers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of creating another section to explain params, let's explain them in the config code using comments:

[statesync]
// Comma-separated list of RPC servers for state sync.
rpc_servers = ...

REST example:
```bash
curl http://localhost:1317/cosmos/base/tendermint/v1beta1/syncing
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also check with app q consensus comet syncing

docs/learn/advanced/18-syncing.md Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
docs/learn/advanced/18-syncing.md (1)

34-34: Clarify metrics location and access.

Specify where these metrics are stored and how they can be accessed (e.g., Prometheus endpoint, metrics path).

-They are defined [here](https://github.com/cometbft/cometbft/blob/main/internal/blocksync/metrics.go) and are accessible from the node's metrics endpoint.
+These metrics are defined [here](https://github.com/cometbft/cometbft/blob/main/internal/blocksync/metrics.go) and are exposed via the Prometheus metrics endpoint at `/metrics`. They can be queried using standard Prometheus queries or visualized using tools like Grafana.
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aca8474 and 8048557.

📒 Files selected for processing (1)
  • docs/learn/advanced/18-syncing.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/learn/advanced/18-syncing.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

🪛 LanguageTool
docs/learn/advanced/18-syncing.md

[uncategorized] ~14-~14: Possible missing comma found.
Context: ...andtrust_hashof a block that s/he trusts as well astrust_period` - the time ho...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~14-~14: This phrasing can be wordy.
Context: ... nodes to stream state from that blocks as well as all following blocks. Once the state is...

(AS_WELL_AS_AND)


[grammar] ~28-~28: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ... /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)


[uncategorized] ~36-~36: Loose punctuation mark.
Context: ...metrics endpoint. - blocksync_syncing: Indicates whether a node is currently b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~37-~37: Loose punctuation mark.
Context: ...tly block syncing. - blocksync_num_txs: Number of transactions in the latest bl...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~38-~38: Loose punctuation mark.
Context: ...he latest block. - blocksync_total_txs: Total number of transactions. - `blocks...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~39-~39: Loose punctuation mark.
Context: ...sactions. - blocksync_block_size_bytes: Size of the latest block in bytes. - `b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~40-~40: Loose punctuation mark.
Context: ...bytes. - blocksync_latest_block_height: Height of the latest block. ### Block ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~53-~53: Loose punctuation mark.
Context: ...metrics endpoint. - statesync_syncing: Indicates whether a node is currently s...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 Markdownlint (0.37.0)
docs/learn/advanced/18-syncing.md

36-36: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


37-37: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


38-38: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


39-39: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


40-40: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


53-53: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


75-75: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


80-80: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


87-87: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: repo-analysis
  • GitHub Check: build (arm64)
  • GitHub Check: build (amd64)
  • GitHub Check: dependency-review
  • GitHub Check: markdown-link-check
  • GitHub Check: Summary
🔇 Additional comments (1)
docs/learn/advanced/18-syncing.md (1)

26-30: Make Comet dependency more prominent.

🧰 Tools
🪛 LanguageTool

[grammar] ~28-~28: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ... /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)

docs/learn/advanced/18-syncing.md Show resolved Hide resolved
docs/learn/advanced/18-syncing.md Show resolved Hide resolved
docs/learn/advanced/18-syncing.md Show resolved Hide resolved
docs/learn/advanced/18-syncing.md Show resolved Hide resolved
@ziscky ziscky requested a review from robert-zaremba January 14, 2025 10:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
docs/learn/advanced/18-syncing.md (3)

34-34: Clarify metrics storage location.

Please specify where these metrics are stored and how they can be accessed in a monitoring system.


80-95: Improve code block formatting consistency.

Add blank lines around code blocks for better readability and consistent formatting.

 Query for the node status using the REST or GRPC API:  
+
 REST example:  
+
 ```bash  
 curl http://localhost:1317/cosmos/base/tendermint/v1beta1/syncing  

Expected response:
+

{  
  "syncing": false  
}  

GRPC example:
+

grpcurl -plaintext localhost:9090 cosmos.base.tendermint.v1beta1.Service/GetSyncing  

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Markdownlint (0.37.0)</summary>

81-81: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

86-86: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

93-93: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

</details>

</details>

---

`36-40`: **Use consistent list style.**

Replace dashes with asterisks in unordered lists for consistency:

```diff
-  - `blocksync_syncing`: Indicates whether a node is currently block syncing.
-  - `blocksync_num_txs`: Number of transactions in the latest block.
-  - `blocksync_total_txs`: Total number of transactions.
-  - `blocksync_block_size_bytes`: Size of the latest block in bytes.
-  - `blocksync_latest_block_height`: Height of the latest block.
+  * `blocksync_syncing`: Indicates whether a node is currently block syncing.
+  * `blocksync_num_txs`: Number of transactions in the latest block.
+  * `blocksync_total_txs`: Total number of transactions.
+  * `blocksync_block_size_bytes`: Size of the latest block in bytes.
+  * `blocksync_latest_block_height`: Height of the latest block.

Also applies to: 53-53

🧰 Tools
🪛 LanguageTool

[uncategorized] ~36-~36: Loose punctuation mark.
Context: ...metrics endpoint. - blocksync_syncing: Indicates whether a node is currently b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~37-~37: Loose punctuation mark.
Context: ...tly block syncing. - blocksync_num_txs: Number of transactions in the latest bl...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~38-~38: Loose punctuation mark.
Context: ...he latest block. - blocksync_total_txs: Total number of transactions. - `blocks...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~39-~39: Loose punctuation mark.
Context: ...sactions. - blocksync_block_size_bytes: Size of the latest block in bytes. - `b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~40-~40: Loose punctuation mark.
Context: ...bytes. - blocksync_latest_block_height: Height of the latest block. ### Block ...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 Markdownlint (0.37.0)

36-36: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


37-37: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


38-38: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


39-39: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


40-40: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8048557 and 7ae0f43.

📒 Files selected for processing (1)
  • docs/learn/advanced/18-syncing.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/learn/advanced/18-syncing.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

🪛 LanguageTool
docs/learn/advanced/18-syncing.md

[style] ~14-~14: This phrasing can be wordy.
Context: ... nodes to stream state from that blocks as well as all following blocks. Once the state is...

(AS_WELL_AS_AND)


[grammar] ~28-~28: It looks like there is a word missing here. Did you mean “Listen to address”?
Context: ... /metrics on 26660 port by default. Listen address can be changed in the config file (see ...

(LISTEN_TO_ME)


[uncategorized] ~36-~36: Loose punctuation mark.
Context: ...metrics endpoint. - blocksync_syncing: Indicates whether a node is currently b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~37-~37: Loose punctuation mark.
Context: ...tly block syncing. - blocksync_num_txs: Number of transactions in the latest bl...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~38-~38: Loose punctuation mark.
Context: ...he latest block. - blocksync_total_txs: Total number of transactions. - `blocks...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~39-~39: Loose punctuation mark.
Context: ...sactions. - blocksync_block_size_bytes: Size of the latest block in bytes. - `b...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~40-~40: Loose punctuation mark.
Context: ...bytes. - blocksync_latest_block_height: Height of the latest block. ### Block ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~53-~53: Loose punctuation mark.
Context: ...metrics endpoint. - statesync_syncing: Indicates whether a node is currently s...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 Markdownlint (0.37.0)
docs/learn/advanced/18-syncing.md

36-36: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


37-37: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


38-38: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


39-39: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


40-40: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


53-53: Expected: asterisk; Actual: dash
Unordered list style

(MD004, ul-style)


81-81: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


86-86: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


93-93: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: repo-analysis
  • GitHub Check: test-x-gov
  • GitHub Check: build (arm64)
  • GitHub Check: build (amd64)
  • GitHub Check: dependency-review
  • GitHub Check: markdown-link-check
  • GitHub Check: Summary
🔇 Additional comments (3)
docs/learn/advanced/18-syncing.md (3)

14-14: Fix grammatical issues in State Sync description.

The sentence structure needs improvement in terms of grammar and clarity.

🧰 Tools
🪛 LanguageTool

[style] ~14-~14: This phrasing can be wordy.
Context: ... nodes to stream state from that blocks as well as all following blocks. Once the state is...

(AS_WELL_AS_AND)


44-47: Fix TOML syntax in configuration sections.

The TOML configuration needs proper syntax and formatting.

Also applies to: 57-68


26-26: Make Comet dependency more prominent.

The note about Comet dependency should be more prominent and clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blockchain sync documentation updates
5 participants