maxpool 1.24.33 → 1.24.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/outside-usage.js +8 -2
- package/src/prober.js +1 -1
package/package.json
CHANGED
package/src/outside-usage.js
CHANGED
|
@@ -73,10 +73,16 @@ export function zaiHourlyCalls(data) {
|
|
|
73
73
|
* [max(poolUpSince ceiled to the next hour, now - window), floor(now)).
|
|
74
74
|
* Returns {hours, zaiCalls, poolCalls, outside, from, to}; hours=0 when no
|
|
75
75
|
* complete hour is comparable yet (then outside is always false). */
|
|
76
|
-
export function compareOutsideUsage(zaiHours, poolHours, { now, poolUpSince, factor = OUTSIDE_FACTOR, minCalls = OUTSIDE_MIN_CALLS, windowHours = OUTSIDE_WINDOW_HOURS } = {}) {
|
|
76
|
+
export function compareOutsideUsage(zaiHours, poolHours, { now, poolUpSince, sinceMs = null, factor = OUTSIDE_FACTOR, minCalls = OUTSIDE_MIN_CALLS, windowHours = OUTSIDE_WINDOW_HOURS } = {}) {
|
|
77
77
|
const to = hourFloor(now);
|
|
78
78
|
const upFrom = Math.ceil(poolUpSince / HOUR) * HOUR; // first hour the pool saw in full
|
|
79
|
-
|
|
79
|
+
// A JUST-ADDED account (addedAt) may share its key with its previous owner —
|
|
80
|
+
// hours BEFORE the pool adopted it are that owner's usage, not a leak. Baseline
|
|
81
|
+
// the comparison at the later of pool-up and account-added (owner-shared keys,
|
|
82
|
+
// 2026-10-28: 3 accounts added at 10:04Z flagged "outside ×490" off Andrey's own
|
|
83
|
+
// overnight pool traffic).
|
|
84
|
+
const sinceFrom = sinceMs != null ? Math.ceil(sinceMs / HOUR) * HOUR : 0;
|
|
85
|
+
const from = Math.max(upFrom, sinceFrom, to - windowHours * HOUR);
|
|
80
86
|
let zaiCalls = 0, poolCalls = 0, hours = 0;
|
|
81
87
|
for (let h = from; h < to; h += HOUR) {
|
|
82
88
|
hours++;
|
package/src/prober.js
CHANGED
|
@@ -240,7 +240,7 @@ export class Prober {
|
|
|
240
240
|
}
|
|
241
241
|
account._outsideCheckedAt = now; // stamp AFTER success (R1.5)
|
|
242
242
|
const zai = zaiHourlyCalls(data);
|
|
243
|
-
const res = compareOutsideUsage(zai, account.poolHourly, { now, poolUpSince: this.am.poolUpSince });
|
|
243
|
+
const res = compareOutsideUsage(zai, account.poolHourly, { now, poolUpSince: this.am.poolUpSince, sinceMs: account.addedAt ?? null });
|
|
244
244
|
const prev = account.outsideUsage;
|
|
245
245
|
const wasOutside = Boolean(prev?.outside);
|
|
246
246
|
account.outsideUsage = { ...res, checkedAt: now };
|