Commit 33a202d
perf(entry-requirement): drop redundant entries_left cross-call (#109)
* perf(entry-requirement): drop redundant entries_left cross-call
The extension branch of update_qualification_entries dispatched a second
cross-contract call into the validator's entries_left just to assert > 0.
For validators with expensive view paths (Opus walks user troves end-to-end
twice) this duplicated the work valid_entry already performed.
The IEntryRequirementExtension contract is now: valid_entry MUST enforce
both eligibility and remaining-entry quota. The framework trusts that
single signal on the entry path. entries_left remains for off-chain
consumers. See companion PR in metagame_extensions for matching docs and
the in-tree validators that now bundle quota.
Updates the three update_qualification_entries extension-path tests to
assert no-op behavior (previously they asserted on the entries_left
panic, which has been removed).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* style: scarb fmt — move comment to fn doc
scarb fmt collapses comments inside an empty match-arm body onto the same line
as the braces. Moving the explanation up to the fn doc keeps it readable and
keeps the formatter happy.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 82b9ce5 commit 33a202d
2 files changed
Lines changed: 24 additions & 69 deletions
File tree
- packages/metagame/src/entry_requirement
- tests
Lines changed: 8 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 200 | + | |
223 | 201 | | |
224 | 202 | | |
225 | 203 | | |
| |||
Lines changed: 16 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
643 | | - | |
644 | | - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
645 | 647 | | |
646 | 648 | | |
647 | 649 | | |
| |||
657 | 659 | | |
658 | 660 | | |
659 | 661 | | |
660 | | - | |
661 | 662 | | |
662 | 663 | | |
663 | 664 | | |
664 | 665 | | |
665 | 666 | | |
666 | 667 | | |
667 | 668 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
698 | 672 | | |
699 | 673 | | |
700 | 674 | | |
| |||
717 | 691 | | |
718 | 692 | | |
719 | 693 | | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
724 | 699 | | |
725 | 700 | | |
726 | 701 | | |
| |||
733 | 708 | | |
734 | 709 | | |
735 | 710 | | |
736 | | - | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
737 | 714 | | |
738 | 715 | | |
739 | 716 | | |
| |||
0 commit comments