Commit b1ab8eb
committed
fix(contract): charge attestation storage by measured delta; fund e2e onboarding
The fixed MINIMUM_ATTESTATION_STORAGE_DEPOSIT floor rejected zero-deposit
submissions outright. Restore the pre-#3714 behavior: charge only the measured
storage delta and reject only when the attached deposit is below it. A
participant re-attesting an unchanged entry grows nothing, so it pays nothing
and its function-call key works; a new entry costs the measured delta, funded
by a deposit-capable caller.
In e2e, fund each new participant's first attestation before resharing, signed
with the node's near_signer_key so the stored account_public_key matches the key
the node later uses for key-event votes (an operator key would store the wrong
key and stall resharing). Add MpcNodeState::near_signer_key for this.
Repurpose the worst-case test to assert the entry cost stays under a bounded
ceiling, and regenerate the ABI snapshot.1 parent e7128f2 commit b1ab8eb
4 files changed
Lines changed: 79 additions & 39 deletions
File tree
- crates
- contract
- src
- tests
- sandbox
- snapshots
- e2e-tests/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | 120 | | |
126 | 121 | | |
127 | 122 | | |
| |||
161 | 156 | | |
162 | 157 | | |
163 | 158 | | |
164 | | - | |
165 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
166 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 175 | + | |
186 | 176 | | |
187 | 177 | | |
188 | 178 | | |
| |||
809 | 799 | | |
810 | 800 | | |
811 | 801 | | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
817 | 807 | | |
818 | 808 | | |
819 | 809 | | |
| |||
4674 | 4664 | | |
4675 | 4665 | | |
4676 | 4666 | | |
4677 | | - | |
| 4667 | + | |
4678 | 4668 | | |
4679 | 4669 | | |
4680 | 4670 | | |
| |||
8139 | 8129 | | |
8140 | 8130 | | |
8141 | 8131 | | |
8142 | | - | |
8143 | | - | |
8144 | | - | |
| 8132 | + | |
| 8133 | + | |
| 8134 | + | |
8145 | 8135 | | |
8146 | 8136 | | |
8147 | 8137 | | |
| |||
8155 | 8145 | | |
8156 | 8146 | | |
8157 | 8147 | | |
8158 | | - | |
| 8148 | + | |
8159 | 8149 | | |
8160 | 8150 | | |
8161 | 8151 | | |
| |||
8179 | 8169 | | |
8180 | 8170 | | |
8181 | 8171 | | |
8182 | | - | |
8183 | | - | |
8184 | | - | |
| 8172 | + | |
| 8173 | + | |
| 8174 | + | |
8185 | 8175 | | |
8186 | 8176 | | |
8187 | 8177 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1050 | 1050 | | |
1051 | 1051 | | |
1052 | 1052 | | |
1053 | | - | |
| 1053 | + | |
1054 | 1054 | | |
1055 | 1055 | | |
1056 | | - | |
| 1056 | + | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | 1059 | | |
| |||
1064 | 1064 | | |
1065 | 1065 | | |
1066 | 1066 | | |
1067 | | - | |
| 1067 | + | |
| 1068 | + | |
1068 | 1069 | | |
1069 | 1070 | | |
1070 | 1071 | | |
| |||
1073 | 1074 | | |
1074 | 1075 | | |
1075 | 1076 | | |
1076 | | - | |
| 1077 | + | |
1077 | 1078 | | |
1078 | 1079 | | |
1079 | 1080 | | |
1080 | 1081 | | |
1081 | 1082 | | |
1082 | 1083 | | |
1083 | 1084 | | |
1084 | | - | |
| 1085 | + | |
1085 | 1086 | | |
1086 | 1087 | | |
1087 | 1088 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2349 | 2349 | | |
2350 | 2350 | | |
2351 | 2351 | | |
2352 | | - | |
| 2352 | + | |
2353 | 2353 | | |
2354 | 2354 | | |
2355 | 2355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
559 | 563 | | |
560 | 564 | | |
561 | 565 | | |
| 566 | + | |
| 567 | + | |
562 | 568 | | |
563 | 569 | | |
564 | 570 | | |
| |||
611 | 617 | | |
612 | 618 | | |
613 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
614 | 656 | | |
615 | 657 | | |
616 | 658 | | |
| |||
1182 | 1224 | | |
1183 | 1225 | | |
1184 | 1226 | | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1185 | 1234 | | |
1186 | 1235 | | |
1187 | 1236 | | |
| |||
0 commit comments