node icon indicating copy to clipboard operation
node copied to clipboard

feat: support setting default config.toml values

Open skosito opened this issue 7 months ago • 7 comments

Description

This should enable us to reduce block time in code, without coordinating with all nodes, it will override config.toml timeout_commit field. Can be skipped in e2e tests or localnet with a flag.

How Has This Been Tested?

  • [ ] Tested CCTX in localnet
  • [ ] Tested in development environment
  • [ ] Go unit tests
  • [ ] Go integration tests
  • [ ] Tested via GitHub Actions

Summary by CodeRabbit

  • New Features

    • Added automatic override of the consensus TimeoutCommit setting to 5 seconds in the configuration file when starting the node, improving default behavior.
    • Introduced a new --skip-config-override flag to allow users to opt out of automatic configuration overrides during node startup.
  • Chores

    • Updated documentation to reflect the new configuration override feature.

skosito avatar May 16 '25 16:05 skosito

[!IMPORTANT]

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The changes introduce an automatic override for the Tendermint config.toml default values, specifically setting the consensus TimeoutCommit to 5 seconds during the start command, unless bypassed via a new --skip-config-override flag. The changelog and startup scripts are updated to reflect and utilize this new behavior.

Changes

File(s) Change Summary
changelog.md Updated to document the new feature allowing default values in config.toml, referencing pull request #3882.
cmd/zetacored/root.go Added override logic for Tendermint config defaults in the start command, new skip flag, and relevant refactors.
contrib/localnet/scripts/start-zetacored.sh Modified to pass the --skip-config-override flag to the startup command, disabling automatic config overrides.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Script
    participant zetacored
    participant ConfigOverride

    User->>Script: Run start-zetacored.sh
    Script->>zetacored: Execute start command with --skip-config-override
    zetacored->>ConfigOverride: Check skip-config-override flag
    alt Flag is set
        ConfigOverride-->>zetacored: Skip config override
    else Flag is not set
        ConfigOverride->>zetacored: Override config.toml defaults (TimeoutCommit = 5s)
    end
    zetacored->>User: Node starts with appropriate config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

coderabbitai[bot] avatar May 16 '25 16:05 coderabbitai[bot]

@skosito need to run make generate?

lumtis avatar May 22 '25 08:05 lumtis

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 64.94%. Comparing base (194548f) to head (0dc193d). Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3882   +/-   ##
========================================
  Coverage    64.94%   64.94%           
========================================
  Files          470      470           
  Lines        34391    34391           
========================================
  Hits         22336    22336           
  Misses       11024    11024           
  Partials      1031     1031           
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar May 22 '25 11:05 codecov[bot]

i will look into upgrade tests failing

skosito avatar May 22 '25 12:05 skosito

@lumtis @kingpinXD i fixed upgrade tests like this https://github.com/zeta-chain/node/pull/3882/commits/97a017839db2280b58766da7cc506d5641ec7ecc

old binary doesn't have this old flag, i think this should be ok we can remove the check after new release, please let me know if we did things like this differently

skosito avatar May 22 '25 23:05 skosito

@lumtis @kingpinXD i fixed upgrade tests like this 97a0178

old binary doesn't have this old flag, i think this should be ok we can remove the check after new release, please let me know if we did things like this differently

lgtm , maybe we can track in an issue . It up to you though .

kingpinXD avatar May 23 '25 00:05 kingpinXD

@lumtis @kingpinXD i fixed upgrade tests like this 97a0178 old binary doesn't have this old flag, i think this should be ok we can remove the check after new release, please let me know if we did things like this differently

lgtm , maybe we can track in an issue . It up to you though .

will add the issue, for some reason actual test is failing, before they weren't even starting, will investigate more, not sure yet how it can be related to this change

skosito avatar May 23 '25 00:05 skosito