Commit f763ff6
* Prevents max unbonding chunk slots from being filled when unbonding in the staking pallet
* hardcode num_slashing to unlock chunks automatically
* refactor withdraw logic to do_withdraw; idiomatic rust improvements
* a
* callable unbond() to return a DispatchWithPostInfo to dynamically update the consumed weight
* refunds overpaid fees when unbond with withdraw
* fetches real slashing spans before withdrawal call
* nits
* addresses PR comments
* Adds more testing
* fixes doc comments
* Fixes weight refunding logic for fn unbond
* generalizes to return used weight or dispatch error
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Addresses PR comments
* Add comment to speculative num spans
* adds missing add_slashing_spans in withdraw_unbonded_kill benchmarks
* ".git/.scripts/bench-bot.sh" pallet dev pallet_staking
* fix publish
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: command-bot <>
1 parent cd2fdcf commit f763ff6
File tree
6 files changed
+321
-238
lines changed- frame
- nomination-pools/src
- staking/src
- pallet
6 files changed
+321
-238
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1644 | 1644 | | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | | - | |
1648 | | - | |
1649 | | - | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
1650 | 1653 | | |
1651 | 1654 | | |
1652 | 1655 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
95 | 134 | | |
96 | 135 | | |
97 | 136 | | |
| |||
1568 | 1607 | | |
1569 | 1608 | | |
1570 | 1609 | | |
| 1610 | + | |
| 1611 | + | |
1571 | 1612 | | |
1572 | 1613 | | |
1573 | 1614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | | - | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
| |||
953 | 956 | | |
954 | 957 | | |
955 | 958 | | |
956 | | - | |
957 | | - | |
| 959 | + | |
| 960 | + | |
958 | 961 | | |
959 | 962 | | |
960 | 963 | | |
| |||
963 | 966 | | |
964 | 967 | | |
965 | 968 | | |
966 | | - | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
967 | 972 | | |
968 | 973 | | |
969 | 974 | | |
970 | | - | |
| 975 | + | |
971 | 976 | | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
972 | 994 | | |
| 995 | + | |
| 996 | + | |
973 | 997 | | |
974 | 998 | | |
975 | 999 | | |
976 | 1000 | | |
977 | 1001 | | |
978 | | - | |
979 | | - | |
980 | 1002 | | |
981 | 1003 | | |
982 | 1004 | | |
| |||
1024 | 1046 | | |
1025 | 1047 | | |
1026 | 1048 | | |
1027 | | - | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1028 | 1057 | | |
1029 | 1058 | | |
1030 | 1059 | | |
| |||
1049 | 1078 | | |
1050 | 1079 | | |
1051 | 1080 | | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | 1081 | | |
1085 | | - | |
| 1082 | + | |
| 1083 | + | |
1086 | 1084 | | |
1087 | 1085 | | |
1088 | 1086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1350 | 1350 | | |
1351 | 1351 | | |
1352 | 1352 | | |
1353 | | - | |
| 1353 | + | |
1354 | 1354 | | |
1355 | 1355 | | |
1356 | 1356 | | |
1357 | 1357 | | |
1358 | | - | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
1359 | 1361 | | |
1360 | 1362 | | |
1361 | 1363 | | |
| |||
1365 | 1367 | | |
1366 | 1368 | | |
1367 | 1369 | | |
1368 | | - | |
1369 | | - | |
| 1370 | + | |
| 1371 | + | |
1370 | 1372 | | |
1371 | 1373 | | |
1372 | | - | |
| 1374 | + | |
1373 | 1375 | | |
1374 | 1376 | | |
1375 | | - | |
1376 | | - | |
1377 | 1377 | | |
1378 | | - | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
1379 | 1410 | | |
1380 | 1411 | | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
1381 | 1415 | | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | 1416 | | |
1386 | | - | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
1387 | 1420 | | |
1388 | | - | |
1389 | 1421 | | |
1390 | 1422 | | |
1391 | 1423 | | |
| |||
0 commit comments