Skip to content

STR 1348 Withdrawal request indexer for monitoring dashboard#223

Draft
krsnapaudel wants to merge 5 commits intomainfrom
STR-1348
Draft

STR 1348 Withdrawal request indexer for monitoring dashboard#223
krsnapaudel wants to merge 5 commits intomainfrom
STR-1348

Conversation

@krsnapaudel
Copy link
Copy Markdown
Collaborator

@krsnapaudel krsnapaudel commented May 5, 2026

Description

Foundation for a dashboard-side EVM withdrawal indexer: tails WithdrawalIntentEvent logs from the bridge-out precompile and persists them in FIFO order. First half of recovering withdrawal_request_txid ↔ deposit_idx after the bridge stopped carrying the WRT. Pairing is deferred to a follow-up.

What's in

  • Workspace split: bin/dashboard + crates/{bridge,network,config,utils}.
  • Sled-backed WithdrawalIndexerDb with transactional insert_withdrawal_event (atomic across rows + reverse index, idempotent on replay) and bijection-enforcing insert_pairing.
  • Indexer task: eth_getLogs → decode via alpen_reth_primitives → expand by FIXED_WITHDRAWAL_SATS → persist. Cursor-aware, finality-lag-aware, log-order-normalized.
  • Live smoke test (#[ignore]d) against testnet.
  • Task lifecycle moved to strata_tasks::TaskExecutor + ShutdownGuard for all four long-running tasks (network, bridge, indexer, HTTP).
  • alpen + strata-bridge pinned to deploy revs; toolchain nightly-2026-01-01.

Fixes STR-1348

NOTE: We cannot merge this yet. We need to figure out the versions of alpen and strata-bridge that we can use.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • DB (9): event roundtrip, replay idempotency, pairing roundtrip, pairing-conflict rejection — sled + mock. Plus rows_persist_across_reopen.
  • Decoder (6): sub-unit expansion, single-denom, four rejection paths (zero/non-multiple amount, wrong address, wrong topic).
  • Indexer task (4): empty tip, cursor advance, restart-replay no dups, scrambled-input persisted in (block_number, log_index) order.
  • Constant pinning (1): FIXED_WITHDRAWAL_SATS re-derived from WEI_PER_BTC / WEI_PER_SAT.
  • Config (4): TOML roundtrip, load_from_path, getters, WithdrawalIndexerConfig defaults.

Optional live smoke (#[ignore])
ETH_RPC_URL=https://rpc.testnet.alpenlabs.io cargo test live_smoke -- --ignored --nocapture — exercises JsonRpcEthClient + decoder against
real bridgeout logs; confirms ABI parity with the pinned alpen-reth-primitives rev.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@krsnapaudel krsnapaudel requested a review from purusang as a code owner May 5, 2026 00:12
@krsnapaudel krsnapaudel marked this pull request as draft May 5, 2026 00:12
@krsnapaudel krsnapaudel self-assigned this May 5, 2026
@krsnapaudel krsnapaudel requested review from storopoli and voidash May 5, 2026 00:14
Comment thread backend/crates/bridge/src/withdrawal_indexer/task.rs
Comment thread backend/crates/bridge/src/withdrawal_indexer/decoder.rs
@krsnapaudel krsnapaudel force-pushed the STR-1348 branch 2 times, most recently from e59aced to ff8a74a Compare May 5, 2026 23:52
@krsnapaudel krsnapaudel requested a review from storopoli May 5, 2026 23:53
Copy link
Copy Markdown
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d6f5e8f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants