Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Bump version to 1.0.0 globally #2149

Merged
merged 10 commits into from
Apr 1, 2019
Merged

Bump version to 1.0.0 globally #2149

merged 10 commits into from
Apr 1, 2019

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Mar 29, 2019

Also some minor changes to staking/phragmen:

  • Don't pass a Fn()->usize, only to always call it once: just pass a usize!
  • Rename rounds (which is incredibly opaque jargon taking from Phragmen's original context) to validator_count.
  • min_validator_count represents the minimum number of validators we need, not one-less, so we require the number of validators to be >= before we declare code-red, not >.
  • validator_count represents the ideal validator count. We only need to do candidate selection if we have more than that, so the comparison there should be >, not >=.
  • Update tests accordingly.

@gavofyork gavofyork changed the title Bump version globally Bump version to 1.0.0 globally Mar 29, 2019
@gavofyork gavofyork added the A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). label Mar 29, 2019
@gavofyork gavofyork added this to the 1.0 milestone Mar 29, 2019
@@ -109,9 +108,8 @@ pub fn elect<T: Trait + 'static, FR, FN, FV, FS>(
>>,
for <'r> FS: Fn(&'r T::AccountId) -> BalanceOf<T>,
{
let expand = |b: BalanceOf<T>| <T::CurrencyToVote as Convert<BalanceOf<T>, u64>>::convert(b) as ExtendedBalance;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @kianenigma : No extraneous whitespace within code.

minimum_validator_count: usize,
config: ElectionConfig<BalanceOf<T>>,
pub fn elect<T: Trait + 'static, FN, FV, FS>(
validator_count: usize,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename rounds to validator_count - to minimise use of jargon.

also wtf is this passing in a closure only to call it immediately?

Copy link
Contributor

@kianenigma kianenigma Apr 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the open discussions here. #1915 (comment)

I would personally not do that and pre-process the data in lib.rs and pass everything in as a vectors.

If you mean only validator_count; it was still a storage item and wanted to keep it consistent.

@gavofyork gavofyork requested a review from kianenigma April 1, 2019 09:06
@gavofyork gavofyork added A0-please_review Pull request needs code review. and removed A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). labels Apr 1, 2019
Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apologies for the typo fair. Rest looks ok. I would open a ticket to remove the closures compleatly. This could leas us into turning the phragmen impl a separate crate that is actually reusable, not something tailored to work with what the staking module is providing.

@gavofyork
Copy link
Member Author

done.

@gavofyork gavofyork merged commit d57202d into master Apr 1, 2019
@gavofyork gavofyork deleted the gav-v1.0.0 branch April 1, 2019 13:16
MTDK1 pushed a commit to bdevux/substrate that referenced this pull request Apr 12, 2019
* Bump versionb globally

* Rebuild and fix

* Rename fixes

* Rebuild

* Minor fix and code formatting for validator election

* Fix tests

* More test fixes

* Fix several bugs in phragmen elections.

* Rebuild, remove pointless closures
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants