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

fix: fix incompatible type of priv_validator_raddrs #767

Closed 170210 closed 8 months ago

170210 commented 8 months ago

Description

This PR fix incompatible type of priv_validator_raddrs in TOML The PrivValidatorRemoteAddresses was defined as string array, while the priv_validator_raddrs was of a string type rather than a slice type, which creates a mismatch with the structure of the configuration after parsing the toml file. Related #692 & #707

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 66.54%. Comparing base (fc54d22) to head (4ca0270). Report is 3 commits behind head on main.

:exclamation: Current head 4ca0270 differs from pull request most recent head 01814c0. Consider uploading reports for the commit 01814c0 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #767 +/- ## ========================================== - Coverage 66.58% 66.54% -0.04% ========================================== Files 285 285 Lines 37919 37914 -5 ========================================== - Hits 25248 25231 -17 - Misses 10871 10881 +10 - Partials 1800 1802 +2 ``` | [Files](https://app.codecov.io/gh/Finschia/ostracon/pull/767?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) | Coverage Δ | | |---|---|---| | [config/config.go](https://app.codecov.io/gh/Finschia/ostracon/pull/767?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-Y29uZmlnL2NvbmZpZy5nbw==) | `79.36% <ø> (ø)` | | | [config/toml.go](https://app.codecov.io/gh/Finschia/ostracon/pull/767?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-Y29uZmlnL3RvbWwuZ28=) | `74.19% <ø> (ø)` | | | [privval/internal/ip\_filter.go](https://app.codecov.io/gh/Finschia/ostracon/pull/767?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-cHJpdnZhbC9pbnRlcm5hbC9pcF9maWx0ZXIuZ28=) | `68.00% <ø> (-2.38%)` | :arrow_down: | | [privval/internal/null\_object\_filter.go](https://app.codecov.io/gh/Finschia/ostracon/pull/767?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-cHJpdnZhbC9pbnRlcm5hbC9udWxsX29iamVjdF9maWx0ZXIuZ28=) | `100.00% <ø> (ø)` | | ... and [11 files with indirect coverage changes](https://app.codecov.io/gh/Finschia/ostracon/pull/767/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia)
ulbqb commented 8 months ago

Is it ok not to change parsing process although you change toml format?

https://github.com/Finschia/ostracon/blob/ae67c39c8a79827fc0aeeddf86f64bdbf193cbf4/privval/internal/ip_filter_test.go#L132-L135

https://github.com/Finschia/ostracon/blob/ae67c39c8a79827fc0aeeddf86f64bdbf193cbf4/privval/internal/ip_filter.go#L29-L31

And old processes are left.

170210 commented 8 months ago

Is it ok not to change parsing process although you change toml format?

https://github.com/Finschia/ostracon/blob/ae67c39c8a79827fc0aeeddf86f64bdbf193cbf4/privval/internal/ip_filter.go#L29-L31 I checked currently main branch and #707, this function hasn't been used yet (only used in test), so I think we just need to delete it.

ulbqb commented 8 months ago

Is it ok not to change parsing process although you change toml format?

170210 commented 8 months ago

Is it ok not to change parsing process although you change toml format?

@ulbqb I think it is ok because after parsing with viper, it is read in as an array. https://github.com/Finschia/ostracon/blob/ae67c39c8a79827fc0aeeddf86f64bdbf193cbf4/config/config.go#L253

ulbqb commented 8 months ago

I checked currently main branch and https://github.com/Finschia/ostracon/pull/707, this function hasn't been used yet (only used in test), so I think we just need to delete it.

Sorry, this is for Stringer interface so needed.