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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow privileged virtual bond in Staking pallet #3889
Allow privileged virtual bond in Staking pallet #3889
Changes from 7 commits
dda12d4
802784c
d2b680e
646c7f4
bc92a19
2528da7
4ddcb77
7104faf
aed693c
989bc50
6f05a52
264f71a
f9a52f1
58b50c9
b946c4a
0aa9006
d242356
8bd3bc3
fbccd0f
e46b01b
0e41b01
9079d82
616dfa7
afe8c87
e7d65e2
474c1de
6940f88
a884846
d4633c2
c013cde
ac3cadf
09d3359
e31866e
078cf5f
3790a40
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add the field saying that a ledger is virtual to the staking ledger, I'd add a debug_assert here to double checking that the ledger is in fact virtual.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit but I could see it being helpful in the future for traceability to distinguish ledger-related events that are virtual and non-virtual. Maybe we could add a field
virtual: bool
at very low cost.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue the distinction between virtual and non-virtual bonds should be made one level higher, as in an event from the entity doing the delegation should deposit a "virtual" event. At the staking pallet level, it probably doesn't matter whether the bonded funds are virtual or not, so long as they are bonded, but I don't feel too strongly about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally agree with @georgepisaltu more, but in general staking is already aware and leaking info about "virtual vs. not" in any case, so it is a bit of a lost cause :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated before, I think we could get rid of this extra storage map and add this info directly into the ledger. In any case, I'd remove this one-liner for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is already a corresponding event in delegated staking pallet, I am leaning towards leaving it as it is. A dapp can get all information they need by reading other pallet events as well.