Finschia / ostracon

Ostracon, a consensus algorithm, is forked from Tendermint Core. We have added VRF to Tendermint BFT. It adds randomness to PoS Validator elections and improves security.
Apache License 2.0
70 stars 28 forks source link

Add entropy correctness test #565

Closed ulbqb closed 1 year ago

ulbqb commented 1 year ago

Description

PR #559 adds Entropy to Block and says that Entropy is single at every height. But that was not tested. So this PR adds a test that checks Entropy is single in every height. The following items need to be confirmed:

Closes: #XXX

codecov[bot] commented 1 year ago

Codecov Report

Merging #565 (413d63a) into main (7ca9a20) will increase coverage by 0.01%. The diff coverage is n/a.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #565 +/- ## ========================================== + Coverage 66.07% 66.08% +0.01% ========================================== Files 278 277 -1 Lines 36999 36946 -53 ========================================== - Hits 24446 24416 -30 + Misses 10791 10773 -18 + Partials 1762 1757 -5 ``` | [Impacted Files](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line) | Coverage Δ | | |---|---|---| | [crypto/sr25519/pubkey.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-Y3J5cHRvL3NyMjU1MTkvcHVia2V5Lmdv) | `35.89% <0.00%> (-7.70%)` | :arrow_down: | | [p2p/switch.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-cDJwL3N3aXRjaC5nbw==) | `65.08% <0.00%> (-1.45%)` | :arrow_down: | | [p2p/pex/pex\_reactor.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-cDJwL3BleC9wZXhfcmVhY3Rvci5nbw==) | `79.67% <0.00%> (-0.62%)` | :arrow_down: | | [light/client.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-bGlnaHQvY2xpZW50Lmdv) | `72.79% <0.00%> (ø)` | | | [blockchain/v0/pool.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-YmxvY2tjaGFpbi92MC9wb29sLmdv) | `79.58% <0.00%> (ø)` | | | [proxy/multi\_app\_conn.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-cHJveHkvbXVsdGlfYXBwX2Nvbm4uZ28=) | `47.66% <0.00%> (ø)` | | | [libs/rand/sampling.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-bGlicy9yYW5kL3NhbXBsaW5nLmdv) | | | | [consensus/reactor.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-Y29uc2Vuc3VzL3JlYWN0b3IuZ28=) | `74.97% <0.00%> (+0.26%)` | :arrow_up: | | [types/block.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-dHlwZXMvYmxvY2suZ28=) | `79.58% <0.00%> (+0.36%)` | :arrow_up: | | [p2p/conn/connection.go](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line#diff-cDJwL2Nvbm4vY29ubmVjdGlvbi5nbw==) | `80.38% <0.00%> (+0.57%)` | :arrow_up: | | ... and [6 more](https://codecov.io/gh/line/ostracon/pull/565?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=line) | |
torao commented 1 year ago

Just the wording, but "uniqueness" asserts that "never duplicates" (i.e. can be used for such as primary keys or node ids); verification and correctness seem better in terms of Entropy's behaviour and this test.

ulbqb commented 1 year ago

Just the wording, but "uniqueness" asserts that "never duplicates" (i.e. can be used for such as primary keys or node ids); verification and correctness seem better in terms of Entropy's behaviour and this test.

@torao I see. I'll use "correctness" or "single" instead of "uniqueness".