Skip to content

fix: remove stale preflightCommitment workaround in sendEncodedTransaction#3784

Open
babuClawd wants to merge 1 commit intosolana-foundation:maintenance/v1.xfrom
babuClawd:fix/remove-preflight-commitment-workaround
Open

fix: remove stale preflightCommitment workaround in sendEncodedTransaction#3784
babuClawd wants to merge 1 commit intosolana-foundation:maintenance/v1.xfrom
babuClawd:fix/remove-preflight-commitment-workaround

Conversation

@babuClawd
Copy link

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 that preflightCommitment was hardcoded to 'processed' when skipPreflight === true:

// Before
const preflightCommitment =
  skipPreflight === true
    ? 'processed' // FIXME Remove when https://github.com/anza-xyz/agave/pull/483 is deployed.
    : (options && options.preflightCommitment) || this.commitment;

This workaround was added to work around a bug in the Agave validator where skipping preflight with non-processed commitment could cause issues with last_valid_block_height calculation.

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

// After
const preflightCommitment =
  (options && options.preflightCommitment) || this.commitment;

preflightCommitment now behaves consistently regardless of skipPreflight:

  • Uses options.preflightCommitment if explicitly provided
  • Falls back to connection.commitment

Impact

Behavior change: When skipPreflight: true and no explicit preflightCommitment is passed, the value sent to the RPC changes from hardcoded 'processed' to the connection's configured commitment level (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.

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove hardcoded preflightCommitment config

1 participant