Skip to content

feat(soroban): execution budget monitoring, XDR deserialization, DEX price feed, TTL management#702

Open
Markodiba6399 wants to merge 1 commit into
StellerCraft:mainfrom
Markodiba6399:feat/issues-089-090-091-092-soroban-monitoring-xdr-dex-ttl
Open

feat(soroban): execution budget monitoring, XDR deserialization, DEX price feed, TTL management#702
Markodiba6399 wants to merge 1 commit into
StellerCraft:mainfrom
Markodiba6399:feat/issues-089-090-091-092-soroban-monitoring-xdr-dex-ttl

Conversation

@Markodiba6399
Copy link
Copy Markdown

@Markodiba6399 Markodiba6399 commented Jun 1, 2026

Summary

  • Issue 089: Implement Vercel deployment triggering #89 Add 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 store
  • Issue 090: Implement retrieval of Vercel deployment logs #90 Add soroban-xdr-deserializer.ts — maps all ScVal variants to strongly-typed TypeScript values; handles signed 64/128/256-bit integers with correct two's-complement BigInt math; throws SorobanDeserializationError on error values and unrecognized types, never silently coerces
  • Issue 091: Implement Vercel domain configuration #91 Add dex-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 conditions
  • Issue 092: Implement retrieval of Vercel deployment status #92 Add soroban-ttl-manager.ts — queries liveUntilLedgerSeq for ledger entries, classifies as near-expiration/expired; builds ExtendFootprintTtl transactions automatically; checkContractTtl high-level helper surfaces TTL status to operators

Test 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 clear
  • soroban-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, typed deserializeScValAs guard
  • dex-orderbook-snapshot.test.ts — 31 tests: thin/deep/empty/bids-only/asks-only/crossed/symmetric fixtures, VWAP with maxVolume cap, assertPriceClose pass/fail
  • soroban-ttl-manager.test.ts — 20 tests: TTL info with healthy/near-expiration/expired/missing entries, custom warning thresholds, multi-key queries, extension transaction building, checkContractTtl end-to-end, error propagation

All 102 new tests pass. No regressions in existing test files.

closes #625
closes #626
closes #627
closes #628

…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>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@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! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

2 participants