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: default TimeoutCommit to 3s (allow opt out of default overrides) #7769

Merged
merged 7 commits into from
Mar 20, 2024

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented Mar 19, 2024

Closes: #XXX

What is the purpose of the change

Sets and default the timeout commit to 3s.

Adds flag that allows node operators to opt out of custom overrides.

Testing and Verifying

Logs show when no flag is provided, log does not show when flag is set to true.

Summary by CodeRabbit

  • New Features
    • Introduced a feature to manage timeout commit settings, defaulting to 3 seconds for faster block times.
    • Added a flag to prevent overriding specific default configurations, enhancing user control over their settings.

Copy link
Contributor

coderabbitai bot commented Mar 19, 2024

Warning

Rate Limit Exceeded

@czarcas7ic has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 0 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 4df1520 and c2b48c6.

Walkthrough

The recent update, version v23.0.8-iavl-v1 & v23.0.8, introduces a notable enhancement to the blockchain's operational efficiency by adjusting the TimeoutCommit setting from 4 seconds to 3 seconds, aiming for quicker block times. Additionally, it incorporates a new flag, FlagRejectConfigDefaults, allowing users the option to prevent automatic overrides of specific default settings, thereby offering more control over their configuration preferences.

Changes

Files Change Summary
cmd/osmosisd/cmd/init.go Introduced FlagRejectConfigDefaults and adjusted TimeoutCommit to 3s.
cmd/osmosisd/cmd/root.go Updated TimeoutCommit to 3s and added logic for conditional overrides based on rejectConfigDefaults.

🐇✨
In the land of code, where the bits roam free,
A change was made, as quick as can be.
From four to three, the seconds did drop,
For blocks to commit, without a stop.
With a flag in hand, and options so wide,
We hop with joy, in this digital stride.
🚀🌌

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>.
    • Generate unit-tests 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 tests 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 tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@czarcas7ic czarcas7ic added V:state/compatible/backport State machine compatible PR, should be backported A:backport/v23.x backport patches to v23.x branch A:backport/v24.x backport patches to v24.x branch labels Mar 19, 2024
@czarcas7ic czarcas7ic changed the title chore: overwrite with defaults flag (set TimeoutCommit to 3s) chore: default TimeoutCommit to 3s (allow opt out of default overrides) Mar 19, 2024
@czarcas7ic czarcas7ic marked this pull request as ready for review March 19, 2024 18:54
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 3e8d0d4 and db1f800.
Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • cmd/osmosisd/cmd/init.go (2 hunks)
  • cmd/osmosisd/cmd/root.go (3 hunks)
Additional comments: 5
cmd/osmosisd/cmd/init.go (2)
  • 43-44: The introduction of the FlagRejectConfigDefaults flag is a significant change, providing flexibility for node operators to opt out of default overrides. This change aligns with the PR objectives to allow customization and should be clearly documented in the user guide or help command to ensure users are aware of how to use this new flag effectively.
  • 115-116: Adjusting the TimeoutCommit value from 4 seconds to 3 seconds is aimed at achieving faster block times, which is a critical performance optimization. However, it's essential to ensure that this change does not introduce any unintended side effects, such as increased risk of forks or decreased network stability, especially in networks with higher latencies. It would be beneficial to conduct thorough testing or simulations to assess the impact of this change under various network conditions.
cmd/osmosisd/cmd/root.go (2)
  • 443-443: The change to set TimeoutCommit to 3 seconds aligns with the PR's objective to optimize block commit times. However, it's crucial to ensure that this new default does not negatively impact the network's stability or performance under different conditions.
  • 700-722: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [703-744]

The introduction of the FlagRejectConfigDefaults flag provides flexibility for node operators to opt out of default overrides, including the new TimeoutCommit value. This is a positive change that respects operator autonomy. However, it's important to document this flag clearly in the project's documentation to ensure operators are aware of how to use it.

Consider adding detailed documentation or comments in the code explaining the purpose and usage of the FlagRejectConfigDefaults flag to improve user understanding.

CHANGELOG.md (1)
  • 73-73: The entry for the new feature in version v23.0.8-iavl-v1 & v23.0.8 is clear and concise, detailing the addition of a default timeout commit of 3 seconds and the introduction of a flag to prevent custom overrides. This change is significant as it directly impacts the blockchain's performance by potentially optimizing block times.

// Add ctx logger line to indicate that config.toml and app.toml values are being overwritten
serverCtx.Logger.Info("Overwriting config.toml and app.toml values with some recommended defaults. To prevent this, set the --reject-config-defaults flag to true.")

err := overwriteConfigTomlValues(serverCtx)
Copy link
Member

Choose a reason for hiding this comment

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

AFAIR, there was also a code branch somewhere that would check if the old value is 5 seconds and only then overwrite it. Have we checked/changed that value?

I'm AFK rn but can help with checking this later

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops yeah, I had that change locally when testing but didn't push, great catch

4df1520

Copy link
Member

Choose a reason for hiding this comment

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

Do we have to write ti the file, or can we pass the updated fike to tm? This lgtm!

Maybe worth asking in cometbft issue if we can achieve this w/o writing the file at runtime

This lgtm for this pr, nice job@

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe this can be done at the sdk level, I will make an issue and we can look into it at another time.

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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between db1f800 and 4df1520.
Files selected for processing (1)
  • cmd/osmosisd/cmd/root.go (4 hunks)
Additional comments: 2
cmd/osmosisd/cmd/root.go (2)
  • 742-742: The addition of the FlagRejectConfigDefaults flag is well-implemented and aligns with the PR objectives to allow opting out of default overrides. Good job on providing a clear description for the flag.
  • 443-443: The logic to set the default TimeoutCommit to 3 seconds and to conditionally overwrite config.toml and app.toml values based on the rejectConfigDefaults flag is correctly implemented. This change is crucial for achieving the PR's objectives of optimizing block commit times and providing flexibility in configuration management.

Also applies to: 469-470, 701-717

cmd/osmosisd/cmd/root.go Show resolved Hide resolved
@czarcas7ic czarcas7ic merged commit bf01cf0 into main Mar 20, 2024
1 check passed
@czarcas7ic czarcas7ic deleted the adam/overwrite-with-defaults-flag branch March 20, 2024 00:09
mergify bot pushed a commit that referenced this pull request Mar 20, 2024
…s) (#7769)

* overwrite with defaults flag

* add logic gate for overriding

* add log line

* make verbiage clearer

* add changelog

* dont check for specific value

* unused var

(cherry picked from commit bf01cf0)

# Conflicts:
#	CHANGELOG.md
mergify bot pushed a commit that referenced this pull request Mar 20, 2024
…s) (#7769)

* overwrite with defaults flag

* add logic gate for overriding

* add log line

* make verbiage clearer

* add changelog

* dont check for specific value

* unused var

(cherry picked from commit bf01cf0)
mergify bot pushed a commit that referenced this pull request Mar 20, 2024
…s) (#7769)

* overwrite with defaults flag

* add logic gate for overriding

* add log line

* make verbiage clearer

* add changelog

* dont check for specific value

* unused var

(cherry picked from commit bf01cf0)
czarcas7ic added a commit that referenced this pull request Mar 20, 2024
…s) (backport #7769) (#7781)

* chore: default TimeoutCommit to 3s (allow opt out of default overrides) (#7769)

* overwrite with defaults flag

* add logic gate for overriding

* add log line

* make verbiage clearer

* add changelog

* dont check for specific value

* unused var

(cherry picked from commit bf01cf0)

# Conflicts:
#	CHANGELOG.md

* Update CHANGELOG.md

* reject config defaults

* reject defaults

---------

Co-authored-by: Adam Tucker <adam@osmosis.team>
Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
czarcas7ic added a commit that referenced this pull request Mar 20, 2024
…s) (backport #7769) (#7783)

* chore: default TimeoutCommit to 3s (allow opt out of default overrides) (#7769)

* overwrite with defaults flag

* add logic gate for overriding

* add log line

* make verbiage clearer

* add changelog

* dont check for specific value

* unused var

(cherry picked from commit bf01cf0)

* reject config defaults

* reject defaults

---------

Co-authored-by: Adam Tucker <adam@osmosis.team>
Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
czarcas7ic added a commit that referenced this pull request Mar 20, 2024
…s) (backport #7769) (#7782)

* chore: default TimeoutCommit to 3s (allow opt out of default overrides) (#7769)

* overwrite with defaults flag

* add logic gate for overriding

* add log line

* make verbiage clearer

* add changelog

* dont check for specific value

* unused var

(cherry picked from commit bf01cf0)

* reject conflig defaults

* reject defaults

---------

Co-authored-by: Adam Tucker <adam@osmosis.team>
Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v23.x backport patches to v23.x branch A:backport/v24.x backport patches to v24.x branch V:state/compatible/backport State machine compatible PR, should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants