Skip to content

Commit

Permalink
Update builtins and spl_token_2022 (#130)
Browse files Browse the repository at this point in the history
* Update builtins and `spl_token_2022`

* Use Solana builtins

* Remove unused dependencies

* Update the changelog
  • Loading branch information
Aursen authored Feb 24, 2025
1 parent 75559f0 commit 11f616b
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 93 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Upgrade Solana crates to 2.2.0 ([#138](https://github.com/LiteSVM/litesvm/pull/138)).
- Consolidate feature set management into a `with_feature_set` method and remove the `feature_set` param from `with_builtins` and `with_precompiles` ([#141](https://github.com/LiteSVM/litesvm/pull/141)).
- Update builtins and downgrade `spl-token-2022` to `v5.0.2` to match mainnet version ([#130](https://github.com/LiteSVM/litesvm/pull/130)).

## [0.5.0] - 2025-01-23

Expand Down
4 changes: 1 addition & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ serde = "1.0"
smallvec = "1.13"
solana-account = "2.2"
solana-address-lookup-table-interface = "2.2"
solana-address-lookup-table-program = "2.2"
solana-bpf-loader-program = "2.2"
solana-builtins = "2.2"
solana-clock = "2.2"
solana-compute-budget = "2.2"
solana-compute-budget-instruction = "2.2"
Expand Down Expand Up @@ -72,9 +72,7 @@ solana-signature = "2.2"
solana-signer = "2.2"
solana-slot-hashes = "2.2"
solana-slot-history = "2.2"
solana-stake-history = "2.2"
solana-stake-interface = "1.2.1"
solana-stake-program = "2.2"
solana-svm = "2.2"
solana-svm-transaction = "2.2"
solana-system-interface = "1"
Expand All @@ -88,7 +86,7 @@ solana-transaction-error = "2.2"
solana-vote-program = "2.2"
spl-associated-token-account-client = "2.0"
spl-token = "7.0.0"
spl-token-2022 = "6.0.0"
spl-token-2022 = "7.0.0"
test-log = "0.2"
thiserror = "2.0"
tokio = "1.35"
Expand Down
4 changes: 1 addition & 3 deletions crates/litesvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ qualifier_attr = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
solana-account.workspace = true
solana-address-lookup-table-interface.workspace = true
solana-address-lookup-table-program.workspace = true
solana-bpf-loader-program.workspace = true
solana-builtins.workspace = true
solana-clock.workspace = true
solana-compute-budget.workspace = true
solana-compute-budget-instruction.workspace = true
Expand All @@ -41,7 +41,6 @@ solana-keypair.workspace = true
solana-last-restart-slot.workspace = true
solana-loader-v3-interface.workspace = true
solana-loader-v4-interface.workspace = true
solana-loader-v4-program.workspace = true
solana-log-collector.workspace = true
solana-measure.workspace = true
solana-message.workspace = true
Expand All @@ -61,7 +60,6 @@ solana-signer.workspace = true
solana-slot-hashes.workspace = true
solana-slot-history.workspace = true
solana-stake-interface.workspace = true
solana-stake-program.workspace = true
solana-svm-transaction.workspace = true
solana-system-interface.workspace = true
solana-system-program.workspace = true
Expand Down
79 changes: 0 additions & 79 deletions crates/litesvm/src/builtin.rs

This file was deleted.

5 changes: 2 additions & 3 deletions crates/litesvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ use precompiles::load_precompiles;
use qualifier_attr::qualifiers;
use solana_bpf_loader_program::syscalls::create_program_runtime_environment_v1;
use solana_bpf_loader_program::syscalls::create_program_runtime_environment_v2;
use solana_builtins::BUILTINS;
use solana_compute_budget::compute_budget::ComputeBudget;
use solana_compute_budget::compute_budget_limits::ComputeBudgetLimits;
use solana_compute_budget_instruction::instructions_processor::process_compute_budget_instructions;
Expand Down Expand Up @@ -317,7 +318,6 @@ use {

use crate::{
accounts_db::AccountsDb,
builtin::BUILTINS,
error::LiteSVMError,
history::TransactionHistory,
message_processor::process_message,
Expand All @@ -330,7 +330,6 @@ pub mod error;
pub mod types;

mod accounts_db;
mod builtin;
mod format_logs;
mod history;
mod message_processor;
Expand Down Expand Up @@ -462,7 +461,7 @@ impl LiteSVM {
fn set_builtins(&mut self) {
BUILTINS.iter().for_each(|builtint| {
if builtint
.feature_id
.enable_feature_id
.map_or(true, |x| self.feature_set.is_active(&x))
{
let loaded_program =
Expand Down
2 changes: 1 addition & 1 deletion crates/litesvm/src/spl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn load_spl_programs(svm: &mut LiteSVM) {
);
svm.add_program(
pubkey!("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"),
include_bytes!("programs/spl_token_2022-1.0.0.so"),
include_bytes!("programs/spl_token_2022-5.0.2.so"),
);
svm.add_program(
pubkey!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"),
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 11f616b

Please sign in to comment.