-
Notifications
You must be signed in to change notification settings - Fork 680
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
Weight refunds for staking extrinsics potentially using SortedListProvider
#305
Comments
I came across this again while thinking about all of this. I think this is quite important, and we should do it before we deploy this on Polkadot. |
cc @emostov something for you to consider on the side. |
Might also be a good FRAME entry point for @rossbulat |
I am happy to be assigned this and play with the benchmarking. |
Looking closer, the only scenario for
As the above mentions, the other worst cases are that in the source bag the node is the tail or the node is a middle node with a prev and next pointer. This means that in any scenario where the node moves we will see the same count of read/writes for the operations related to the source bag. For the destination bag, the only cheaper scenario is that the bag does not already exist, which I hypothesize to be a relatively rare occurrence. With this in mind, I propose that If this approach sounds ok, I see 3 parts to implementing this, (which could be broken into separate PRs)
(Parts 1 and 2 are not dependent on each other) |
paritytech/substrate#9507 introduced the
SortedListProvider
for keeping an ordered list of nominators. For extrinsics using theSortedListProvider
this dramatically increased their worst case weight; in some cases though certain logic paths have dramatically less weight. Benchmarks should be updated to document less expensive code paths and give relevant refunds.(rel: paritytech/polkadot#3872 (comment))
The text was updated successfully, but these errors were encountered: