Commit e85c045
committed
fix(collector): validate offer terms against deadline, not block.timestamp
Collection-window and duration checks now use the offer's acceptance
deadline as the reference point instead of `block.timestamp`, making
validation time-independent: if terms pass here they remain valid for
any acceptance on or before `deadline`. Callers still enforce
`block.timestamp <= deadline` at the acceptance entry point.
- `_requireValidCollectionWindowParams` takes a `_deadline` parameter
and becomes `pure`. `_endsAt > block.timestamp` becomes
`_deadline < _endsAt`; `_endsAt - block.timestamp >= min + WINDOW`
becomes `min + WINDOW <= _endsAt - _deadline`.
- `_requireValidTerms` propagates `_deadline` to the window check.
- Accept/update call sites pass the RCA/RCAU deadline.
- Interface: replace `RecurringCollectorAgreementElapsedEndsAt` with
`RecurringCollectorAgreementEndsBeforeDeadline(deadline, endsAt)`.
Prerequisite for hash-keyed terms storage, where a single stored hash
must remain validatable without re-checking against wall clock on every
read.1 parent 1ce36ab commit e85c045
3 files changed
Lines changed: 30 additions & 22 deletions
File tree
- packages
- horizon
- contracts/payments/collectors
- test/unit/payments/recurring-collector
- interfaces/contracts/horizon
Lines changed: 19 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
812 | | - | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
813 | 817 | | |
814 | 818 | | |
815 | 819 | | |
816 | 820 | | |
817 | 821 | | |
| 822 | + | |
818 | 823 | | |
819 | 824 | | |
820 | 825 | | |
821 | | - | |
822 | | - | |
823 | | - | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
824 | 829 | | |
825 | 830 | | |
826 | 831 | | |
| |||
833 | 838 | | |
834 | 839 | | |
835 | 840 | | |
836 | | - | |
| 841 | + | |
837 | 842 | | |
838 | | - | |
| 843 | + | |
839 | 844 | | |
840 | 845 | | |
841 | | - | |
| 846 | + | |
842 | 847 | | |
843 | 848 | | |
844 | 849 | | |
845 | 850 | | |
846 | 851 | | |
847 | 852 | | |
848 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
849 | 856 | | |
850 | 857 | | |
851 | 858 | | |
| |||
854 | 861 | | |
855 | 862 | | |
856 | 863 | | |
| 864 | + | |
857 | 865 | | |
858 | 866 | | |
859 | 867 | | |
860 | 868 | | |
861 | 869 | | |
862 | 870 | | |
863 | 871 | | |
864 | | - | |
| 872 | + | |
865 | 873 | | |
866 | 874 | | |
867 | 875 | | |
| |||
1058 | 1066 | | |
1059 | 1067 | | |
1060 | 1068 | | |
1061 | | - | |
| 1069 | + | |
1062 | 1070 | | |
1063 | 1071 | | |
1064 | 1072 | | |
| |||
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
| 319 | + | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
0 commit comments