T56: jeda antar kirim distribusi (V63) — DISTRIBUTE_SEND_DELAY (default 30s) ANTAR pemilih di send-loop, N pemilih → N−1 tidur (⊥ setelah terakhir), real-run saja (dry-run ⊖ tidur); beri node/Hyperion waktu mengejar indeks + meratakan beban broadcast
This commit is contained in:
1 parent
efd0e9374b
commit
5c1c7572d3
5 files changed
+41
-2
No files matched your search
+11
-2
@@ -9,6 +9,8 @@ sebagai `pending` SEBELUM kirim (V21). Retry hanya baris `failed`; sebelum
|
||||
resend, txid diverifikasi di Hyperion agar transfer yang sempat mendarat tak
|
||||
terkirim ganda (V22). `--dry-run` menampilkan rencana tanpa tanda tangan
|
||||
(V26). Tidak ada freezing/carryover (V24): tiap run menghitung ulang segar.
|
||||
V63: send-loop tidur `DISTRIBUTE_SEND_DELAY` (default 30s) ANTAR pemilih —
|
||||
beri node/Hyperion waktu mengejar indeks + meratakan beban broadcast.
|
||||
"""
|
||||
|
||||
import sys
|
||||
@@ -21,7 +23,8 @@ import requests
|
||||
import db
|
||||
import telegram
|
||||
from config import (API_NODES, BP_PRIVATE_KEY, HYPERION_NODES,
|
||||
DISTRIBUTE_ENABLED, DISTRIBUTE_MAX_ATTEMPTS, TARGET_BP,
|
||||
DISTRIBUTE_ENABLED, DISTRIBUTE_MAX_ATTEMPTS,
|
||||
DISTRIBUTE_SEND_DELAY, TARGET_BP,
|
||||
TOKEN_CONTRACT, VEX_SYMBOL)
|
||||
|
||||
VEX_PREC = Decimal('0.0001')
|
||||
@@ -286,7 +289,7 @@ def run_distribution(dry_run=False):
|
||||
flush=True)
|
||||
failed = []
|
||||
sent_amount = 0.0
|
||||
for pid, owner, share in pending:
|
||||
for idx, (pid, owner, share) in enumerate(pending):
|
||||
txid = None
|
||||
for attempt in range(1, DISTRIBUTE_MAX_ATTEMPTS + 1):
|
||||
try:
|
||||
@@ -336,6 +339,12 @@ def run_distribution(dry_run=False):
|
||||
print(f'[GAGAL] {owner}: {share} VEX — {exc}', flush=True)
|
||||
break
|
||||
time.sleep(2)
|
||||
# V63: jeda ANTAR pemilih — beri node/Hyperion waktu mengejar indeks
|
||||
# + meratakan beban broadcast run panjang. N pemilih → N−1 tidur
|
||||
# (⊥ setelah pemilih terakhir); tetap jalan walau pemilih ini
|
||||
# ditahan/gagal (pacing seragam). Dry-run ⊖ pernah sampai sini.
|
||||
if idx < len(pending) - 1:
|
||||
time.sleep(DISTRIBUTE_SEND_DELAY)
|
||||
|
||||
status = 'ok' if not failed else 'partial'
|
||||
db.update_run_status(run_id, status, round(sent_amount, 4))
|
||||
|
||||
Reference in new issue
Block a user