Skip to content

Make one peer state mutex call in AddVote #3155

@ValarDragon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions