Operator: Solana writer fails — column d.transfer_hash does not exist #71

Closed
opened 2026-03-24 06:33:33 +00:00 by Brouie · 7 comments
Brouie commented 2026-03-24 06:33:33 +00:00 (Migrated from gitlab.com)

Operator starts cleanly with Solana watcher + writer initialized, but Solana writer fails every 5s with:

Error processing Solana approvals error=Failed to query pending approvals: error returned from database: column d.transfer_hash does not exist

DB migrations ran successfully but the deposits table appears to be missing the transfer_hash column that the Solana approval query expects. Likely a missing or outdated migration for the Solana deposit schema.

Environment: make start + make deploy on QA server. Operator .env with SOLANA_RPC_URL, SOLANA_PROGRAM_ID, SOLANA_PRIVATE_KEY all set. Database is postgres://operator:operator@localhost:5433/operator.

Operator starts cleanly with Solana watcher + writer initialized, but Solana writer fails every 5s with: Error processing Solana approvals error=Failed to query pending approvals: error returned from database: column d.transfer_hash does not exist DB migrations ran successfully but the deposits table appears to be missing the transfer_hash column that the Solana approval query expects. Likely a missing or outdated migration for the Solana deposit schema. Environment: make start + make deploy on QA server. Operator .env with SOLANA_RPC_URL, SOLANA_PROGRAM_ID, SOLANA_PRIVATE_KEY all set. Database is postgres://operator:operator@localhost:5433/operator.
PlasticDigits commented 2026-03-24 06:45:07 +00:00 (Migrated from gitlab.com)

mentioned in commit 26a5ae94ff

mentioned in commit 26a5ae94ffec33254a31cf101c152fc4476cead1
PlasticDigits commented 2026-03-24 06:45:13 +00:00 (Migrated from gitlab.com)

Fix pushed to feat/solana-integration

Cause: The Solana writer queries evm_deposits.transfer_hash, but only solana_deposits had that column (migration 010), so Postgres failed on the EVM side of the UNION.

Change: Migration 011 adds transfer_hash on evm_deposits; the EVM watcher stores the V2 compute_xchain_hash_id on insert. Optional one-off binary backfill-evm-transfer-hashes + README steps for rows already in DB before deploy.

@Brouie — could you review on the QA VPS (migrate / deploy branch, run backfill if needed, confirm the writer stops erroring)? Leaving this issue open until you sign off.

Commit: 26a5ae9

## Fix pushed to `feat/solana-integration` **Cause:** The Solana writer queries `evm_deposits.transfer_hash`, but only `solana_deposits` had that column (migration 010), so Postgres failed on the EVM side of the UNION. **Change:** Migration `011` adds `transfer_hash` on `evm_deposits`; the EVM watcher stores the V2 `compute_xchain_hash_id` on insert. Optional one-off binary `backfill-evm-transfer-hashes` + README steps for rows already in DB before deploy. @Brouie — could you review on the QA VPS (migrate / deploy branch, run backfill if needed, confirm the writer stops erroring)? Leaving this issue **open** until you sign off. Commit: `26a5ae9`
Brouie commented 2026-03-24 06:52:43 +00:00 (Migrated from gitlab.com)

transfer_hash error fixed (migration 011 worked). But now hitting a similar error: 'column d.dest_chain does not exist' in the same Solana approvals query. Likely needs another column added to evm_deposits or a migration update.

transfer_hash error fixed (migration 011 worked). But now hitting a similar error: 'column d.dest_chain does not exist' in the same Solana approvals query. Likely needs another column added to evm_deposits or a migration update.
PlasticDigits commented 2026-03-24 07:06:55 +00:00 (Migrated from gitlab.com)

mentioned in commit b8d990b41c

mentioned in commit b8d990b41c663cf5f29535b970a2caf8f487cc40
PlasticDigits commented 2026-03-24 07:07:14 +00:00 (Migrated from gitlab.com)

Follow-up fix pushed (b8d990b)

@Brouie — the dest_chain error you hit was one of 7 bugs in the Solana writer's SQL. Full list:

SELECT query (evm_deposits branch):

  1. d.dest_chain → column doesn't exist, fixed to d.dest_chain_key (your new error)
  2. d.token → VARCHAR/BYTEA type mismatch in UNION, fixed to d.dest_token_address
  3. d.status = 'confirmed' → evm_deposits never has that status, fixed to 'pending'
  4. dest_chain_key LIKE 'solana%' → BYTEA column with binary V2 chain IDs, fixed to dest_chain_type = 'solana'

record_approval INSERT:
5. chain_type column doesn't exist in approvals table
6. Missing 6 NOT NULL columns (would error on every insert)
7. ON CONFLICT (xchain_hash_id) has no unique index

Replaced the broken approvals INSERT with status-based dedup (evm_deposits.status='processed', solana_deposits.processed=TRUE) — same pattern as the EVM and Terra writers.

Pull the branch and redeploy. This should be the last schema/query blocker for the writer loop.

## Follow-up fix pushed (`b8d990b`) @Brouie — the `dest_chain` error you hit was one of **7 bugs** in the Solana writer's SQL. Full list: **SELECT query (evm_deposits branch):** 1. `d.dest_chain` → column doesn't exist, fixed to `d.dest_chain_key` (your new error) 2. `d.token` → VARCHAR/BYTEA type mismatch in UNION, fixed to `d.dest_token_address` 3. `d.status = 'confirmed'` → evm_deposits never has that status, fixed to `'pending'` 4. `dest_chain_key LIKE 'solana%'` → BYTEA column with binary V2 chain IDs, fixed to `dest_chain_type = 'solana'` **record_approval INSERT:** 5. `chain_type` column doesn't exist in approvals table 6. Missing 6 NOT NULL columns (would error on every insert) 7. `ON CONFLICT (xchain_hash_id)` has no unique index Replaced the broken approvals INSERT with status-based dedup (`evm_deposits.status='processed'`, `solana_deposits.processed=TRUE`) — same pattern as the EVM and Terra writers. Pull the branch and redeploy. This should be the last schema/query blocker for the writer loop.
PlasticDigits commented 2026-03-24 07:08:18 +00:00 (Migrated from gitlab.com)

@Brouie ready for your review — both commits are on feat/solana-integration (26a5ae9 migration + hash compute, b8d990b full writer SQL + dedup fix). Please pull, deploy, and confirm the Solana writer loop runs clean.

@Brouie ready for your review — both commits are on `feat/solana-integration` (`26a5ae9` migration + hash compute, `b8d990b` full writer SQL + dedup fix). Please pull, deploy, and confirm the Solana writer loop runs clean.
Brouie commented 2026-03-24 07:13:20 +00:00 (Migrated from gitlab.com)

Verified — operator starts cleanly, no more column errors. Solana watcher + writer both running, processing blocks. Migration 011 working.

Verified — operator starts cleanly, no more column errors. Solana watcher + writer both running, processing blocks. Migration 011 working.
Brouie (Migrated from gitlab.com) closed this issue 2026-03-24 07:13:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-bridge-monorepo#71
No description provided.