fix: harden Stellar network, signing, amount, and offline-storage handling - #931
Merged
Merged
Conversation
…dling ## Closes DogStark#853 DogStark#854 DogStark#855 DogStark#868 ### What does this PR do? * DogStark#853 — Single validated Stellar network config (src/lib/blockchain/network.ts) drives Horizon URL, passphrase, explorer, and friendbot together; validateNetworkConfig rejects testnet/mainnet mixing and sendPayment refuses wallets from a different network. * DogStark#854 — Pre-signing validation (src/utils/transactionValidation.ts) uses StrKey.isValidEd25519PublicKey for destinations and byte-based memo checks (28-byte limit, control chars, ambiguous 64-hex hashes); TransactionSigning now uses it. * DogStark#855 — Stroop-safe decimal handling (src/utils/stellarAmounts.ts) replaces float arithmetic in TransactionSigning and walletBalance; min/max/precision/rounding boundaries are tested. * DogStark#868 — Offline storage quota handling (src/lib/offline): estimates quota, handles QuotaExceededError, evicts cache-then-records (never queued mutations), and surfaces StoragePressureBanner recovery feedback. * Tests: new jest suites for network config, amount/transaction validation, and storage manager; walletService.test.ts now runs and covers the cross-network guard. docs/security.md documents the new guards.
|
@vrickish 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.
Closes #853
Closes #854
Closes #855
Closes #868
What does this PR do?
[Frontend] Ensure Stellar network selection cannot mix testnet and mainnet assets #853 — Single validated Stellar network config (src/lib/blockchain/network.ts) drives Horizon URL, passphrase, explorer, and friendbot together; validateNetworkConfig rejects testnet/mainnet mixing and sendPayment refuses wallets from a different network.
[Frontend] Validate Stellar transaction destinations and memos before signing #854 — Pre-signing validation (src/utils/transactionValidation.ts) uses StrKey.isValidEd25519PublicKey for destinations and byte-based memo checks (28-byte limit, control chars, ambiguous 64-hex hashes); TransactionSigning now uses it.
[Frontend] Replace floating-point payment arithmetic with stroop-safe decimal handling #855 — Stroop-safe decimal handling (src/utils/stellarAmounts.ts) replaces float arithmetic in TransactionSigning and walletBalance; min/max/precision/rounding boundaries are tested.
[Frontend] Add storage-quota and eviction handling for offline features #868 — Offline storage quota handling (src/lib/offline): estimates quota, handles QuotaExceededError, evicts cache-then-records (never queued mutations), and surfaces StoragePressureBanner recovery feedback.
Tests: new jest suites for network config, amount/transaction validation, and storage manager; walletService.test.ts now runs and covers the cross-network guard. docs/security.md documents the new guards.