From bbb57be0a54f025beed23e549b9678faf637053e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Mon, 11 Sep 2023 21:10:40 +0200 Subject: [PATCH] Refactor - Move interfaces of address-lookup-table into the program SDK (#33165) * Adds a module `address_lookup_table` to the SDK. * Adds a module `address_lookup_table::instruction` to the SDK. * Adds a module `address_lookup_table::error` to the SDK. * Adds a module `address_lookup_table::state` to the SDK. * Moves AddressLookupTable into SDK as well. * Moves AddressLookupTableAccount into address_lookup_table. * Adds deprecation messages. * Disentangles dependencies across cargo files. --- Cargo.lock | 6 -- account-decoder/Cargo.toml | 1 - account-decoder/src/parse_account_data.rs | 5 +- .../src/parse_address_lookup_table.rs | 9 +-- accounts-db/Cargo.toml | 1 - accounts-db/src/accounts.rs | 10 ++-- cli/Cargo.toml | 1 - cli/src/address_lookup_table.rs | 35 ++++++----- core/Cargo.toml | 1 - core/src/banking_stage/consumer.rs | 7 ++- .../banking_stage/read_write_account_set.rs | 7 ++- cost-model/src/block_cost_limits.rs | 6 +- .../developing/runtime-facilities/programs.md | 5 ++ .../tests/close_lookup_table_ix.rs | 2 +- .../tests/common.rs | 16 ++--- .../tests/create_lookup_table_ix.rs | 22 ++++--- .../tests/deactivate_lookup_table_ix.rs | 4 +- .../tests/extend_lookup_table_ix.rs | 8 +-- .../tests/freeze_lookup_table_ix.rs | 4 +- programs/address-lookup-table/src/lib.rs | 16 ++--- .../address-lookup-table/src/processor.rs | 29 ++++----- programs/sbf/Cargo.lock | 5 -- programs/sbf/Cargo.toml | 1 - programs/sbf/rust/dep_crate/Cargo.toml | 1 - rpc/Cargo.toml | 1 - rpc/src/rpc.rs | 7 ++- runtime/src/bank/address_lookup_table.rs | 2 +- runtime/src/builtins.rs | 2 +- .../src/address_lookup_table}/error.rs | 0 .../src/address_lookup_table}/instruction.rs | 60 +++++++++---------- sdk/program/src/address_lookup_table/mod.rs | 20 +++++++ .../src/address_lookup_table}/state.rs | 24 ++++---- .../src/address_lookup_table_account.rs | 13 ---- sdk/program/src/example_mocks.rs | 14 ++++- sdk/program/src/lib.rs | 10 +++- sdk/program/src/message/versions/v0/mod.rs | 9 ++- sdk/src/lib.rs | 23 +++---- transaction-status/Cargo.toml | 1 - .../src/parse_address_lookup_table.rs | 11 ++-- transaction-status/src/parse_instruction.rs | 6 +- 40 files changed, 219 insertions(+), 186 deletions(-) rename {programs/address-lookup-table/src => sdk/program/src/address_lookup_table}/error.rs (100%) rename {programs/address-lookup-table/src => sdk/program/src/address_lookup_table}/instruction.rs (99%) create mode 100644 sdk/program/src/address_lookup_table/mod.rs rename {programs/address-lookup-table/src => sdk/program/src/address_lookup_table}/state.rs (99%) delete mode 100644 sdk/program/src/address_lookup_table_account.rs diff --git a/Cargo.lock b/Cargo.lock index 8dced6cf77..a53a445676 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5085,7 +5085,6 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", "spl-token", @@ -5184,7 +5183,6 @@ dependencies = [ "serde_derive", "siphasher", "solana-accounts-db", - "solana-address-lookup-table-program", "solana-bpf-loader-program", "solana-bucket-map", "solana-compute-budget-program", @@ -5542,7 +5540,6 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", - "solana-address-lookup-table-program", "solana-bpf-loader-program", "solana-clap-utils", "solana-cli-config", @@ -5755,7 +5752,6 @@ dependencies = [ "serde_json", "serial_test", "solana-accounts-db", - "solana-address-lookup-table-program", "solana-bloom", "solana-client", "solana-core", @@ -6693,7 +6689,6 @@ dependencies = [ "soketto", "solana-account-decoder", "solana-accounts-db", - "solana-address-lookup-table-program", "solana-client", "solana-entry", "solana-faucet", @@ -7264,7 +7259,6 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", - "solana-address-lookup-table-program", "solana-sdk", "spl-associated-token-account", "spl-memo", diff --git a/account-decoder/Cargo.toml b/account-decoder/Cargo.toml index 4e6fce49eb..bb82b077dc 100644 --- a/account-decoder/Cargo.toml +++ b/account-decoder/Cargo.toml @@ -19,7 +19,6 @@ lazy_static = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } -solana-address-lookup-table-program = { workspace = true } solana-config-program = { workspace = true } solana-sdk = { workspace = true } spl-token = { workspace = true, features = ["no-entrypoint"] } diff --git a/account-decoder/src/parse_account_data.rs b/account-decoder/src/parse_account_data.rs index a9ec74b872..81886e9498 100644 --- a/account-decoder/src/parse_account_data.rs +++ b/account-decoder/src/parse_account_data.rs @@ -8,14 +8,15 @@ use { inflector::Inflector, serde_json::Value, solana_sdk::{ - instruction::InstructionError, pubkey::Pubkey, stake, system_program, sysvar, vote, + address_lookup_table, instruction::InstructionError, pubkey::Pubkey, stake, system_program, + sysvar, vote, }, std::collections::HashMap, thiserror::Error, }; lazy_static! { - static ref ADDRESS_LOOKUP_PROGRAM_ID: Pubkey = solana_address_lookup_table_program::id(); + static ref ADDRESS_LOOKUP_PROGRAM_ID: Pubkey = address_lookup_table::program::id(); static ref BPF_UPGRADEABLE_LOADER_PROGRAM_ID: Pubkey = solana_sdk::bpf_loader_upgradeable::id(); static ref CONFIG_PROGRAM_ID: Pubkey = solana_config_program::id(); static ref STAKE_PROGRAM_ID: Pubkey = stake::program::id(); diff --git a/account-decoder/src/parse_address_lookup_table.rs b/account-decoder/src/parse_address_lookup_table.rs index 03dc395d54..39c5d44f37 100644 --- a/account-decoder/src/parse_address_lookup_table.rs +++ b/account-decoder/src/parse_address_lookup_table.rs @@ -1,7 +1,6 @@ use { crate::parse_account_data::{ParsableAccount, ParseAccountError}, - solana_address_lookup_table_program::state::AddressLookupTable, - solana_sdk::instruction::InstructionError, + solana_sdk::{address_lookup_table::state::AddressLookupTable, instruction::InstructionError}, }; pub fn parse_address_lookup_table( @@ -62,8 +61,10 @@ impl<'a> From> for UiLookupTable { mod test { use { super::*, - solana_address_lookup_table_program::state::{LookupTableMeta, LOOKUP_TABLE_META_SIZE}, - solana_sdk::pubkey::Pubkey, + solana_sdk::{ + address_lookup_table::state::{LookupTableMeta, LOOKUP_TABLE_META_SIZE}, + pubkey::Pubkey, + }, std::borrow::Cow, }; diff --git a/accounts-db/Cargo.toml b/accounts-db/Cargo.toml index 2e2685b901..680412fcba 100644 --- a/accounts-db/Cargo.toml +++ b/accounts-db/Cargo.toml @@ -45,7 +45,6 @@ regex = { workspace = true } serde = { workspace = true, features = ["rc"] } serde_derive = { workspace = true } siphasher = { workspace = true } -solana-address-lookup-table-program = { workspace = true } solana-bpf-loader-program = { workspace = true } solana-bucket-map = { workspace = true } solana-compute-budget-program = { workspace = true } diff --git a/accounts-db/src/accounts.rs b/accounts-db/src/accounts.rs index 6c6c6a5d18..aa16edd94f 100644 --- a/accounts-db/src/accounts.rs +++ b/accounts-db/src/accounts.rs @@ -24,7 +24,6 @@ use { dashmap::DashMap, itertools::Itertools, log::*, - solana_address_lookup_table_program::{error::AddressLookupError, state::AddressLookupTable}, solana_program_runtime::{ compute_budget::{self, ComputeBudget}, loaded_programs::LoadedProgramsForTxBatch, @@ -32,6 +31,7 @@ use { solana_sdk::{ account::{Account, AccountSharedData, ReadableAccount, WritableAccount}, account_utils::StateMut, + address_lookup_table::{self, error::AddressLookupError, state::AddressLookupTable}, bpf_loader_upgradeable::{self, UpgradeableLoaderState}, clock::{BankId, Slot}, feature_set::{ @@ -781,7 +781,7 @@ impl Accounts { .map(|(account, _rent)| account) .ok_or(AddressLookupError::LookupTableAccountNotFound)?; - if table_account.owner() == &solana_address_lookup_table_program::id() { + if table_account.owner() == &address_lookup_table::program::id() { let current_slot = ancestors.max_slot(); let lookup_table = AddressLookupTable::deserialize(table_account.data()) .map_err(|_ix_err| AddressLookupError::InvalidAccountData)?; @@ -1475,12 +1475,12 @@ mod tests { transaction_results::{DurableNonceFee, TransactionExecutionDetails}, }, assert_matches::assert_matches, - solana_address_lookup_table_program::state::LookupTableMeta, solana_program_runtime::prioritization_fee::{ PrioritizationFeeDetails, PrioritizationFeeType, }, solana_sdk::{ account::{AccountSharedData, WritableAccount}, + address_lookup_table::state::LookupTableMeta, compute_budget::ComputeBudgetInstruction, epoch_schedule::EpochSchedule, genesis_config::ClusterType, @@ -2356,7 +2356,7 @@ mod tests { let invalid_table_key = Pubkey::new_unique(); let invalid_table_account = - AccountSharedData::new(1, 0, &solana_address_lookup_table_program::id()); + AccountSharedData::new(1, 0, &address_lookup_table::program::id()); accounts.store_slow_uncached(0, &invalid_table_key, &invalid_table_account); let address_table_lookup = MessageAddressTableLookup { @@ -2395,7 +2395,7 @@ mod tests { AccountSharedData::create( 1, table_state.serialize_for_tests().unwrap(), - solana_address_lookup_table_program::id(), + address_lookup_table::program::id(), false, 0, ) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 4c10112f40..9879b06218 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -29,7 +29,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } solana-account-decoder = { workspace = true } -solana-address-lookup-table-program = { workspace = true } solana-bpf-loader-program = { workspace = true } solana-clap-utils = { workspace = true } solana-cli-config = { workspace = true } diff --git a/cli/src/address_lookup_table.rs b/cli/src/address_lookup_table.rs index d9f6dd0735..a1be08a577 100644 --- a/cli/src/address_lookup_table.rs +++ b/cli/src/address_lookup_table.rs @@ -1,21 +1,28 @@ use { crate::cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult}, clap::{App, AppSettings, Arg, ArgMatches, SubCommand}, - solana_address_lookup_table_program::{ - instruction::{ - close_lookup_table, create_lookup_table, create_lookup_table_signed, - deactivate_lookup_table, extend_lookup_table, freeze_lookup_table, - }, - state::AddressLookupTable, - }, solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*}, solana_cli_output::{CliAddressLookupTable, CliAddressLookupTableCreated, CliSignature}, solana_remote_wallet::remote_wallet::RemoteWalletManager, solana_rpc_client::rpc_client::RpcClient, solana_rpc_client_api::config::RpcSendTransactionConfig, solana_sdk::{ - account::from_account, clock::Clock, commitment_config::CommitmentConfig, message::Message, - pubkey::Pubkey, signer::Signer, sysvar, transaction::Transaction, + account::from_account, + address_lookup_table::{ + self, + instruction::{ + close_lookup_table, create_lookup_table, create_lookup_table_signed, + deactivate_lookup_table, extend_lookup_table, freeze_lookup_table, + }, + state::AddressLookupTable, + }, + clock::Clock, + commitment_config::CommitmentConfig, + message::Message, + pubkey::Pubkey, + signer::Signer, + sysvar, + transaction::Transaction, }, std::{rc::Rc, sync::Arc}, }; @@ -604,7 +611,7 @@ fn process_freeze_lookup_table( let lookup_table_account = get_lookup_table_result.value.ok_or_else(|| { format!("Lookup table account {lookup_table_pubkey} not found, was it already closed?") })?; - if !solana_address_lookup_table_program::check_id(&lookup_table_account.owner) { + if !address_lookup_table::program::check_id(&lookup_table_account.owner) { return Err(format!( "Lookup table account {lookup_table_pubkey} is not owned by the Address Lookup Table program", ) @@ -662,7 +669,7 @@ fn process_extend_lookup_table( let lookup_table_account = get_lookup_table_result.value.ok_or_else(|| { format!("Lookup table account {lookup_table_pubkey} not found, was it already closed?") })?; - if !solana_address_lookup_table_program::check_id(&lookup_table_account.owner) { + if !address_lookup_table::program::check_id(&lookup_table_account.owner) { return Err(format!( "Lookup table account {lookup_table_pubkey} is not owned by the Address Lookup Table program", ) @@ -721,7 +728,7 @@ fn process_deactivate_lookup_table( let lookup_table_account = get_lookup_table_result.value.ok_or_else(|| { format!("Lookup table account {lookup_table_pubkey} not found, was it already closed?") })?; - if !solana_address_lookup_table_program::check_id(&lookup_table_account.owner) { + if !address_lookup_table::program::check_id(&lookup_table_account.owner) { return Err(format!( "Lookup table account {lookup_table_pubkey} is not owned by the Address Lookup Table program", ) @@ -774,7 +781,7 @@ fn process_close_lookup_table( let lookup_table_account = get_lookup_table_result.value.ok_or_else(|| { format!("Lookup table account {lookup_table_pubkey} not found, was it already closed?") })?; - if !solana_address_lookup_table_program::check_id(&lookup_table_account.owner) { + if !address_lookup_table::program::check_id(&lookup_table_account.owner) { return Err(format!( "Lookup table account {lookup_table_pubkey} is not owned by the Address Lookup Table program", ) @@ -827,7 +834,7 @@ fn process_show_lookup_table( let lookup_table_account = get_lookup_table_result.value.ok_or_else(|| { format!("Lookup table account {lookup_table_pubkey} not found, was it already closed?") })?; - if !solana_address_lookup_table_program::check_id(&lookup_table_account.owner) { + if !address_lookup_table::program::check_id(&lookup_table_account.owner) { return Err(format!( "Lookup table account {lookup_table_pubkey} is not owned by the Address Lookup Table program", ) diff --git a/core/Cargo.toml b/core/Cargo.toml index ce32e45d70..df083bdf05 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -42,7 +42,6 @@ serde = { workspace = true } serde_bytes = { workspace = true } serde_derive = { workspace = true } solana-accounts-db = { workspace = true } -solana-address-lookup-table-program = { workspace = true } solana-bloom = { workspace = true } solana-client = { workspace = true } solana-cost-model = { workspace = true } diff --git a/core/src/banking_stage/consumer.rs b/core/src/banking_stage/consumer.rs index acac38db43..0104792ccd 100644 --- a/core/src/banking_stage/consumer.rs +++ b/core/src/banking_stage/consumer.rs @@ -737,7 +737,6 @@ mod tests { unprocessed_transaction_storage::ThreadType, }, crossbeam_channel::{unbounded, Receiver}, - solana_address_lookup_table_program::state::{AddressLookupTable, LookupTableMeta}, solana_cost_model::cost_model::CostModel, solana_entry::entry::{next_entry, next_versioned_entry}, solana_ledger::{ @@ -754,6 +753,10 @@ mod tests { solana_runtime::prioritization_fee_cache::PrioritizationFeeCache, solana_sdk::{ account::AccountSharedData, + address_lookup_table::{ + self, + state::{AddressLookupTable, LookupTableMeta}, + }, instruction::InstructionError, message::{v0, v0::MessageAddressTableLookup, MessageHeader, VersionedMessage}, poh_config::PohConfig, @@ -844,7 +847,7 @@ mod tests { ) -> AccountSharedData { let data = address_lookup_table.serialize_for_tests().unwrap(); let mut account = - AccountSharedData::new(1, data.len(), &solana_address_lookup_table_program::id()); + AccountSharedData::new(1, data.len(), &address_lookup_table::program::id()); account.set_data(data); bank.store_account(&account_address, &account); diff --git a/core/src/banking_stage/read_write_account_set.rs b/core/src/banking_stage/read_write_account_set.rs index 3ab159c470..691f81d0f5 100644 --- a/core/src/banking_stage/read_write_account_set.rs +++ b/core/src/banking_stage/read_write_account_set.rs @@ -105,11 +105,14 @@ impl ReadWriteAccountSet { mod tests { use { super::ReadWriteAccountSet, - solana_address_lookup_table_program::state::{AddressLookupTable, LookupTableMeta}, solana_ledger::genesis_utils::GenesisConfigInfo, solana_runtime::{bank::Bank, genesis_utils::create_genesis_config}, solana_sdk::{ account::AccountSharedData, + address_lookup_table::{ + self, + state::{AddressLookupTable, LookupTableMeta}, + }, hash::Hash, message::{ v0::{self, MessageAddressTableLookup}, @@ -178,7 +181,7 @@ mod tests { let address_table_key = Pubkey::new_unique(); let data = address_lookup_table.serialize_for_tests().unwrap(); let mut account = - AccountSharedData::new(1, data.len(), &solana_address_lookup_table_program::id()); + AccountSharedData::new(1, data.len(), &address_lookup_table::program::id()); account.set_data(data); bank.store_account(&address_table_key, &account); diff --git a/cost-model/src/block_cost_limits.rs b/cost-model/src/block_cost_limits.rs index af751bdf01..328d89cd04 100644 --- a/cost-model/src/block_cost_limits.rs +++ b/cost-model/src/block_cost_limits.rs @@ -3,8 +3,8 @@ use { lazy_static::lazy_static, solana_sdk::{ - bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, compute_budget, ed25519_program, - loader_v4, pubkey::Pubkey, secp256k1_program, + address_lookup_table, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, + compute_budget, ed25519_program, loader_v4, pubkey::Pubkey, secp256k1_program, }, std::collections::HashMap, }; @@ -37,7 +37,7 @@ lazy_static! { (solana_vote_program::id(), solana_vote_program::vote_processor::DEFAULT_COMPUTE_UNITS), (solana_system_program::id(), solana_system_program::system_processor::DEFAULT_COMPUTE_UNITS), (compute_budget::id(), solana_compute_budget_program::DEFAULT_COMPUTE_UNITS), - (solana_address_lookup_table_program::id(), solana_address_lookup_table_program::processor::DEFAULT_COMPUTE_UNITS), + (address_lookup_table::program::id(), solana_address_lookup_table_program::processor::DEFAULT_COMPUTE_UNITS), (bpf_loader_upgradeable::id(), solana_bpf_loader_program::UPGRADEABLE_LOADER_COMPUTE_UNITS), (bpf_loader_deprecated::id(), solana_bpf_loader_program::DEPRECATED_LOADER_COMPUTE_UNITS), (bpf_loader::id(), solana_bpf_loader_program::DEFAULT_LOADER_COMPUTE_UNITS), diff --git a/docs/src/developing/runtime-facilities/programs.md b/docs/src/developing/runtime-facilities/programs.md index fee20f57ae..787b6444ef 100644 --- a/docs/src/developing/runtime-facilities/programs.md +++ b/docs/src/developing/runtime-facilities/programs.md @@ -50,6 +50,11 @@ Create and manage accounts that track validator voting state and rewards. - Program id: `Vote111111111111111111111111111111111111111` - Instructions: [VoteInstruction](https://docs.rs/solana-vote-program/VERSION_FOR_DOCS_RS/solana_vote_program/vote_instruction/enum.VoteInstruction.html) +## Address Lookup Table Program + +- Program id: `AddressLookupTab1e1111111111111111111111111` +- Instructions: [AddressLookupTableInstruction](https://docs.rs/solana-sdk/VERSION_FOR_DOCS_RS/solana_sdk/address_lookup_table/instruction/enum.ProgramInstruction.html) + ## BPF Loader Deploys, upgrades, and executes programs on the chain. diff --git a/programs/address-lookup-table-tests/tests/close_lookup_table_ix.rs b/programs/address-lookup-table-tests/tests/close_lookup_table_ix.rs index 415f2a11fe..231d82473f 100644 --- a/programs/address-lookup-table-tests/tests/close_lookup_table_ix.rs +++ b/programs/address-lookup-table-tests/tests/close_lookup_table_ix.rs @@ -4,9 +4,9 @@ use { add_lookup_table_account, assert_ix_error, new_address_lookup_table, overwrite_slot_hashes_with_slots, setup_test_context, }, - solana_address_lookup_table_program::instruction::close_lookup_table, solana_program_test::*, solana_sdk::{ + address_lookup_table::instruction::close_lookup_table, clock::Clock, instruction::InstructionError, pubkey::Pubkey, diff --git a/programs/address-lookup-table-tests/tests/common.rs b/programs/address-lookup-table-tests/tests/common.rs index 0a4104300e..48b8019931 100644 --- a/programs/address-lookup-table-tests/tests/common.rs +++ b/programs/address-lookup-table-tests/tests/common.rs @@ -1,13 +1,13 @@ #![allow(dead_code)] use { - solana_address_lookup_table_program::{ - id, - processor::process_instruction, - state::{AddressLookupTable, LookupTableMeta}, - }, + solana_address_lookup_table_program::processor::process_instruction, solana_program_test::*, solana_sdk::{ account::AccountSharedData, + address_lookup_table::{ + program::id, + state::{AddressLookupTable, LookupTableMeta}, + }, clock::Slot, hash::Hash, instruction::{Instruction, InstructionError}, @@ -80,11 +80,7 @@ pub async fn add_lookup_table_account( let rent = context.banks_client.get_rent().await.unwrap(); let rent_exempt_balance = rent.minimum_balance(data.len()); - let mut account = AccountSharedData::new( - rent_exempt_balance, - data.len(), - &solana_address_lookup_table_program::id(), - ); + let mut account = AccountSharedData::new(rent_exempt_balance, data.len(), &id()); account.set_data_from_slice(&data); context.set_account(&account_address, &account); diff --git a/programs/address-lookup-table-tests/tests/create_lookup_table_ix.rs b/programs/address-lookup-table-tests/tests/create_lookup_table_ix.rs index 6330e02c38..183de53e31 100644 --- a/programs/address-lookup-table-tests/tests/create_lookup_table_ix.rs +++ b/programs/address-lookup-table-tests/tests/create_lookup_table_ix.rs @@ -1,16 +1,22 @@ use { assert_matches::assert_matches, common::{assert_ix_error, overwrite_slot_hashes_with_slots, setup_test_context}, - solana_address_lookup_table_program::{ - id, - instruction::{create_lookup_table, create_lookup_table_signed}, - processor::process_instruction, - state::{AddressLookupTable, LOOKUP_TABLE_META_SIZE}, - }, + solana_address_lookup_table_program::processor::process_instruction, solana_program_test::*, solana_sdk::{ - clock::Slot, feature_set, instruction::InstructionError, pubkey::Pubkey, rent::Rent, - signature::Signer, signer::keypair::Keypair, transaction::Transaction, + address_lookup_table::{ + instruction::{create_lookup_table, create_lookup_table_signed}, + program::id, + state::{AddressLookupTable, LOOKUP_TABLE_META_SIZE}, + }, + clock::Slot, + feature_set, + instruction::InstructionError, + pubkey::Pubkey, + rent::Rent, + signature::Signer, + signer::keypair::Keypair, + transaction::Transaction, }, }; diff --git a/programs/address-lookup-table-tests/tests/deactivate_lookup_table_ix.rs b/programs/address-lookup-table-tests/tests/deactivate_lookup_table_ix.rs index 81050aca12..664f38dad4 100644 --- a/programs/address-lookup-table-tests/tests/deactivate_lookup_table_ix.rs +++ b/programs/address-lookup-table-tests/tests/deactivate_lookup_table_ix.rs @@ -3,11 +3,9 @@ use { common::{ add_lookup_table_account, assert_ix_error, new_address_lookup_table, setup_test_context, }, - solana_address_lookup_table_program::{ - instruction::deactivate_lookup_table, state::AddressLookupTable, - }, solana_program_test::*, solana_sdk::{ + address_lookup_table::{instruction::deactivate_lookup_table, state::AddressLookupTable}, instruction::InstructionError, pubkey::Pubkey, signature::{Keypair, Signer}, diff --git a/programs/address-lookup-table-tests/tests/extend_lookup_table_ix.rs b/programs/address-lookup-table-tests/tests/extend_lookup_table_ix.rs index 1bbc973c24..e0e56daca9 100644 --- a/programs/address-lookup-table-tests/tests/extend_lookup_table_ix.rs +++ b/programs/address-lookup-table-tests/tests/extend_lookup_table_ix.rs @@ -3,13 +3,13 @@ use { common::{ add_lookup_table_account, assert_ix_error, new_address_lookup_table, setup_test_context, }, - solana_address_lookup_table_program::{ - instruction::extend_lookup_table, - state::{AddressLookupTable, LookupTableMeta}, - }, solana_program_test::*, solana_sdk::{ account::{ReadableAccount, WritableAccount}, + address_lookup_table::{ + instruction::extend_lookup_table, + state::{AddressLookupTable, LookupTableMeta}, + }, clock::Clock, instruction::{Instruction, InstructionError}, pubkey::{Pubkey, PUBKEY_BYTES}, diff --git a/programs/address-lookup-table-tests/tests/freeze_lookup_table_ix.rs b/programs/address-lookup-table-tests/tests/freeze_lookup_table_ix.rs index bb169fda29..45583db1e0 100644 --- a/programs/address-lookup-table-tests/tests/freeze_lookup_table_ix.rs +++ b/programs/address-lookup-table-tests/tests/freeze_lookup_table_ix.rs @@ -3,11 +3,9 @@ use { common::{ add_lookup_table_account, assert_ix_error, new_address_lookup_table, setup_test_context, }, - solana_address_lookup_table_program::{ - instruction::freeze_lookup_table, state::AddressLookupTable, - }, solana_program_test::*, solana_sdk::{ + address_lookup_table::{instruction::freeze_lookup_table, state::AddressLookupTable}, instruction::InstructionError, pubkey::Pubkey, signature::{Keypair, Signer}, diff --git a/programs/address-lookup-table/src/lib.rs b/programs/address-lookup-table/src/lib.rs index c26a815eba..11d9b4b0dd 100644 --- a/programs/address-lookup-table/src/lib.rs +++ b/programs/address-lookup-table/src/lib.rs @@ -2,12 +2,14 @@ #![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(specialization))] #![cfg_attr(RUSTC_NEEDS_PROC_MACRO_HYGIENE, feature(proc_macro_hygiene))] -use solana_program::declare_id; - -pub mod error; -pub mod instruction; -#[cfg(not(target_os = "solana"))] pub mod processor; -pub mod state; -declare_id!("AddressLookupTab1e1111111111111111111111111"); +#[deprecated( + since = "1.17.0", + note = "Please use `solana_sdk::address_lookup_table` instead" +)] +pub use solana_sdk::address_lookup_table::{ + error, instruction, + program::{check_id, id, ID}, + state, +}; diff --git a/programs/address-lookup-table/src/processor.rs b/programs/address-lookup-table/src/processor.rs index 68416015dc..6f71b293d0 100644 --- a/programs/address-lookup-table/src/processor.rs +++ b/programs/address-lookup-table/src/processor.rs @@ -1,13 +1,14 @@ use { - crate::{ - instruction::ProgramInstruction, - state::{ - AddressLookupTable, LookupTableMeta, LookupTableStatus, ProgramState, - LOOKUP_TABLE_MAX_ADDRESSES, LOOKUP_TABLE_META_SIZE, - }, - }, solana_program_runtime::{declare_process_instruction, ic_msg, invoke_context::InvokeContext}, solana_sdk::{ + address_lookup_table::{ + instruction::ProgramInstruction, + program::{check_id, id}, + state::{ + AddressLookupTable, LookupTableMeta, LookupTableStatus, ProgramState, + LOOKUP_TABLE_MAX_ADDRESSES, LOOKUP_TABLE_META_SIZE, + }, + }, clock::Slot, feature_set, instruction::InstructionError, @@ -117,7 +118,7 @@ impl Processor { &derivation_slot.to_le_bytes(), &[bump_seed], ], - &crate::id(), + &id(), )?; if table_key != derived_table_key { @@ -132,7 +133,7 @@ impl Processor { if invoke_context .feature_set .is_active(&feature_set::relax_authority_signer_check_for_lookup_table_creation::id()) - && crate::check_id(&lookup_table_owner) + && check_id(&lookup_table_owner) { return Ok(()); } @@ -157,7 +158,7 @@ impl Processor { )?; invoke_context.native_invoke( - system_instruction::assign(&table_key, &crate::id()).into(), + system_instruction::assign(&table_key, &id()).into(), &[table_key], )?; @@ -178,7 +179,7 @@ impl Processor { let lookup_table_account = instruction_context.try_borrow_instruction_account(transaction_context, 0)?; - if *lookup_table_account.get_owner() != crate::id() { + if *lookup_table_account.get_owner() != id() { return Err(InstructionError::InvalidAccountOwner); } drop(lookup_table_account); @@ -233,7 +234,7 @@ impl Processor { let lookup_table_account = instruction_context.try_borrow_instruction_account(transaction_context, 0)?; let table_key = *lookup_table_account.get_key(); - if *lookup_table_account.get_owner() != crate::id() { + if *lookup_table_account.get_owner() != id() { return Err(InstructionError::InvalidAccountOwner); } drop(lookup_table_account); @@ -348,7 +349,7 @@ impl Processor { let lookup_table_account = instruction_context.try_borrow_instruction_account(transaction_context, 0)?; - if *lookup_table_account.get_owner() != crate::id() { + if *lookup_table_account.get_owner() != id() { return Err(InstructionError::InvalidAccountOwner); } drop(lookup_table_account); @@ -397,7 +398,7 @@ impl Processor { let lookup_table_account = instruction_context.try_borrow_instruction_account(transaction_context, 0)?; - if *lookup_table_account.get_owner() != crate::id() { + if *lookup_table_account.get_owner() != id() { return Err(InstructionError::InvalidAccountOwner); } drop(lookup_table_account); diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 54ffec2adb..f3a5a0987e 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -4456,7 +4456,6 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", "spl-token", @@ -4505,7 +4504,6 @@ dependencies = [ "serde", "serde_derive", "siphasher", - "solana-address-lookup-table-program", "solana-bpf-loader-program", "solana-bucket-map", "solana-compute-budget-program", @@ -4812,7 +4810,6 @@ dependencies = [ "serde_bytes", "serde_derive", "solana-accounts-db", - "solana-address-lookup-table-program", "solana-bloom", "solana-client", "solana-cost-model", @@ -5684,7 +5681,6 @@ name = "solana-sbf-rust-dep-crate" version = "1.17.0" dependencies = [ "byteorder 1.4.3", - "solana-address-lookup-table-program", "solana-program", ] @@ -6255,7 +6251,6 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", - "solana-address-lookup-table-program", "solana-sdk", "spl-associated-token-account", "spl-memo", diff --git a/programs/sbf/Cargo.toml b/programs/sbf/Cargo.toml index cd5ed1f479..2ef02e54b8 100644 --- a/programs/sbf/Cargo.toml +++ b/programs/sbf/Cargo.toml @@ -28,7 +28,6 @@ serde_json = "1.0.56" solana_rbpf = "=0.7.1" solana-account-decoder = { path = "../../account-decoder", version = "=1.17.0" } solana-accounts-db = { path = "../../accounts-db", version = "=1.17.0" } -solana-address-lookup-table-program = { path = "../../programs/address-lookup-table", version = "=1.17.0" } solana-bpf-loader-program = { path = "../bpf_loader", version = "=1.17.0" } solana-cli-output = { path = "../../cli-output", version = "=1.17.0" } solana-ledger = { path = "../../ledger", version = "=1.17.0" } diff --git a/programs/sbf/rust/dep_crate/Cargo.toml b/programs/sbf/rust/dep_crate/Cargo.toml index 56ee7bcb34..afeec6766e 100644 --- a/programs/sbf/rust/dep_crate/Cargo.toml +++ b/programs/sbf/rust/dep_crate/Cargo.toml @@ -12,7 +12,6 @@ edition = { workspace = true } [dependencies] byteorder = { workspace = true } # list of crates which must be buildable for bpf programs -solana-address-lookup-table-program = { workspace = true } solana-program = { workspace = true } [lib] diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 92bc7710c2..62ae098cb6 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -61,7 +61,6 @@ tokio-util = { workspace = true, features = ["codec", "compat"] } [dev-dependencies] serial_test = { workspace = true } -solana-address-lookup-table-program = { workspace = true } solana-net-utils = { workspace = true } solana-stake-program = { workspace = true } symlink = { workspace = true } diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs index 90fd6a2a21..ff70bdee11 100644 --- a/rpc/src/rpc.rs +++ b/rpc/src/rpc.rs @@ -4631,7 +4631,6 @@ pub mod tests { jsonrpc_core_client::transports::local, serde::de::DeserializeOwned, solana_accounts_db::{inline_spl_token, inline_spl_token_2022}, - solana_address_lookup_table_program::state::{AddressLookupTable, LookupTableMeta}, solana_entry::entry::next_versioned_entry, solana_gossip::socketaddr, solana_ledger::{ @@ -4653,6 +4652,10 @@ pub mod tests { }, solana_sdk::{ account::{Account, WritableAccount}, + address_lookup_table::{ + self, + state::{AddressLookupTable, LookupTableMeta}, + }, clock::MAX_RECENT_BLOCKHASHES, compute_budget::ComputeBudgetInstruction, fee_calculator::{FeeRateGovernor, DEFAULT_BURN_PERCENT}, @@ -4934,7 +4937,7 @@ pub mod tests { AccountSharedData::create( min_balance_lamports, address_table_data, - solana_address_lookup_table_program::id(), + address_lookup_table::program::id(), false, 0, ) diff --git a/runtime/src/bank/address_lookup_table.rs b/runtime/src/bank/address_lookup_table.rs index 02debe6c1c..07c82acf6d 100644 --- a/runtime/src/bank/address_lookup_table.rs +++ b/runtime/src/bank/address_lookup_table.rs @@ -1,7 +1,7 @@ use { super::Bank, - solana_address_lookup_table_program::error::AddressLookupError, solana_sdk::{ + address_lookup_table::error::AddressLookupError, message::{ v0::{LoadedAddresses, MessageAddressTableLookup}, AddressLoaderError, diff --git a/runtime/src/builtins.rs b/runtime/src/builtins.rs index d692101aaa..5a21424cc3 100644 --- a/runtime/src/builtins.rs +++ b/runtime/src/builtins.rs @@ -91,7 +91,7 @@ pub static BUILTINS: &[BuiltinPrototype] = &[ }, BuiltinPrototype { feature_id: None, - program_id: solana_address_lookup_table_program::id(), + program_id: solana_sdk::address_lookup_table::program::id(), name: "address_lookup_table_program", entrypoint: solana_address_lookup_table_program::processor::process_instruction, }, diff --git a/programs/address-lookup-table/src/error.rs b/sdk/program/src/address_lookup_table/error.rs similarity index 100% rename from programs/address-lookup-table/src/error.rs rename to sdk/program/src/address_lookup_table/error.rs diff --git a/programs/address-lookup-table/src/instruction.rs b/sdk/program/src/address_lookup_table/instruction.rs similarity index 99% rename from programs/address-lookup-table/src/instruction.rs rename to sdk/program/src/address_lookup_table/instruction.rs index 573dbe561a..ccf4bbe3a1 100644 --- a/programs/address-lookup-table/src/instruction.rs +++ b/sdk/program/src/address_lookup_table/instruction.rs @@ -1,12 +1,12 @@ use { - crate::id, - serde::{Deserialize, Serialize}, - solana_program::{ + crate::{ + address_lookup_table::program::id, clock::Slot, instruction::{AccountMeta, Instruction}, pubkey::Pubkey, system_program, }, + serde::{Deserialize, Serialize}, }; #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] @@ -78,6 +78,33 @@ pub fn derive_lookup_table_address( ) } +/// Constructs an instruction to create a table account and returns +/// the instruction and the table account's derived address. +fn create_lookup_table_common( + authority_address: Pubkey, + payer_address: Pubkey, + recent_slot: Slot, + authority_is_signer: bool, +) -> (Instruction, Pubkey) { + let (lookup_table_address, bump_seed) = + derive_lookup_table_address(&authority_address, recent_slot); + let instruction = Instruction::new_with_bincode( + id(), + &ProgramInstruction::CreateLookupTable { + recent_slot, + bump_seed, + }, + vec![ + AccountMeta::new(lookup_table_address, false), + AccountMeta::new_readonly(authority_address, authority_is_signer), + AccountMeta::new(payer_address, true), + AccountMeta::new_readonly(system_program::id(), false), + ], + ); + + (instruction, lookup_table_address) +} + /// Constructs an instruction to create a table account and returns /// the instruction and the table account's derived address. /// @@ -110,33 +137,6 @@ pub fn create_lookup_table( create_lookup_table_common(authority_address, payer_address, recent_slot, false) } -/// Constructs an instruction to create a table account and returns -/// the instruction and the table account's derived address. -fn create_lookup_table_common( - authority_address: Pubkey, - payer_address: Pubkey, - recent_slot: Slot, - authority_is_signer: bool, -) -> (Instruction, Pubkey) { - let (lookup_table_address, bump_seed) = - derive_lookup_table_address(&authority_address, recent_slot); - let instruction = Instruction::new_with_bincode( - id(), - &ProgramInstruction::CreateLookupTable { - recent_slot, - bump_seed, - }, - vec![ - AccountMeta::new(lookup_table_address, false), - AccountMeta::new_readonly(authority_address, authority_is_signer), - AccountMeta::new(payer_address, true), - AccountMeta::new_readonly(system_program::id(), false), - ], - ); - - (instruction, lookup_table_address) -} - /// Constructs an instruction that freezes an address lookup /// table so that it can never be closed or extended again. Empty /// lookup tables cannot be frozen. diff --git a/sdk/program/src/address_lookup_table/mod.rs b/sdk/program/src/address_lookup_table/mod.rs new file mode 100644 index 0000000000..c7a712e459 --- /dev/null +++ b/sdk/program/src/address_lookup_table/mod.rs @@ -0,0 +1,20 @@ +//! The [address lookup table program][np]. +//! +//! [np]: https://docs.solana.com/developing/runtime-facilities/programs#address-lookup-table-program + +pub mod error; +pub mod instruction; +pub mod state; + +pub mod program { + crate::declare_id!("AddressLookupTab1e1111111111111111111111111"); +} + +/// The definition of address lookup table accounts. +/// +/// As used by the `crate::message::v0` message format. +#[derive(Debug, PartialEq, Eq, Clone)] +pub struct AddressLookupTableAccount { + pub key: crate::pubkey::Pubkey, + pub addresses: Vec, +} diff --git a/programs/address-lookup-table/src/state.rs b/sdk/program/src/address_lookup_table/state.rs similarity index 99% rename from programs/address-lookup-table/src/state.rs rename to sdk/program/src/address_lookup_table/state.rs index 610fe6d20c..b5f6640ad4 100644 --- a/programs/address-lookup-table/src/state.rs +++ b/sdk/program/src/address_lookup_table/state.rs @@ -1,8 +1,8 @@ use { - crate::error::AddressLookupError, serde::{Deserialize, Serialize}, solana_frozen_abi_macro::{AbiEnumVisitor, AbiExample}, solana_program::{ + address_lookup_table::error::AddressLookupError, clock::Slot, instruction::InstructionError, pubkey::Pubkey, @@ -17,16 +17,6 @@ pub const LOOKUP_TABLE_MAX_ADDRESSES: usize = 256; /// The serialized size of lookup table metadata pub const LOOKUP_TABLE_META_SIZE: usize = 56; -/// Program account states -#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, AbiExample, AbiEnumVisitor)] -#[allow(clippy::large_enum_variant)] -pub enum ProgramState { - /// Account is not initialized. - Uninitialized, - /// Initialized `LookupTable` account. - LookupTable(LookupTableMeta), -} - /// Activation status of a lookup table #[derive(Debug, PartialEq, Eq, Clone)] pub enum LookupTableStatus { @@ -112,6 +102,16 @@ impl LookupTableMeta { } } +/// Program account states +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, AbiExample, AbiEnumVisitor)] +#[allow(clippy::large_enum_variant)] +pub enum ProgramState { + /// Account is not initialized. + Uninitialized, + /// Initialized `LookupTable` account. + LookupTable(LookupTableMeta), +} + #[derive(Debug, PartialEq, Eq, Clone, AbiExample)] pub struct AddressLookupTable<'a> { pub meta: LookupTableMeta, @@ -218,7 +218,7 @@ impl<'a> AddressLookupTable<'a> { #[cfg(test)] mod tests { - use {super::*, solana_sdk::hash::Hash}; + use {super::*, crate::hash::Hash}; impl AddressLookupTable<'_> { fn new_for_tests(meta: LookupTableMeta, num_addresses: usize) -> Self { diff --git a/sdk/program/src/address_lookup_table_account.rs b/sdk/program/src/address_lookup_table_account.rs deleted file mode 100644 index bbc04259ea..0000000000 --- a/sdk/program/src/address_lookup_table_account.rs +++ /dev/null @@ -1,13 +0,0 @@ -//! The definition of address lookup table accounts. -//! -//! As used by the [`v0` message format][v0]. -//! -//! [v0]: crate::message::v0 - -use solana_program::pubkey::Pubkey; - -#[derive(Debug, PartialEq, Eq, Clone)] -pub struct AddressLookupTableAccount { - pub key: Pubkey, - pub addresses: Vec, -} diff --git a/sdk/program/src/example_mocks.rs b/sdk/program/src/example_mocks.rs index f3873573e0..48f3355710 100644 --- a/sdk/program/src/example_mocks.rs +++ b/sdk/program/src/example_mocks.rs @@ -113,7 +113,7 @@ pub mod solana_rpc_client_nonce_utils { /// programs. pub mod solana_sdk { pub use crate::{ - address_lookup_table_account, hash, instruction, keccak, message, nonce, + hash, instruction, keccak, message, nonce, pubkey::{self, Pubkey}, system_instruction, system_program, sysvar::{ @@ -273,10 +273,20 @@ pub mod solana_sdk { } } } + + #[deprecated( + since = "1.17.0", + note = "Please use `solana_sdk::address_lookup_table` instead" + )] + pub use crate::address_lookup_table as address_lookup_table_account; } +#[deprecated( + since = "1.17.0", + note = "Please use `solana_sdk::address_lookup_table` instead" +)] pub mod solana_address_lookup_table_program { - crate::declare_id!("AddressLookupTab1e1111111111111111111111111"); + pub use crate::address_lookup_table::program::{check_id, id, ID}; pub mod state { use { diff --git a/sdk/program/src/lib.rs b/sdk/program/src/lib.rs index 76d86e1bc8..63da3fa7f1 100644 --- a/sdk/program/src/lib.rs +++ b/sdk/program/src/lib.rs @@ -471,7 +471,7 @@ extern crate self as solana_program; pub mod account_info; -pub mod address_lookup_table_account; +pub mod address_lookup_table; pub mod alt_bn128; pub(crate) mod atomic_u64; pub mod big_mod_exp; @@ -534,6 +534,14 @@ pub mod sysvar; pub mod vote; pub mod wasm; +#[deprecated( + since = "1.17.0", + note = "Please use `solana_sdk::address_lookup_table::AddressLookupTableAccount` instead" +)] +pub mod address_lookup_table_account { + pub use crate::address_lookup_table::AddressLookupTableAccount; +} + #[cfg(target_os = "solana")] pub use solana_sdk_macro::wasm_bindgen_stub as wasm_bindgen; /// Re-export of [wasm-bindgen]. diff --git a/sdk/program/src/message/versions/v0/mod.rs b/sdk/program/src/message/versions/v0/mod.rs index c2f87cf508..eb4b4590b5 100644 --- a/sdk/program/src/message/versions/v0/mod.rs +++ b/sdk/program/src/message/versions/v0/mod.rs @@ -179,24 +179,22 @@ impl Message { /// /// # Examples /// - /// This example uses the [`solana_address_lookup_table_program`], [`solana_rpc_client`], [`solana_sdk`], and [`anyhow`] crates. + /// This example uses the [`solana_rpc_client`], [`solana_sdk`], and [`anyhow`] crates. /// - /// [`solana_address_lookup_table_program`]: https://docs.rs/solana-address-lookup-table-program /// [`solana_rpc_client`]: https://docs.rs/solana-rpc-client /// [`solana_sdk`]: https://docs.rs/solana-sdk /// [`anyhow`]: https://docs.rs/anyhow /// /// ``` /// # use solana_program::example_mocks::{ - /// # solana_address_lookup_table_program, /// # solana_rpc_client, /// # solana_sdk, /// # }; /// # use std::borrow::Cow; /// # use solana_sdk::account::Account; /// use anyhow::Result; - /// use solana_address_lookup_table_program::state::AddressLookupTable; /// use solana_rpc_client::rpc_client::RpcClient; + /// use solana_program::address_lookup_table::{self, state::{AddressLookupTable, LookupTableMeta}}; /// use solana_sdk::{ /// address_lookup_table_account::AddressLookupTableAccount, /// instruction::{AccountMeta, Instruction}, @@ -215,9 +213,10 @@ impl Message { /// # client.set_get_account_response(address_lookup_table_key, Account { /// # lamports: 1, /// # data: AddressLookupTable { + /// # meta: LookupTableMeta::default(), /// # addresses: Cow::Owned(instruction.accounts.iter().map(|meta| meta.pubkey).collect()), /// # }.serialize_for_tests().unwrap(), - /// # owner: solana_address_lookup_table_program::ID, + /// # owner: address_lookup_table::program::id(), /// # executable: false, /// # rent_epoch: 1, /// # }); diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 98b7694a41..825c09e2c3 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -40,20 +40,21 @@ extern crate self as solana_sdk; pub use signer::signers; // These solana_program imports could be *-imported, but that causes a bunch of // confusing duplication in the docs due to a rustdoc bug. #26211 +#[allow(deprecated)] +pub use solana_program::address_lookup_table_account; #[cfg(not(target_os = "solana"))] pub use solana_program::program_stubs; pub use solana_program::{ - account_info, address_lookup_table_account, alt_bn128, big_mod_exp, blake3, borsh, borsh0_10, - borsh0_9, bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, clock, config, - custom_heap_default, custom_panic_default, debug_account_data, declare_deprecated_sysvar_id, - declare_sysvar_id, decode_error, ed25519_program, epoch_rewards, epoch_schedule, - fee_calculator, impl_sysvar_get, incinerator, instruction, keccak, lamports, - loader_instruction, loader_upgradeable_instruction, loader_v4, loader_v4_instruction, message, - msg, native_token, nonce, poseidon, program, program_error, program_memory, program_option, - program_pack, rent, sanitize, sdk_ids, secp256k1_program, secp256k1_recover, serde_varint, - serialize_utils, short_vec, slot_hashes, slot_history, stable_layout, stake, stake_history, - syscalls, system_instruction, system_program, sysvar, unchecked_div_by_const, vote, - wasm_bindgen, + account_info, address_lookup_table, alt_bn128, big_mod_exp, blake3, borsh, borsh0_10, borsh0_9, + bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable, clock, config, custom_heap_default, + custom_panic_default, debug_account_data, declare_deprecated_sysvar_id, declare_sysvar_id, + decode_error, ed25519_program, epoch_rewards, epoch_schedule, fee_calculator, impl_sysvar_get, + incinerator, instruction, keccak, lamports, loader_instruction, loader_upgradeable_instruction, + loader_v4, loader_v4_instruction, message, msg, native_token, nonce, poseidon, program, + program_error, program_memory, program_option, program_pack, rent, sanitize, sdk_ids, + secp256k1_program, secp256k1_recover, serde_varint, serialize_utils, short_vec, slot_hashes, + slot_history, stable_layout, stake, stake_history, syscalls, system_instruction, + system_program, sysvar, unchecked_div_by_const, vote, wasm_bindgen, }; pub mod account; diff --git a/transaction-status/Cargo.toml b/transaction-status/Cargo.toml index 066fd51342..bbdbc6b0bd 100644 --- a/transaction-status/Cargo.toml +++ b/transaction-status/Cargo.toml @@ -22,7 +22,6 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } solana-account-decoder = { workspace = true } -solana-address-lookup-table-program = { workspace = true } solana-sdk = { workspace = true } spl-associated-token-account = { workspace = true, features = ["no-entrypoint"] } spl-memo = { workspace = true, features = ["no-entrypoint"] } diff --git a/transaction-status/src/parse_address_lookup_table.rs b/transaction-status/src/parse_address_lookup_table.rs index f30b61ad7f..94127c8e06 100644 --- a/transaction-status/src/parse_address_lookup_table.rs +++ b/transaction-status/src/parse_address_lookup_table.rs @@ -4,8 +4,10 @@ use { }, bincode::deserialize, serde_json::json, - solana_address_lookup_table_program::instruction::ProgramInstruction, - solana_sdk::{instruction::CompiledInstruction, message::AccountKeys}, + solana_sdk::{ + address_lookup_table::instruction::ProgramInstruction, instruction::CompiledInstruction, + message::AccountKeys, + }, }; pub fn parse_address_lookup_table( @@ -115,8 +117,9 @@ fn check_num_address_lookup_table_accounts( mod test { use { super::*, - solana_address_lookup_table_program::instruction, - solana_sdk::{message::Message, pubkey::Pubkey, system_program}, + solana_sdk::{ + address_lookup_table::instruction, message::Message, pubkey::Pubkey, system_program, + }, std::str::FromStr, }; diff --git a/transaction-status/src/parse_instruction.rs b/transaction-status/src/parse_instruction.rs index 9cab2802d1..0f53c79b57 100644 --- a/transaction-status/src/parse_instruction.rs +++ b/transaction-status/src/parse_instruction.rs @@ -13,8 +13,8 @@ use { serde_json::Value, solana_account_decoder::parse_token::spl_token_ids, solana_sdk::{ - instruction::CompiledInstruction, message::AccountKeys, pubkey::Pubkey, stake, - system_program, vote, + address_lookup_table, instruction::CompiledInstruction, message::AccountKeys, + pubkey::Pubkey, stake, system_program, vote, }, std::{ collections::HashMap, @@ -24,7 +24,7 @@ use { }; lazy_static! { - static ref ADDRESS_LOOKUP_PROGRAM_ID: Pubkey = solana_address_lookup_table_program::id(); + static ref ADDRESS_LOOKUP_PROGRAM_ID: Pubkey = address_lookup_table::program::id(); static ref ASSOCIATED_TOKEN_PROGRAM_ID: Pubkey = spl_associated_token_id(); static ref BPF_LOADER_PROGRAM_ID: Pubkey = solana_sdk::bpf_loader::id(); static ref BPF_UPGRADEABLE_LOADER_PROGRAM_ID: Pubkey = solana_sdk::bpf_loader_upgradeable::id();