feat: add timeout, retry, and key rotation support (#765 #766 #767) - #795
Merged
Kingsman-99 merged 1 commit intoAug 31, 2026
Merged
Conversation
- SplitClient: add requestTimeoutMs option (default 30s); wrap outgoing requests to throw RequestTimeoutError on timeout (Stellar-split#765) - LazyInitializer: add maxRetries (default 3) and retryDelayMs (default 1s); factory failures are retried before propagating (Stellar-split#766) - EncryptedFileSigner: add rotateKey() with promise-based lock; in-flight signs complete with old key, new signs use rotated key (Stellar-split#767)
|
@henrypeters 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! 🚀 |
4 tasks
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
SplitClientnow acceptsrequestTimeoutMs(default30_000). All outgoing HTTP requests honour this timeout, and timed-out requests throwRequestTimeoutErrorwith the configured limit in the message.LazyInitializernow acceptsmaxRetries(default3) andretryDelayMs(default1_000). Initialization failures are retried up tomaxRetriestimes before the original error is re-thrown.EncryptedFileSignernow exposesrotateKey(newKeyFilePath, passphrase). A promise-based lock ensures in-flightsign()operations complete with the old key, while all subsequent operations use the rotated key.Changes
src/client/SplitClient.ts— addedrequestTimeoutMsto config, passed through to the Soroban RPC server, wrapped outgoing methods with timeout enforcement andRequestTimeoutErrorconversion.src/client/LazyInitializer.ts— addedLazyInitializerOptionswithmaxRetriesandretryDelayMs; factory failures now retry with delay before propagating.src/signing/adapters/EncryptedFileSigner.ts— addedrotateKey(),_rotationLock, and_deriveKey()using PBKDF2; sign operations await the rotation lock to guarantee old-key completion.Test plan
LazyInitializer.SplitClienttimeout wrapping verified forgetLedger,simulate, andsendTransaction.EncryptedFileSignerrotation verified for atomic state swap and in-flight sign safety.Closes #765
Closes #766
Closes #767