feat(soroban): execution budget monitoring, XDR deserialization, DEX price feed, TTL management#702
Open
Markodiba6399 wants to merge 1 commit into
Conversation
…DEX price feed, and TTL management Issue StellerCraft#89 — soroban-budget-monitor.ts - Track CPU instructions and memory per invocation against Protocol 21 hard limits - Fire configurable alert handlers when usage approaches budget thresholds (default 80%) - Expose ring-buffered metrics store for observability Issue StellerCraft#90 — soroban-xdr-deserializer.ts - Map all ScVal variants to TypeScript types (bool, null, number, bigint, string, Buffer, array, map, address) - Handle signed 64/128/256-bit integers with correct two's-complement BigInt math - Throw typed SorobanDeserializationError on error values and unknown types Issue StellerCraft#91 — dex-price-feed.ts + dex-orderbook-snapshot.test.ts - Compute bestBid, bestAsk, midPrice, spread, spreadPercent from order book snapshots - Detect empty, single-sided, and crossed book conditions - Snapshot test fixtures for thin, deep, empty, crossed, and symmetric market conditions Issue StellerCraft#92 — soroban-ttl-manager.ts - Query liveUntilLedgerSeq for ledger entries and classify as near-expiration or expired - Build ExtendFootprintTtl transactions automatically for at-risk entries - High-level checkContractTtl helper surfaces TTL status to operators Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Markodiba6399 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
soroban-budget-monitor.ts— tracks CPU instructions and memory usage per contract invocation against Soroban Protocol 21 hard limits; fires configurable alert handlers at threshold (default 80%); exposes ring-buffered metrics storesoroban-xdr-deserializer.ts— maps allScValvariants to strongly-typed TypeScript values; handles signed 64/128/256-bit integers with correct two's-complement BigInt math; throwsSorobanDeserializationErroron error values and unrecognized types, never silently coercesdex-price-feed.ts+dex-orderbook-snapshot.test.ts— pure price computation (bestBid, bestAsk, midPrice, spread, VWAP) from Horizon order book snapshots; snapshot fixtures cover thin, deep, empty, single-sided, crossed, and symmetric market conditionssoroban-ttl-manager.ts— queriesliveUntilLedgerSeqfor ledger entries, classifies as near-expiration/expired; buildsExtendFootprintTtltransactions automatically;checkContractTtlhigh-level helper surfaces TTL status to operatorsTest plan
soroban-budget-monitor.test.ts— 23 tests: budget metric capture, alert threshold triggering at/below/above default and custom thresholds, handler unsubscribe, no-cost simulation, metrics store accumulation and clearsoroban-xdr-deserializer.test.ts— 38 tests: all scalar types (bool, void, u32, i32, u64, i64, timepoint, duration, u128, i128, u256, i256), bytes/string/symbol, vec/map collections, account and contract addresses, error-value throws, typeddeserializeScValAsguarddex-orderbook-snapshot.test.ts— 31 tests: thin/deep/empty/bids-only/asks-only/crossed/symmetric fixtures, VWAP with maxVolume cap,assertPriceClosepass/failsoroban-ttl-manager.test.ts— 20 tests: TTL info with healthy/near-expiration/expired/missing entries, custom warning thresholds, multi-key queries, extension transaction building,checkContractTtlend-to-end, error propagationAll 102 new tests pass. No regressions in existing test files.
closes #625
closes #626
closes #627
closes #628