T13: klamp last_vote heuristik ke waktu scan (⊥ di masa depan)

Unstake tanpa revote membuat rasio bobot/stake membesar → estimasi
last_vote melewati now. normalize() kini mengklamp ke now; voters.db
dikembalikan (27 baris, MAX(last_vote) ≤ MAX(scanned_at)). Oracle lolos.
This commit is contained in:
proitlab committed 2026-08-05 10:21:45 +07:00
1 parent 41990af9af
commit eb4f941b37
4 files changed
+17 -3

No files matched your search

+11
View File
@@ -147,6 +147,17 @@ def main():
'staked': 20000000,
'last_vote_weight': _fresh_weight(20000000)})['owner'] == 'new6')
# V13: estimasi yang melewati now (unstake tanpa revote) diklamp ke now
fixed_now = datetime(2026, 8, 5, 12, 0, 0)
t_future = ((fixed_now - gv.WEIGHT_EPOCH).days + 5) / 365.25
fut = gv.normalize({'owner': 'fut9', 'producers': [gv.TARGET_BP],
'staked': 20000000,
'last_vote_weight': f'{20000000 * 2 ** t_future:.17f}'},
now=fixed_now)
check('V13 last_vote masa depan diklamp ke now',
fut is not None
and fut['last_vote'] == fixed_now.isoformat(timespec='seconds'))
# V9: staked < 1000 VEX → dibuang; tepat 1000 → disimpan
check('V9 di bawah 1000 dibuang',
gv.normalize({'owner': 'low9', 'producers': [gv.TARGET_BP],