Skip to content

Avoid Hypergeometric calculation at runtime #1560

Open

Description

Is your feature request related to a problem?

Hypergeometric distribution is an algorithm determining how many nodes need to validate a transaction having X nodes in the network.
For example, running the algo with 2000 nodes return 187 nodes.
The issue with this algo is that it can takes some times to compute. On my PC it takes 5.3 sec to run for 10 000 nodes.

Describe the solution you'd like

The algorithm return a value between 1 and 197 and for different value it can returns the same result, we could just create a mapping function.
For example if number of node is in the range 1848..2049 then it return 187.
This would avoid heavy calculation as well as calling C program at runtime

Additional context

No response

Epic

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions