From e2b803257ddd98b4371a0dd443ecbd535148e1fa Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Thu, 8 Oct 2026 16:26:17 +0000 Subject: [PATCH] observer: the subsidy and paid amounts as numeric, not bigint (the Igneum 2.0 chain reports them in wei: 9.52 IGN = 9522644482386090276, past int64; the dn4_ observer on build-1 dropped every block insert until the box copy was widened 17:25 BST) Co-Authored-By: Claude Fable 5.1 --- tools/observer/observer.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/observer/observer.mjs b/tools/observer/observer.mjs index fd445ef5e..5141e8800 100644 --- a/tools/observer/observer.mjs +++ b/tools/observer/observer.mjs @@ -109,6 +109,9 @@ async function setupSchema() { `ALTER TABLE ${TB} ADD COLUMN IF NOT EXISTS proof_records int`, `ALTER TABLE ${TB} ADD COLUMN IF NOT EXISTS subsidy_sompi bigint`, `ALTER TABLE ${TB} ADD COLUMN IF NOT EXISTS paid_sompi bigint`, + // wei-scale amounts on the Igneum 2.0 chain (8 Oct 2026): widen both in place, a no-op once numeric + `ALTER TABLE ${TB} ALTER COLUMN subsidy_sompi TYPE numeric(40,0)`, + `ALTER TABLE ${TB} ALTER COLUMN paid_sompi TYPE numeric(40,0)`, `ALTER TABLE ${TB} ADD COLUMN IF NOT EXISTS selected_parent text`, `ALTER TABLE ${TB} ADD COLUMN IF NOT EXISTS number bigint`, `ALTER TABLE ${TB} ADD COLUMN IF NOT EXISTS detail jsonb`, @@ -503,7 +506,8 @@ async function flushBlocks() { const rows = pendingBlocks.splice(0, 200); const cols = ['hash', 'blue_score', 'daa_score', 'timestamp_ms', 'parents', 'parent_hashes', 'is_chain_block', 'vote_key_hash', 'miner_address', 'engine', 'tx_count', 'evm_miner', 'proof_records', 'subsidy_sompi', 'paid_sompi', 'selected_parent', 'detail']; - const cast = { parent_hashes: '::text[]', detail: '::jsonb', subsidy_sompi: '::bigint', paid_sompi: '::bigint' }; + // numeric, not bigint: the Igneum 2.0 chain reports the subsidy and the paid amount in wei (9.52 IGN = 9522644482386090276, past int64; 8 Oct 2026) + const cast = { parent_hashes: '::text[]', detail: '::jsonb', subsidy_sompi: '::numeric', paid_sompi: '::numeric' }; const params = []; const values = []; for (const r of rows) { const ph = [];