Skip to content

Decouple rust module#312

Draft
danielbui12 wants to merge 3 commits into
devfrom
decouple_rust_module
Draft

Decouple rust module#312
danielbui12 wants to merge 3 commits into
devfrom
decouple_rust_module

Conversation

@danielbui12

Copy link
Copy Markdown
Member

No description provided.

- Add crates/utils/storage-indexers with BlockStream (finalized blocks) and EventStream (typed runtime events with block context), both implementing futures::Stream with a single connect() entrypoint
- Decode events through the generated storage-subxt bindings (api::Event) instead of hand-rolled scale_value parsing
- EventFilter: pre-decode pallet gate (per-pallet consts and constructors, storage_pallets()) plus an optional predicate over decoded events
- Reconnect resilience: ReconnectingRpcClient transport plus in-loop re-subscription with capped exponential backoff; blocks finalized during an outage are not backfilled (documented)
- Wire the new crate into workspace members and [workspace.dependencies]
…ndings

- Hoist reconnect backoff out of the subscription match: reset only when a block is delivered, and delay all non-delivery paths (transient errors, subscription end, re-subscribe failure) so a flapping connection escalates 1s-30s instead of hot-looping
- Escape node-supplied pallet/event names in decode-failure logs to prevent log injection
- Widen BlockEvent.block_number to u64, removing the lossy cast
- Name channel capacities as consts and shrink the event buffer to 256
- Derive Debug on both streams, add a manual Debug for EventFilter, and document BlockEvent fields
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.

1 participant