fix: remove stale preflightCommitment workaround in sendEncodedTransaction#3784
Open
babuClawd wants to merge 1 commit intosolana-foundation:maintenance/v1.xfrom
Open
Conversation
…ction The workaround that hardcoded preflightCommitment to 'processed' when skipPreflight is true was added to work around an Agave validator bug tracked in anza-xyz/agave#483. That PR was merged on 2024-04-03. The workaround is no longer needed and can be safely removed. After this change, preflightCommitment behaves consistently regardless of skipPreflight — it uses options.preflightCommitment if provided, falling back to connection.commitment. Closes solana-foundation#3733
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
Removes a stale workaround in
sendEncodedTransaction()that was added to work around a validator bug.Closes #3733
Background
In
sendEncodedTransaction(), there was a FIXME comment explaining thatpreflightCommitmentwas hardcoded to'processed'whenskipPreflight === true:This workaround was added to work around a bug in the Agave validator where skipping preflight with non-
processedcommitment could cause issues withlast_valid_block_heightcalculation.Why It's Safe to Remove
anza-xyz/agave#483 was merged on 2024-04-03 — almost 2 years ago. The fix has been deployed to mainnet validators for well over a year.
Change
preflightCommitmentnow behaves consistently regardless ofskipPreflight:options.preflightCommitmentif explicitly providedconnection.commitmentImpact
Behavior change: When
skipPreflight: trueand no explicitpreflightCommitmentis passed, the value sent to the RPC changes from hardcoded'processed'to the connection's configuredcommitmentlevel (typically'finalized'on mainnet).Risk: Low — the workaround's target bug has been fixed at the validator level. The RPC parameter is now passed correctly per user intent.
Testing
No new test needed — this is a logic simplification in an existing code path. Existing tests cover
sendEncodedTransaction()behavior.