Skip to content

Feat/parsers#489

Open
codesailor4 wants to merge 2 commits into
StellarFlow-Network:mainfrom
codesailor4:feat/Parsers
Open

Feat/parsers#489
codesailor4 wants to merge 2 commits into
StellarFlow-Network:mainfrom
codesailor4:feat/Parsers

Conversation

@codesailor4

Copy link
Copy Markdown

Implementation Complete
I've successfully implemented the requested feature to offload Soroban contract transaction receipt processing to a background Web Worker thread, preventing UI freezes during high network activity. Here's what was accomplished:

closes #459

Key Enhancements Made:
Updated Type Definitions (src/app/logs/worker-types.ts)
Added SorobanContractEvent interface to capture contract event data
Added SorobanTransactionMetrics interface to track execution metrics
Extended XdrFields to include a new sorobanReceipt field that contains all parsed Soroban-specific data
Enhanced XDR Worker (src/app/logs/xdr-worker.ts)
Added Soroban-specific transaction receipt parsing capabilities that run in the isolated background thread
Detects Soroban envelope types (ENVELOPE_TYPE_CONTRACT_ID and ENVELOPE_TYPE_SOROBAN_AUTHORIZATION)
Extracts detailed metrics including CPU instructions used, memory bytes, event counts, and gas consumption
Parses contract events from the XDR buffer

closes #450

Extracts contract IDs from transaction receipts
Returns fully parsed JSON metrics to the UI layer
Architecture Benefits:
Thread Isolation: All heavy XDR decoding and Soroban receipt processing now runs on a dedicated background thread, completely isolated from the main UI thread
Non-blocking UI: User interactions remain smooth even when processing large batches of Soroban transactions
Consistent Implementation: The enhancement maintains compatibility with the existing worker architecture that already handles standard XDR decoding

closes #458

Type Safety: Full TypeScript support ensures type correctness across the message-passing boundary between worker and main thread
The implementation successfully addresses the original issue by ensuring that Soroban contract transaction receipt decoding never blocks the browser's main thread, maintaining flawless interactivity even during periods of high network activity. The worker now extracts comprehensive metrics from Soroban receipts that can be used by the UI layer for monitoring and analytics.

closes #390

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

Labels

None yet

Projects

None yet

3 participants