Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ANISH-SR
Copy link
Contributor

Summary of Changes

This change fixes incorrect airdrop transaction metadata by leveraging LiteSVM’s newly exposed airdrop account pubkey.
Previously, Surfpool synthesized a hardcoded airdrop keypair & balance deltas when constructing airdrop transaction meta, because the real airdrop account used by LiteSVM was not accessible. This resulted in inaccurate pre + post Balances.

With LiteSVM now exposing the airdrop pubkey, Surfpool:

  • Exposes that pubkey through SurfnetLiteSvm.
  • Captures real account balances before and after the airdrop for:
    • the LiteSVM airdrop account
    • the recipient account
    • the system program account.
  • Uses these real balances to populate TransactionStatusMeta.pre_balances and post_balances.

tl:dr,
Use svm.airdrop_pubkey() to fetch the airdrop account balance before and after the transaction, and use those values to populate preBalances and postBalances in the airdrop transaction metadata.

Resolves #229

@ANISH-SR
Copy link
Contributor Author

Hi @MicaiahReid , can you please review this and lmk if this approach is correct..
Also, I am encountering build failures due to the workspace was still using LiteSVM 0.8.1, which does not expose the required function i.e airdrop_pubkey().

This PR depends on the LiteSVM change from #186 / #238 that added this function so that the method was unresolved until LiteSVM was bumped to a compatible version.

Can you please guide me here on how should I proceed with the change. thanks : )

@MicaiahReid
Copy link
Member

Hi @MicaiahReid , can you please review this and lmk if this approach is correct..

Also, I am encountering build failures due to the workspace was still using LiteSVM 0.8.1, which does not expose the required function i.e airdrop_pubkey().

This PR depends on the LiteSVM change from #186 / #238 that added this function so that the method was unresolved until LiteSVM was bumped to a compatible version.

Can you please guide me here on how should I proceed with the change. thanks : )

There's a PR open(#479) to update litesvm. Maybe building this PR off that branch would do the trick?

@ANISH-SR
Copy link
Contributor Author

ANISH-SR commented Jan 17, 2026

I’ve rebased this PR on top of #479 so it picks up the LiteSVM upgrade there, and I’ve kept this PR scoped to just the airdrop transaction metadata fix.

The branch now builds cleanly on top of that change. Would appreciate a review when you have a chance @MicaiahReid
: )

@MicaiahReid MicaiahReid changed the base branch from main to chore/litesvm-090 January 19, 2026 16:27
@MicaiahReid
Copy link
Member

@ANISH-SR, I've pushed a fix to this - you were constructing the tx with an invalid signer (based on the pubkeys in the tx), so the airdrop failed.

But since we have the signature and we're just reconstructing the tx, there's no need to have it signed in the first place.

We'll merge this after #462


As a side note, it's a great practice to build and run your branches as a smoke test whenever you open a PR! This bug was easy to catch - it crashed surfpool right on startup!

Thank you for the PR :)

@MicaiahReid MicaiahReid changed the title [WIP] fix: correct airdrop tx pre/post balances using LiteSVM data fix: correct airdrop tx pre/post balances using LiteSVM data Jan 20, 2026
@MicaiahReid MicaiahReid merged commit e4fff87 into txtx:chore/litesvm-090 Jan 20, 2026
@ANISH-SR ANISH-SR deleted the litesvm-229 branch January 20, 2026 16:20
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.

Update airdrop transaction meta to include correct pre/post balances

3 participants