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

perf(types): Speedup valset.GetByAddress by noticing we do not need t… (backport #95) #96

Merged
merged 2 commits into from
Jun 3, 2024

Commits on Jun 3, 2024

  1. perf(types): Speedup valset.GetByAddress by noticing we do not need t…

    …o copy the validator object (cometbft#3129)
    
    Speedup valset.GetByAddress by noticing we do not need to copy the
    validator object in ~every single usage, as it operates on read-only
    instances.
    
    This acts as a very small speedup to ValidateBlock, and calculating
    statistics for enter prevote. In the future we can change data
    structures for bigger impact.
    
    If we think this needs more tests to feel comfortable, I think we should
    close this PR. Was a driveby change, and there are more impactful things
    we can do
    
    <!--
    
    Please add a reference to the issue that this PR addresses and indicate
    which
    files are most critical to review. If it fully addresses a particular
    issue,
    please include "Closes #XXX" (where "XXX" is the issue number).
    
    If this PR is non-trivial/large/complex, please ensure that you have
    either
    created an issue that the team's had a chance to respond to, or had some
    discussion with the team prior to submitting substantial pull requests.
    The team
    can be reached via GitHub Discussions or the Cosmos Network Discord
    server in
    the #cometbft channel. GitHub Discussions is preferred over Discord as
    it
    allows us to keep track of conversations topically.
    https://github.com/cometbft/cometbft/discussions
    
    If the work in this PR is not aligned with the team's current
    priorities, please
    be advised that it may take some time before it is merged - especially
    if it has
    not yet been discussed with the team.
    
    See the project board for the team's current priorities:
    https://github.com/orgs/cometbft/projects/1
    
    -->
    
    ---
    
    - [ ] Tests written/updated
    - [ ] Changelog entry added in `.changelog` (we use
    [unclog](https://github.com/informalsystems/unclog) to manage our
    changelog)
    - [x] Updated relevant documentation (`docs/` or `spec/`) and code
    comments
    - [x] Title follows the [Conventional
    Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
    
    ---------
    
    Co-authored-by: Andy Nogueira <[email protected]>
    (cherry picked from commit 2e0a6db)
    ValarDragon authored and mergify[bot] committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    643cdf0 View commit details
    Browse the repository at this point in the history
  2. Add changelog

    (cherry picked from commit f7684c5)
    ValarDragon authored and mergify[bot] committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    cc4d1bb View commit details
    Browse the repository at this point in the history