Skip to content

Delete usage of comet's libs/rand, make each gossip routine maintain its own rand instance. #3005

@ValarDragon

Description

@ValarDragon

Feature Request

Summary

CometBFT's libs/rand was always a really questionable choice that never made sense to me. (Documented from before the cosmos hub launch: tendermint/tendermint#2956 )

We should just delete all usage of our libs/rand, and make each gossiping thread maintain its own randomness instance. This will reduce mutex contention, and speedup core gossip routines.

Each rand instance has only 50% doing its actual rand operation. And we see lockSlow getting called, which per my understanding of the go runtime, means that this is actually a contended for mutex, hence this is justified.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds-triageThis issue/PR has not yet been triaged by the team.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions