Skip to content

Feat/gasless #406

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

Merged
merged 19 commits into from
Jun 23, 2025
Merged

Feat/gasless #406

merged 19 commits into from
Jun 23, 2025

Conversation

GabrielePicco
Copy link
Contributor

@GabrielePicco GabrielePicco commented Jun 23, 2025

See #360

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

GabrielePicco and others added 18 commits May 9, 2025 15:13
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
<!-- 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 -->
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.

27 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

Comment on lines 259 to 262
assert_eq!(
author_acc.lamports(),
LAMPORTS_PER_SOL - 2 * LAMPORTS_PER_SIGNATURE
LAMPORTS_PER_SOL - 2 * DEFAULT_LAMPORTS_PER_SIGNATURE
);
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Same account balance assertion being repeated - consider extracting this check into a helper function since it's used twice with identical logic

let fee_payer = Keypair::new();
let instruction = create_noop_instruction(
&elfs::noop::id(),
&[fee_payer.insecure_clone()],
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Use of insecure_clone() is dangerous for keypairs - prefer regular clone() unless there's a specific need for insecure cloning

@GabrielePicco GabrielePicco merged commit ee60e4c into master Jun 23, 2025
@GabrielePicco GabrielePicco deleted the feat/gasless branch June 23, 2025 13:51
thlorenz added a commit that referenced this pull request Jul 2, 2025
* master:
  release: v0.1.7 (#409)
  Feat: simpler gasless implementation (#406)
  perf: run ensure accounts concurrently
thlorenz added a commit that referenced this pull request Jul 2, 2025
* 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)
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.

1 participant