This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Conversation
pepyakin
reviewed
Jun 27, 2018
| // Ok - all valid. | ||
|
|
||
| // update nominators_for | ||
| t.swap_remove(target_index); |
Contributor
There was a problem hiding this comment.
Just a question to refine my own understanding: isn't this will invalidate an index of the last nominator?
so for example, there are two calls:
unnominate(0, 0)unnominate(1, 1)
the second call will return an error Invalid target index because the first call invalidated the index of the nominator 1.
Member
Author
There was a problem hiding this comment.
yes - in that case, the second will be a no-op - they'll need to resubmit the tx. shit happens :)
pepyakin
reviewed
Jun 27, 2018
substrate/runtime/staking/src/lib.rs
Outdated
| //let r = Self::voting_balance(n) * reward / total; // correct formula, but might overflow with large reard * total. | ||
| let quant = T::Balance::sa(1usize << 31); | ||
| let s = (Self::voting_balance(n) * quant / total) * rem / quant; // avoid overflow by using quant as a denominator. | ||
| let _ = Self::slash(n, s); // will never fail as nominator accounts must be created, but even if it did, it's just a missed reward. |
Contributor
There was a problem hiding this comment.
wait a minute, we are not talking about rewards here : D
pepyakin
reviewed
Jun 27, 2018
| } | ||
|
|
||
| fn nominate(aux: &T::PublicAux, target: RawAddress<T::AccountId, T::AccountIndex>) -> Result { | ||
| let target = Self::lookup(target)?; |
Contributor
There was a problem hiding this comment.
I'm a validator. Can I nominate myself?
Contributor
There was a problem hiding this comment.
Is there any check that prevents this?
Member
Author
|
Review continues in the rebased #262 |
JoshOrndorff
added a commit
to moonbeam-foundation/substrate
that referenced
this pull request
Apr 21, 2021
* add debugging lines to author filter * some lines in author inherent * correct labels on debug lines * cargo fmt * silly typo * Separate inherent check into precheck and final check. * Revert de8951a (Remove relay block from author filter) * Bettter comment * Move dummy event handler to main module (not test module) * fix test harness * bump runtime version * Preapare embedded specs for network launch from instructions. https://purestake.atlassian.net/wiki/spaces/MOON/pages/1313013795/Generate+embedded+specs * prettier * Comment typos Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * re-enable author filter debugging event * more logs * Make cargo.lock the way I want (cargo will mess it up though) * 20 block rounds * Hack to fix Apps * Fix the actual bug * re-disable debugging event for ci * change logs to trace level * whitespace * line length * one more spec version bump. Gonna try an upgrade. I think it'll work. * embedded specs * Add author filter call, and another spec version bump * Revert block per round change * one version bump will do Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
liuchengxu
pushed a commit
to chainx-org/substrate
that referenced
this pull request
Aug 23, 2021
* no message * update orderpair * no message
liuchengxu
pushed a commit
to autonomys/substrate
that referenced
this pull request
Jun 3, 2022
Subspace networking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second part of #194 . Nothing special here, just added
nominateandunnominate, which roughly follow semantics ofstakeandunstake, except they nominate themselves to some other (potential) validator and share the reward.