Repository navigation
Fixes #712 - #714
Merged
Merged
Fixes #712#714
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #714 +/- ##
==========================================
- Coverage 95.31% 95.29% -0.02%
==========================================
Files 25 25
Lines 1919 1913 -6
==========================================
- Hits 1829 1823 -6
Misses 90 90 🚀 New features to boost your workflow:
|
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.
Problem
AsyncClient(url, commitment=Confirmed), passing anyTxOptsmadesend_transactionrun preflight and wait for confirmation atFinalized, ignoring the client commitment.TxOpts.preflight_commitmentdefaulted toFinalized, so theopts.preflight_commitment or self._commitmentfallback incore.pynever took effect. A transaction that was already confirmed could be polled until timeout and reported asUnconfirmedTxError, which invites a resend. Onlyopts=Noneused the client commitment.confirm_transaction, when the block height passedlast_valid_block_height,TransactionExpiredBlockheightExceededErrorwas raised without a final status check. A transaction that landed between the last status poll and the block height check was wrongly reported as expired.Changes
TxOpts.preflight_commitmentnow defaults toNoneand falls back to the client commitment. The confirmation target in_send_raw_transaction_post_send_argsuses the same fallback.confirm_transactiondoes one lastget_signature_statusescheck before raisingTransactionExpiredBlockheightExceededError, and returns normally if the target commitment has been reached.reached_commitment.test_pydantic_models.pyis updated.Notes
TxOpts().preflight_commitmentis nowNoneinstead ofFinalized. Callers who relied on the implicitFinalizedshould pass it explicitly.getSignatureStatuses/getBlockHeighterrors still propagate asSolanaRpcException. Retry/backoff for rate limiting is intentionally not added to the client, since it adds complexity and hides a misconfiguration. Callers are expected to size their RPC plan and request rate accordingly, andAsyncClient(rate_limit=...)exists for this purpose. On such an error, the signature returned bysend_transactionis not available to the caller, so they should look it up (e.g. viaget_signature_statuses) before deciding whether to resend.confirm_commitmentoption onTxOpts.Testing
pytest tests/unitpasses andruff checkis clean.