-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
There was a problem hiding this 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
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
There was a problem hiding this 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" ] } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I should have committed the starting point of magicblock-svm
, core changes are here:
<!-- 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 -->
This reverts commit 84fd7b8.
Reverts #360 <!-- greptile_comment --> ## Greptile Summary This PR reverts a gasless transaction implementation (#360), restoring traditional fee handling across the codebase. - Changed `LAMPORTS_PER_SIGNATURE` from 0 back to 5000 in `magicblock-bank/src/consts.rs`, re-enabling standard transaction fees - Restored payer account initialization with 1000 SOL in `configs/ephem-*.toml` files, requiring SOL for transaction fees again - Added validation in `magicblock-config/src/errors.rs` to prevent ambiguous account initialization (lamports vs SOL) - Reverted from custom magicblock-svm fork back to official solana-svm v2.2 in `Cargo.toml` - Modified bank and genesis config setup in `magicblock-bank/src/genesis_utils.rs` to restore fee-based transaction processing <!-- /greptile_comment -->
See #360 <!-- greptile_comment --> ## Greptile Summary Major architectural changes to implement native gasless transaction support by removing automatic airdrops and modifying fee handling across the validator. - Modified `magicblock-bank/src/consts.rs` to set `DEFAULT_LAMPORTS_PER_SIGNATURE` to 0 and integrate with patched solana-svm for zero-fee transactions - Removed payer initialization and automatic airdrop functionality from configs and `magicblock-accounts/src/config.rs` - Updated genesis configuration in `magicblock-bank/src/genesis_utils.rs` to support configurable transaction fees - Modified `Cargo.toml` to use custom magicblock-labs/magicblock-svm fork at commit e93eb57 - Added support for executing transactions with non-existent fee payers in `magicblock-bank/tests/transaction_execute.rs` <!-- /greptile_comment --> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* master: release: v0.1.7 (#409) Feat: simpler gasless implementation (#406) perf: run ensure accounts concurrently feat: account hydration on background task (#407) Revert "feat: Cleaner gasless implementation" (#405) feat: Cleaner gasless implementation (#360) fix: cleanup slots on non-fresh ledger (#404) release: v0.1.5 (#403) fix: properly init geyser plugin for rpc and use valid dummy Library (#402) release: v0.1.4 (#401) fix: remove grpc plugin altogether from geyser manager (#400) Patch tests from failing on subscription due to rate limits (#386)
Summary
This PR simplifies the gasless setup by removing the automatic airdrop and introducing a native way to execute transactions without charging the payer.
solana-svm
dependency to use a patched version that allows signers without lamportstransaction_execute.rs
to verify transactions with non-existent fee payers and zero feesNotes