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

Problem: pre-estimate runs sequentially #1571

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Sep 12, 2024

Solution:

  • run in parallel with latest ethermint

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • New Features

    • Introduced a pre-estimation feature for block state transitions, enhancing benchmarking accuracy and performance.
  • Updates

    • Updated dependencies to their latest versions, potentially improving overall system performance and stability.

Solution:
- run in parallel with latest ethermint
Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

The pull request introduces changes across multiple files, primarily focusing on enabling a pre-estimation mechanism for block state transitions in benchmarking tests. The constant BlockSTMPreEstimate in app/bench_test.go is modified from false to true, impacting benchmarking behavior. Additionally, updates to dependency versions are made in go.mod and gomod2nix.toml, while a new configuration option is added in peer.py to support the pre-estimation feature.

Changes

File Change Summary
app/bench_test.go Modified BlockSTMPreEstimate constant from false to true.
go.mod Updated versions of github.com/crypto-org-chain/go-block-stm and github.com/evmos/ethermint.
gomod2nix.toml Updated versions and hashes for github.com/crypto-org-chain/go-block-stm and github.com/evmos/ethermint.
testground/benchmark/benchmark/peer.py Added "evm.block-stm-pre-estimate": True in the patch_configs function.

Possibly related PRs

  • Problem: block-stm has bad worst case performance #1570: The changes in this PR also involve the BlockSTMPreEstimate constant and its implications for performance, directly relating to the modifications made in the main PR regarding the benchmarking tests in app/bench_test.go.

Poem

In the meadow where bunnies play,
A constant changed, hooray, hooray!
Pre-estimate now takes the lead,
For smoother paths and faster speed.
With every hop, we cheer and sing,
For better tests, oh what joy they bring! 🐇✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a6c9d58 and 8a1d97e.

Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
Files selected for processing (4)
  • app/bench_test.go (1 hunks)
  • go.mod (2 hunks)
  • gomod2nix.toml (2 hunks)
  • testground/benchmark/benchmark/peer.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • gomod2nix.toml
Additional comments not posted (4)
testground/benchmark/benchmark/peer.py (1)

137-137: LGTM!

The added configuration option "evm.block-stm-pre-estimate": True enables the pre-estimation feature for the block state machine (block-stm) execution mode. This change aligns with the PR objective of running pre-estimate processes in parallel to address inefficiencies and potentially improve performance or accuracy in transaction processing.

The code change is straightforward, well-contained within the patch_configs function, and does not introduce any syntax or logical errors.

app/bench_test.go (1)

42-42: Verify the impact of enabling pre-estimation on benchmarking results and system performance.

The change to set BlockSTMPreEstimate to true enables pre-estimation of block state transitions during benchmarking. This could potentially enhance the accuracy or efficiency of the benchmarking process. However, it's important to carefully evaluate the impact of this change on the benchmarking results and overall system performance to ensure it aligns with the intended objectives.

To verify the impact of this change, consider the following:

  1. Run benchmarking tests with BlockSTMPreEstimate set to both true and false, and compare the results to assess the effect on performance metrics and execution paths.

  2. Analyze the benchmarking results to determine if enabling pre-estimation leads to more accurate or efficient outcomes, and if there are any potential trade-offs or unintended consequences.

  3. Monitor the system performance in a production-like environment with pre-estimation enabled to ensure it meets the expected performance requirements and does not introduce any performance regressions or stability issues.

By thoroughly evaluating the impact of this change through benchmarking tests and real-world performance monitoring, you can validate if enabling pre-estimation achieves the desired enhancements in accuracy and efficiency without compromising the overall system performance and stability.

go.mod (2)

99-99: LGTM!

The version update of the indirect dependency github.com/crypto-org-chain/go-block-stm is unlikely to introduce breaking changes. The pseudo-version format indicates a pre-release version, which typically includes bug fixes, performance improvements, or new features without major API changes.


278-278: LGTM!

The version update of the indirect dependency github.com/evmos/ethermint is unlikely to introduce breaking changes. The pseudo-version format indicates a pre-release version, which typically includes bug fixes, performance improvements, or new features without major API changes.


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

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

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.12%. Comparing base (a6c9d58) to head (8a1d97e).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1571   +/-   ##
=======================================
  Coverage   36.12%   36.12%           
=======================================
  Files          97       97           
  Lines        7725     7725           
=======================================
  Hits         2791     2791           
  Misses       4585     4585           
  Partials      349      349           

@yihuang yihuang marked this pull request as ready for review September 12, 2024 07:56
@yihuang yihuang requested a review from a team as a code owner September 12, 2024 07:56
@yihuang yihuang requested review from JayT106, leejw51crypto and mmsqe and removed request for a team September 12, 2024 07:56
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 (1)
gomod2nix.toml (1)

213-214: Provide more context on the dependency updates.

While the dependency updates seem valid, it would be helpful to include more information in the pull request description or commit message about the motivations behind these updates. Consider addressing questions such as:

  • What are the specific reasons for updating each dependency? Are there any known issues or limitations in the previous versions that are addressed by the updates?
  • Are there any new features, performance improvements, or bug fixes in the updated versions that are particularly relevant or beneficial to the project?
  • Have the release notes and changelogs of the updated dependencies been reviewed to understand the scope of changes and potential impact on the project?

Providing this additional context will help reviewers and future maintainers understand the rationale behind the dependency updates and assess their appropriateness more effectively.

Also applies to: 262-263

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a6c9d58 and 8a1d97e.

Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
Files selected for processing (4)
  • app/bench_test.go (1 hunks)
  • go.mod (2 hunks)
  • gomod2nix.toml (2 hunks)
  • testground/benchmark/benchmark/peer.py (1 hunks)
Additional comments not posted (5)
testground/benchmark/benchmark/peer.py (1)

137-137: LGTM!

The addition of the "evm.block-stm-pre-estimate": True configuration option in the patch_configs function aligns with the PR objective of enabling parallel execution of pre-estimate runs. This change is localized and does not introduce any apparent issues.

app/bench_test.go (1)

42-42: LGTM!

The change aligns with the PR objective of running pre-estimate processes in parallel to improve efficiency. Enabling pre-estimation for the block-stm executor can potentially improve the performance of ERC20 token transfer benchmarks.

To verify the impact of this change on benchmark performance, run the following commands:

Please share the benchmark results to confirm if enabling pre-estimation improves the performance as expected.

go.mod (1)

99-99: Dependency updates look good, but verify compatibility and test thoroughly.

The updates to the indirect dependencies github.com/crypto-org-chain/go-block-stm and github.com/evmos/ethermint seem reasonable as they bring in more recent commits. Updating dependencies is a good practice to incorporate bug fixes, performance improvements, and new features.

However, it's important to ensure that these updated versions are compatible with the project and don't introduce any breaking changes. I recommend the following:

  1. Carefully review the changelogs, release notes, or commit history of these dependencies to understand the changes introduced in the new versions.
  2. Verify that the updated dependencies don't have any known issues or incompatibilities with other parts of the project.
  3. Thoroughly test the project with these updated dependencies to ensure that everything works as expected and no new bugs or regressions are introduced.

If everything checks out, then these dependency updates should be good to merge.

Also applies to: 278-278

Verification successful

Dependency updates look good, but verify compatibility and test thoroughly.

The updates to the indirect dependencies github.com/crypto-org-chain/go-block-stm and github.com/evmos/ethermint have no open issues, which is a positive sign. However, given the extensive use of github.com/evmos/ethermint in the codebase, it's crucial to ensure that these updates do not introduce any breaking changes or regressions.

  • Carefully review the changelogs, release notes, or commit history of these dependencies.
  • Verify that the updated dependencies are compatible with the project.
  • Thoroughly test the project to ensure everything works as expected.

If everything checks out, these dependency updates should be good to merge.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash

# Check if the updated dependencies have any known issues or incompatibilities
echo "Checking github.com/crypto-org-chain/go-block-stm v0.0.0-20240912024944-1cd89976aa5e"
gh issue list --repo "https://github.com/crypto-org-chain/go-block-stm" --limit 10 --json title,url
echo "Checking github.com/evmos/ethermint v0.6.1-0.20240912060135-56f8a5be75ec"
gh issue list --repo "https://github.com/evmos/ethermint" --limit 10 --json title,url

# Search the codebase for any import statements or references to these dependencies 
echo "Searching for import statements and references to the updated dependencies..."
rg --type go --ignore-case "github.com/crypto-org-chain/go-block-stm|github.com/evmos/ethermint"

Length of output: 4637

gomod2nix.toml (2)

213-214: Approve updating github.com/crypto-org-chain/go-block-stm dependency version.

The update to the github.com/crypto-org-chain/go-block-stm dependency version and hash appears to be intentional and aligns with the project's requirements.

To ensure the updated dependency does not introduce any breaking changes or incompatibilities, consider running comprehensive tests that cover the usage of this dependency within the project. Pay special attention to any functionality that directly relies on or interacts with the updated package.


262-263: Approve updating github.com/evmos/ethermint dependency version.

The update to the github.com/evmos/ethermint dependency version and hash seems to be deliberate and necessary for the project.

To mitigate the risk of introducing issues with the updated dependency, it is recommended to thoroughly test the integration of the new version within the project. Focus on scenarios where the project code directly interacts with or depends on functionality provided by the github.com/evmos/ethermint package. Ensure that all relevant test cases pass and the overall system behaves as expected.

@yihuang yihuang added this pull request to the merge queue Sep 12, 2024
Merged via the queue into crypto-org-chain:main with commit af03b84 Sep 12, 2024
37 checks passed
@yihuang yihuang deleted the dep-analysis branch September 12, 2024 14:47
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.

2 participants