maturity pemilih baru diukur dari first_seen_at (V52/B15): last_vote terkuantisasi pekan (stake2vote) membuat voter baru Senin–Kamis tampak matang → lolos wait 3-hari ; BARU = first_seen baru/NULL, VALID = first_seen matang ; dashboard + distribusi konsisten ; image web+dist rebuild + push

This commit is contained in:
proitlab committed 2026-08-08 00:46:11 +07:00
1 parent 9b040a8c71
commit d6a15a07ae
6 files changed
+106 -89

No files matched your search

+12 -10
View File
@@ -29,12 +29,15 @@ VEX_PREC = Decimal('0.0001')
def _eligible_cutoffs():
"""V40/V42: jendela reward = vote matang s/d segar: `now − STALE < last_vote ≤
now − MATURITY` (UTC-naive, konsisten dgn stempel `last_vote` dari scan).
Pemilih baru (< VEX_MATURITY_DAYS) & basi (> VEX_STALE_DAYS) ⊥ dibayar.
V42: pemilih yang SUDAH PERNAH terlihat (REVOTE, `first_seen ≤ now −
MATURITY`) dianggap VALID langsung — ⊥ tunggu masa matang; hanya pemilih
baru (first_seen tak ada / < MATURITY lalu) yang harus matang dulu."""
"""V40/V52: jendela reward = `last_vote > now−STALE` (⊥ basi) DAN akun
MATANG (`first_seen_at ≤ now−MATURITY`).
V52: maturity diukur dari `first_seen_at` (stempel scan presisi detik),
BUKAN `last_vote` yang terkuantisasi pekan (stake2vote) — voter baru yang
vote Senin–Kamis tampak 4–6 hari ⇒ lolos maturity 3-hari tanpa menunggu
(B15). Pemilih BARU (`first_seen` NULL/`> now−MATURITY`) ⊖ dibayar; akun
yang sudah terlihat ≥ `VEX_MATURITY_DAYS` lalu (REVOTE) dibayar langsung.
"""
now = datetime.now(timezone.utc).replace(tzinfo=None)
stale_cutoff = (now - timedelta(days=VEX_STALE_DAYS)).isoformat(timespec='seconds')
mature_cutoff = (now - timedelta(days=VEX_MATURITY_DAYS)).isoformat(timespec='seconds')
@@ -149,10 +152,9 @@ def run_distribution(dry_run=False):
'SELECT v.owner, v.staked FROM voters v '
'LEFT JOIN voter_first_seen fs ON fs.owner = v.owner '
'WHERE v.last_vote > %s '
' AND (v.last_vote <= %s '
' OR (fs.first_seen_at IS NOT NULL '
' AND fs.first_seen_at <= %s))',
[stale_cutoff, mature_cutoff, mature_cutoff])
' AND fs.first_seen_at IS NOT NULL '
' AND fs.first_seen_at <= %s',
[stale_cutoff, mature_cutoff])
if not voters:
print('Tidak ada pemilih matang & segar tersimpan — no-op.', flush=True)
return 0