Skip to content

Make one peer state mutex call in AddVote #3155

Closed
osmosis-labs/cometbft
#91

Description

@ValarDragon

Feature Request

Summary

There was a regression at some point, and now adding a vote makes 3 mutex locks and unlocks to peerstate: https://github.com/cometbft/cometbft/blob/v0.37.6/consensus/reactor.go#L348-L350

We should just make one method, that takes a lock once, and then does all the relevant operations. I don't have system impact benchmarks, as this 3 mutex-taking is not in v0.37.x

Proposal

Make one method that just takes the peerstate lock once and does all 3 internal functions

Activity

  1. added
    enhancement
    needs-triage
    on May 31, 2024
  2. added a commit that references this issue on Jun 3, 2024
    9d7c968
  3. added a commit that references this issue on Jun 3, 2024
    3cdc621
  4. added a commit that references this issue on Jun 3, 2024
    752d683
  5. modified the milestones: 2024-Q3, 2024-Q2 on Jul 2, 2024
  6. moved this from Todo to Done in CometBFTon Jul 2, 2024
  7. added a commit that references this issue on Jul 10, 2024
    e3e164c
  8. added a commit that references this issue on Jul 10, 2024
    0dae58e
  9. removed
    needs-triage
    on Jul 22, 2024
  10. added 2 commits that reference this issue on Sep 9, 2025
    4279425
    bed1403
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions