failover pool Hyperion utk semua pembacaan /v2/* (V60)
verify_txid (distribute) ⊖ lagi single-host single-shot — blip Hyperion sesaat dulu menahan payout (V59 hold) / gagal ukur reward klaim / kosongkan SALDO LIQUID dashboard. config.py: HYPERION_NODES (CSV VEX_HYPERION_NODES, default HYPERION_API + API_NODES dedup, utama di depan — kedua host mainnet terverifikasi layani /v2, probe 2026-08-13) ; distribute._get_json GET mirror _post_json V58 (3 putaran, 2s, coba semua host per putaran, semua gagal → None) dipakai verify_txid — None kini berarti SEMUA host Hyperion gagal, hold V59 jarang palsu ; claim.reward_from_tx via dist._get_json (tiap attempt settle V55 pool-robust) ; dashboard._get_liquid_vex loop HYPERION_NODES lokal (web ⊖ impor distribute, V31), SALDO LIQUID tetap live saat host mati oracle: test_distribute V60 failover verify_txid + semua-mati None ; test_claim V60 reward_from_tx failover ; test_dashboard V60 saldo cadangan + config default HYPERION_NODES ; docs SPEC §V/V60 + §I + T53 + AGENTS + .env.example image web + dist + claim rebuild + push ; live smoke pool /v2/health
This commit is contained in:
1 parent
663770f51b
commit
69704fa23d
10 files changed
+159
-40
No files matched your search
@@ -93,6 +93,7 @@ def main():
|
||||
db.DB_PATH = os.path.join(tmp, 'test.db')
|
||||
_orig_query = db.query
|
||||
_orig_eligible = db.eligible_voters
|
||||
_orig_get = dist.requests.get # V60: restore utk oracle failover Hyperion
|
||||
# V40: stempel last_vote SEJAK SEKARANG (relatif) agar umur jatuh di band
|
||||
# VALID (3..28 hari) — stempel hardcode berumur <3 hari justru dibuang.
|
||||
fresh = (datetime.now() - timedelta(days=5)).isoformat(timespec='seconds')
|
||||
@@ -224,6 +225,28 @@ def main():
|
||||
setattr(pyntelope, _n, _saved[_n])
|
||||
dist.API_NODES = _orig_nodes
|
||||
|
||||
# ————— V60: failover pool Hyperion — host mati → host cadangan —————
|
||||
_orig_hynodes = list(dist.HYPERION_NODES)
|
||||
dist.time.sleep = lambda s: None
|
||||
dist.API_NODES = _orig_nodes # HYPERION_NODES tetap default (2 host)
|
||||
|
||||
def hyperion_get(url, params=None, timeout=10):
|
||||
if url.startswith('http://hyperion-dead'):
|
||||
raise dist.requests.RequestException('hyperion mati')
|
||||
return fake_post({'executed': True})
|
||||
|
||||
dist.requests.get = hyperion_get
|
||||
dist.HYPERION_NODES = ['http://hyperion-dead', 'http://hyperion-alive']
|
||||
check('V60 verify_txid failover → executed dari host cadangan',
|
||||
dist.verify_txid('tx1') is True)
|
||||
|
||||
dist.HYPERION_NODES = ['http://hyperion-dead']
|
||||
check('V60 semua host Hyperion mati → None (bukan False)',
|
||||
dist.verify_txid('tx1') is None)
|
||||
dist.HYPERION_NODES = _orig_hynodes
|
||||
dist.requests.get = _orig_get # restore (set di awal suite)
|
||||
dist.time.sleep = _orig_sleep
|
||||
|
||||
# ————— V20: compute_shares — floor 4 desimal, sisa tetap di akun —————
|
||||
shares = dist.compute_shares(Decimal('100.0000'),
|
||||
[('a', 300.0), ('b', 700.0)])
|
||||
|
||||
Reference in new issue
Block a user