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

Improvise in-place-testnet docs #8805

Merged
merged 4 commits into from
Nov 13, 2024
Merged

Improvise in-place-testnet docs #8805

merged 4 commits into from
Nov 13, 2024

Conversation

mattverse
Copy link
Member

Closes: #XXX

What is the purpose of the change

Improving in place testnet docs with information I found useful while I was testing and using in place testnet

Testing and Verifying

This change is a trivial rework / code cleanup without any test coverage.

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@mattverse mattverse added V:state/compatible/no_backport State machine compatible PR, depends on prior breaks A:no-changelog labels Nov 7, 2024
@mattverse mattverse requested a review from a team as a code owner November 7, 2024 19:17
@github-actions github-actions bot added the C:docs Improvements or additions to documentation label Nov 7, 2024
Copy link
Contributor

coderabbitai bot commented Nov 7, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request modifies the README.md file for the LocalOsmosis project, enhancing instructions for setting up a testnet with mainnet state. It clarifies that the mainnet node should sync a few blocks before stopping for forking and revises the testnet creation command to include the --trigger-testnet-upgrade=vXX flag. Additional sections address log noise reduction and modifying testnet parameters, while minor formatting changes improve document readability. The section on LocalOsmosis accounts and keys remains unchanged.

Changes

File Change Summary
tests/localosmosis/README.md Enhanced testnet setup instructions, clarified command for testnet creation, added guidance on reducing log noise, and made minor formatting improvements.

Possibly related PRs

  • feat: readme update in 'tests' about user key and pool creation #8680: This PR updates the README.md file in the tests/localosmosis directory, which is directly related to the same file modified in the main PR, enhancing documentation for user key and pool creation.
  • Improvise in-place-testnet docs #8805: This PR also updates the README.md for the LocalOsmosis project, specifically clarifying the setup process for creating a testnet with mainnet state, which directly relates to the changes made in the main PR regarding testnet setup instructions.

Suggested reviewers

  • PaddyMc
  • alessandrolomanto

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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

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: 1

🧹 Outside diff range and nitpick comments (2)
tests/localosmosis/README.md (2)

101-104: Add specific build command instruction.

While adding the build prerequisite is helpful, it would be more user-friendly to include the specific command needed to build the binary.

Consider adding the actual build command, for example:

-     On version X, build binary and run:
+     On version X, build the binary using `make build` and then run:

107-109: Fix typo and enhance version compatibility guidance.

There's a typo in "exmaple" and the explanation could benefit from additional clarity about version compatibility.

Consider this revision:

-      where vXX indicates the next version that mainnet needs to be upgraded to. For exmaple when current mainnet state is at v26, the flag value should be `--trigger-testnet-upgrade=v27`.
+      where vXX indicates the next version that mainnet needs to be upgraded to. For example, when current mainnet state is at v26, the flag value should be `--trigger-testnet-upgrade=v27`. Ensure that your local repository supports the target upgrade version.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9e46748 and a105f2a.

📒 Files selected for processing (1)
  • tests/localosmosis/README.md (2 hunks)
🧰 Additional context used
🪛 Markdownlint
tests/localosmosis/README.md

123-123: null
Bare URL used

(MD034, no-bare-urls)


123-123: null
Bare URL used

(MD034, no-bare-urls)

Comment on lines +122 to +124

The settings for in place testnet are done in https://github.com/osmosis-labs/osmosis/blob/bb7a94e2561cc63b60ee76ec71a3e04e9688b22c/app/app.go#L773. Modify the parameters in `InitOsmosisAppForTestnet` to modify in place testnet parameters. For example, if you were to modify epoch hours, you would be modifying https://github.com/osmosis-labs/osmosis/blob/bb7a94e2561cc63b60ee76ec71a3e04e9688b22c/app/app.go#L942-L967 .

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve documentation links for long-term maintainability.

The current implementation uses bare URLs and links to a specific commit hash, which could become outdated. Additionally, the links should be properly formatted for markdown.

Consider this revision:

-The settings for in place testnet are done in https://github.com/osmosis-labs/osmosis/blob/bb7a94e2561cc63b60ee76ec71a3e04e9688b22c/app/app.go#L773. Modify the parameters in `InitOsmosisAppForTestnet` to modify in place testnet parameters. For example, if you were to modify epoch hours, you would be modifying https://github.com/osmosis-labs/osmosis/blob/bb7a94e2561cc63b60ee76ec71a3e04e9688b22c/app/app.go#L942-L967 .
+The settings for in-place testnet are configured in the [`InitOsmosisAppForTestnet`](../../app/app.go) function. You can modify various testnet parameters in this function. For example, epoch hours can be adjusted in the `epochs` section of the same file.

This change:

  1. Uses relative links that are more maintainable
  2. Removes dependency on specific line numbers that might change
  3. Follows proper markdown link syntax
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The settings for in place testnet are done in https://github.com/osmosis-labs/osmosis/blob/bb7a94e2561cc63b60ee76ec71a3e04e9688b22c/app/app.go#L773. Modify the parameters in `InitOsmosisAppForTestnet` to modify in place testnet parameters. For example, if you were to modify epoch hours, you would be modifying https://github.com/osmosis-labs/osmosis/blob/bb7a94e2561cc63b60ee76ec71a3e04e9688b22c/app/app.go#L942-L967 .
The settings for in-place testnet are configured in the [`InitOsmosisAppForTestnet`](../../app/app.go) function. You can modify various testnet parameters in this function. For example, epoch hours can be adjusted in the `epochs` section of the same file.
🧰 Tools
🪛 Markdownlint

123-123: null
Bare URL used

(MD034, no-bare-urls)


123-123: null
Bare URL used

(MD034, no-bare-urls)

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)
tests/localosmosis/README.md (2)

101-109: Enhance clarity of build and upgrade instructions.

The instructions could be more specific:

  1. Add the actual build command (make build or equivalent)
  2. Add a comma after "For example"
  3. Consider providing a concrete example with actual version numbers for better clarity

Apply this diff:

-On version X, build binary and run:
+On version X, build the binary using `make build` and then run:

 ```bash
 osmosisd in-place-testnet localosmosis osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj --trigger-testnet-upgrade=vXX

-where vXX indicates the next version that mainnet needs to be upgraded to. For example when current mainnet state is at v26, the flag value should be --trigger-testnet-upgrade=v27.
+where vXX indicates the next version that mainnet needs to be upgraded to. For example, if the current mainnet state is at v26 and you want to test the v27 upgrade, use --trigger-testnet-upgrade=v27.


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

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

[typographical] ~107-~107: After the expression ‘for example’ a comma is usually used.
Context: ...at mainnet needs to be upgraded to. For example when current mainnet state is at v26, t...

(COMMA_FOR_EXAMPLE)

</details>

</details>

---

`122-131`: **Improve clarity of log noise reduction instructions.**

The section could benefit from:
1. Adding a language specifier to the code block
2. Providing the exact content for the empty JSON file
3. Better formatting of the log example

Apply these improvements:

```diff
 ### Removing unnecessary log lines 
 Running in-place-testnet would be resulting in noise in the log lines that looks something like this.
-```
+```json
 {"level": "info", "module": "server", "module": "consensus", "err": "cannot find validator 122 in valSet of size 1: invalid valid ator index", "time": "2024-10-21T21:34:30Z" ,"message": "failed attempting to add vote"} {"level": "error" , "module": "server", "module":" consensus" ,"height" :22731539, "round" :0, "peer": "27e14df66c9e4cd6b176b@dcabadfa 96750f911", "msg_type": "*consensus. VoteMessage", "err": "error adding vote", "time": "2024-10-21T21:34:307","message":"failed to process message"} {"level": "info" ,"module": "server"
 ', "module": "consensus", "err": "cannot find validator 107 in valSet of size 1: invalid valid
 ator index", "time": "2024-10-21T21:34:30Z", "message": "failed attempting to add vote"}

-To remove the noise, remove existing addrbook.json from config folder, and replace it with an empty json.
+To remove the noise, remove the existing addrbook.json from the config folder, and replace it with a new file containing an empty JSON object:
+
+json +{} +


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

<details>
<summary>🪛 Markdownlint</summary>

124-124: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

</blockquote></details>

</blockquote></details>

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

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**

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

Reviewing files that changed from the base of the PR and between a105f2a93930e4cea4dbc944d5d30f513e1021fc and f3f78bfdfccbfc62c606fc60ae2cfa2762172ac9.

</details>

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

* `tests/localosmosis/README.md` (2 hunks)

</details>

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

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

<details>
<summary>tests/localosmosis/README.md</summary>

[typographical] ~107-~107: After the expression ‘for example’ a comma is usually used.
Context: ...at mainnet needs to be upgraded to. For example when current mainnet state is at v26, t...

(COMMA_FOR_EXAMPLE)

</details>

</details>
<details>
<summary>🪛 Markdownlint</summary>

<details>
<summary>tests/localosmosis/README.md</summary>

134-134: null
Bare URL used

(MD034, no-bare-urls)

---

134-134: null
Bare URL used

(MD034, no-bare-urls)

---

124-124: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (1)</summary>

<details>
<summary>tests/localosmosis/README.md (1)</summary>

`132-135`: **Skip comment generation.**

The existing review comment about improving documentation links is still valid and covers all necessary improvements.

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

<details>
<summary>🪛 Markdownlint</summary>

134-134: null
Bare URL used

(MD034, no-bare-urls)

---

134-134: null
Bare URL used

(MD034, no-bare-urls)

</details>

</details>

</details>

</details>

</details>

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

Copy link
Collaborator

@PaddyMc PaddyMc left a comment

Choose a reason for hiding this comment

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

❤️

Copy link
Contributor

@alessandrolomanto alessandrolomanto left a comment

Choose a reason for hiding this comment

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

Hey Matt, since you are working on it, I would like to specify this:

Set up a mainnet node, allowing it to start and sync a few blocks. Then, stop it at the desired height where you want to fork the network.

But everything you added looks good to me!

@PaddyMc PaddyMc closed this Nov 10, 2024
@PaddyMc PaddyMc reopened this Nov 10, 2024
@PaddyMc PaddyMc closed this Nov 11, 2024
@PaddyMc PaddyMc reopened this Nov 11, 2024
@mattverse mattverse merged commit e942fde into main Nov 13, 2024
1 check passed
@mattverse mattverse deleted the mattverse/docs-s branch November 13, 2024 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:no-changelog C:docs Improvements or additions to documentation V:state/compatible/no_backport State machine compatible PR, depends on prior breaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants