feat(soroban,stellar): fee bump builder, migration strategy, event relay, DEX asset validation#695
Merged
temma02 merged 1 commit intoMay 30, 2026
Conversation
…, event relay, and DEX asset validation StellerCraft#618 – Fee Bump Transaction Builder for Soroban Gas Optimization - Add buildFeeBumpTransaction() to packages/stellar/src/soroban.ts - Query Soroban RPC getFeeStats() to obtain the p90 inclusion fee - Apply 1.5× multiplier to p90 fee for reliable confirmation speed - Cap the computed fee at MAX_FEE_BUMP_STROOPS (10 000 000 stroops / 1 XLM) to prevent runaway costs under extreme congestion - Fall back to BASE_FEE when fee statistics are unavailable - Add soroban.fee-bump.test.ts covering low congestion, high congestion, cap enforcement, RPC failure, and missing fee stats scenarios StellerCraft#617 – Cross-Network Soroban Contract Migration Strategy (Testnet → Mainnet) - Add packages/stellar/src/soroban-migration.ts with migrateSorobanContract() - detectTestnetParameters() rejects testnet passphrase, horizonUrl, sorobanRpcUrl, or network value in a mainnet-targeted config - Mainnet promotion requires explicit { confirm: true }; omitting it returns an error without touching the network - Network passphrase is validated against the target network passphrase - Add soroban-migration.test.ts covering all rejection paths and the full valid mainnet promotion flow - Extend docs/migration-procedures.md with the Soroban testnet→mainnet migration procedure, safety rules, and usage example StellerCraft#619 – Soroban Contract Event Subscription and WebSocket Relay - Add packages/stellar/src/soroban-event-relay.ts with SorobanEventRelay - Polls getEvents() on a per-subscription interval (5 s) from the last seen ledger, filtering events server-side by contractId and eventType - Enforces MAX_SUBSCRIPTIONS_PER_CLIENT (10) to prevent resource exhaustion - Cleans up all intervals and subscriptions on WebSocket close - Add soroban-event-relay.test.ts covering subscription management, event delivery, server-side filtering, closed-socket guard, and cleanup StellerCraft#620 – Stellar Asset Code Validation with DEX Liquidity Pool Compatibility - Extend apps/backend/src/services/stellar-asset-validator.service.ts with validateAssetCodeDexCompatibility() and resolveAssetVariant() - Validates alphanum4 (1–4 chars) and alphanum12 (5–12 chars) variants - Rejects lowercase codes with DEX_INCOMPATIBLE_CHARSET error (Stellar DEX pools require uppercase-only asset codes) - Resolves and returns the asset variant (native / alphanum4 / alphanum12) alongside the compatibility result - Add stellar-asset-dex-compatibility.test.ts covering valid codes, invalid format, lowercase rejection, and clear error messages Closes StellerCraft#617 Closes StellerCraft#618 Closes StellerCraft#619 Closes StellerCraft#620
|
@obanai9 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
This PR resolves four issues across the Soroban and Stellar packages.
#618 – Fee Bump Transaction Builder for Soroban Gas Optimization
Files:
packages/stellar/src/soroban.ts,packages/stellar/src/soroban.fee-bump.test.tsbuildFeeBumpTransaction(innerTxXdr, feeSourcePublicKey, client?)tosoroban.tsgetFeeStats()to obtain the network's p90 inclusion feeMAX_FEE_BUMP_STROOPS(10 000 000 stroops = 1 XLM) to prevent runaway costsBASE_FEEwhen fee statistics are unavailable#617 – Cross-Network Soroban Contract Migration Strategy (Testnet → Mainnet)
Files:
packages/stellar/src/soroban-migration.ts,packages/stellar/src/soroban-migration.test.ts,docs/migration-procedures.mdmigrateSorobanContract(options)— validates config before any mainnet operationdetectTestnetParameters(config)rejects testnet passphrase, horizonUrl, sorobanRpcUrl, or network value in a mainnet-targeted config{ confirm: true }; omitting it returns an error without touching the networkdocs/migration-procedures.mdwith the full testnet→mainnet procedure, safety rules, rejected parameter table, and usage example#619 – Soroban Contract Event Subscription and WebSocket Relay
Files:
packages/stellar/src/soroban-event-relay.ts,packages/stellar/src/soroban-event-relay.test.tsSorobanEventRelayclass that manages per-client Soroban event subscriptionsgetEvents()on a 5-second interval from the last seen ledger per subscriptioncontractIdand optionaleventTypebefore sending to the WebSocket clientMAX_SUBSCRIPTIONS_PER_CLIENT(10) to prevent resource exhaustionclose#620 – Stellar Asset Code Validation with DEX Liquidity Pool Compatibility
Files:
apps/backend/src/services/stellar-asset-validator.service.ts,apps/backend/src/services/stellar-asset-dex-compatibility.test.tsstellar-asset-validator.service.tswithvalidateAssetCodeDexCompatibility(code)andresolveAssetVariant(code)DEX_INCOMPATIBLE_CHARSETerror — Stellar DEX liquidity pools require uppercase-only asset codesnative/alphanum4/alphanum12) alongside the compatibility resultTesting
All new tests pass:
packages/stellar/src/soroban.fee-bump.test.ts— 5 tests ✓packages/stellar/src/soroban-migration.test.ts— 11 tests ✓packages/stellar/src/soroban-event-relay.test.ts— 8 tests ✓apps/backend/src/services/stellar-asset-dex-compatibility.test.ts— 14 tests ✓Closes #617
Closes #618
Closes #619
Closes #620