Skip to content

feat: Cleaner gasless implementation #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

GabrielePicco
Copy link
Contributor

@GabrielePicco GabrielePicco commented May 9, 2025

Summary

This PR simplifies the gasless setup by removing the automatic airdrop and introducing a native way to execute transactions without charging the payer.

  • https://github.com/magicblock-labs/magicblock-svm
  • Changed the solana-svm dependency to use a patched version that allows signers without lamports
  • Added a test case in transaction_execute.rs to verify transactions with non-existent fee payers and zero fees
  • Simplified and modified genesis to set lamports per signature from the config (base fees)
  • Set the default lamports per signature to 0

Notes

  • A follow-up PR will completely remove the initial payer SOL/lamports configuration and logic
  • A follow-up PR will address rent

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@bmuddha bmuddha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite neat, too neat to be true even, wonder why we haven't considered this approach before.

@@ -150,7 +150,7 @@ solana-rpc = "2.2"
solana-rpc-client = { version = "2.2" }
solana-rpc-client-api = { version = "2.2" }
solana-sdk = { version = "2.2" }
solana-svm = { version = "2.2", features = [ "dev-context-only-utils" ] }
solana-svm = { git = "https://github.com/magicblock-labs/magicblock-svm.git", rev = "e93eb57", features = [ "dev-context-only-utils" ] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to see the introduced changes to the SVM as well.

Copy link
Contributor Author

@GabrielePicco GabrielePicco May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<!-- greptile_comment -->

## Greptile Summary

Removed free airdrop functionality and payer configurations across the
MagicBlock validator, transitioning towards a gasless transaction model.

- Removed `payer_init_lamports` field and related configurations from
`configs/ephem-devnet.toml` and `configs/ephem-testnet.toml`,
eliminating automatic account funding
- Simplified fee payer account cloning in
`magicblock-account-cloner/src/remote_account_cloner_worker.rs` by using
standard `do_clone_undelegated_account` method for non-charging
validators
- Removed `Payer` struct and related functionality from
`magicblock-config/src/accounts.rs`, including configuration validation
and environment variable handling
- Modified account initialization logic in
`magicblock-api/src/magic_validator.rs` to support gasless transactions
while maintaining validator identity and faucet account funding



<!-- /greptile_comment -->
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.

5 participants