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

chore(scripts): mainnet v2 upgrade height #3868

Merged

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Sep 12, 2024

Modify the mainnet.sh script to provide the --v2-upgrade-height and use state sync.

@rootulp rootulp added the backport:v2.x PR will be backported automatically to the v2.x branch upon merging label Sep 12, 2024
@rootulp rootulp self-assigned this Sep 12, 2024
@rootulp rootulp requested a review from a team as a code owner September 12, 2024 10:01
@rootulp rootulp requested review from staheri14 and rach-id and removed request for a team September 12, 2024 10:01
Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

Walkthrough

The changes involve updates to the mainnet.sh script and the config.toml configuration file to improve the process of starting a consensus node on Mainnet Beta with state synchronization. A new RPC endpoint variable has been introduced, and the script now retrieves the latest block height to calculate a trust height and fetch the corresponding trust hash. Additionally, the configuration file has been modified to enable state synchronization and set relevant parameters, streamlining the startup process for the node.

Changes

Files Change Summary
scripts/mainnet.sh Updated to include a new RPC variable, retrieve latest block height, calculate trust height, and fetch trust hash. Replaced background start with a direct invocation of the start command.
config.toml Modified to enable state sync and set rpc_servers, trust_height, and trust_hash parameters.

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 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.

@celestia-bot celestia-bot requested a review from a team September 12, 2024 10:01
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

Outside diff range and nitpick comments (2)
scripts/mainnet.sh (2)

42-44: Consider a more dynamic approach for calculating the trust height.

The code segment correctly retrieves the latest block height and trust hash from the RPC endpoint. However, the trust height is calculated by subtracting a fixed value of 2000 from the latest height, which may not always be optimal.

Consider implementing a more dynamic approach for calculating the trust height based on the network conditions or configuration settings. This could help ensure that the trust height is always set to an appropriate value, improving the reliability and performance of the state sync process.


57-58: Consider a more flexible approach for specifying the upgrade height.

The code segment correctly starts the celestia-appd process with the start command and includes the --v2-upgrade-height flag to specify the block height at which the network upgrades to version 2.

Consider implementing a more flexible approach for specifying the upgrade height, such as reading it from a configuration file or environment variable. This would make it easier to update the upgrade height for future network upgrades without modifying the script itself.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b4e12ca and a0b77db.

Files selected for processing (1)
  • scripts/mainnet.sh (3 hunks)
Additional comments not posted (3)
scripts/mainnet.sh (3)

3-5: LGTM!

The comments provide a clear and concise description of the script's purpose.


16-16: LGTM!

The RPC variable is correctly declared and assigned a valid RPC endpoint URL. It will be used later in the script to retrieve the latest block height and trust hash.


46-52: LGTM!

The code segment correctly modifies the config.toml file to enable state sync and set the required parameters using the values obtained earlier. These changes are crucial for ensuring that the node starts with the correct trust height and trust hash, enabling a smooth state sync process.

@rootulp rootulp merged commit 3aeb3c5 into celestiaorg:main Sep 12, 2024
32 of 33 checks passed
@rootulp rootulp deleted the rp/mainnet-v2-upgrade-height-script branch September 12, 2024 12:53
mergify bot pushed a commit that referenced this pull request Sep 12, 2024
Modify the mainnet.sh script to provide the `--v2-upgrade-height` and
use state sync.

(cherry picked from commit 3aeb3c5)
rootulp added a commit that referenced this pull request Sep 13, 2024
Modify the mainnet.sh script to provide the `--v2-upgrade-height` and
use state sync.
<hr>This is an automatic backport of pull request #3868 done by
[Mergify](https://mergify.com).

Co-authored-by: Rootul P <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:v2.x PR will be backported automatically to the v2.x branch upon merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants