Skip to content

Commit

Permalink
SVM: Move nonce_info from SDK to SVM (#1228)
Browse files Browse the repository at this point in the history
because it's not something we want to be subjected to the backwards compatibility policy.
  • Loading branch information
dmakarov authored May 8, 2024
1 parent 9b1bae0 commit b284eb0
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
5 changes: 3 additions & 2 deletions accounts-db/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ use {
state::{DurableNonce, Versions as NonceVersions},
State as NonceState,
},
nonce_info::{NonceFull, NonceInfo},
pubkey::Pubkey,
slot_hashes::SlotHashes,
transaction::{Result, SanitizedTransaction, TransactionAccountLocks, TransactionError},
transaction_context::TransactionAccount,
},
solana_svm::{
account_loader::TransactionLoadResult, transaction_results::TransactionExecutionResult,
account_loader::TransactionLoadResult,
nonce_info::{NonceFull, NonceInfo},
transaction_results::TransactionExecutionResult,
},
std::{
cmp::Reverse,
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/transaction_status_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ pub(crate) mod tests {
message::{LegacyMessage, Message, MessageHeader, SanitizedMessage},
nonce::{self, state::DurableNonce},
nonce_account,
nonce_info::{NonceFull, NoncePartial},
pubkey::Pubkey,
rent_debits::RentDebits,
reserved_account_keys::ReservedAccountKeys,
Expand All @@ -233,6 +232,7 @@ pub(crate) mod tests {
VersionedTransaction,
},
},
solana_svm::nonce_info::{NonceFull, NoncePartial},
solana_transaction_status::{
token_balances::TransactionTokenBalancesSet, TransactionStatusMeta,
TransactionTokenBalance,
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ use {
native_token::LAMPORTS_PER_SOL,
nonce::{self, state::DurableNonce, NONCED_TX_MARKER_IX_INDEX},
nonce_account,
nonce_info::{NonceInfo, NoncePartial},
packet::PACKET_DATA_SIZE,
precompiles::get_precompiles,
pubkey::Pubkey,
Expand Down Expand Up @@ -167,6 +166,7 @@ use {
solana_svm::{
account_loader::{TransactionCheckResult, TransactionLoadResult},
account_overrides::AccountOverrides,
nonce_info::{NonceInfo, NoncePartial},
program_loader::load_program_with_pubkey,
transaction_error_metrics::TransactionErrorMetrics,
transaction_processing_callback::TransactionProcessingCallback,
Expand Down
3 changes: 1 addition & 2 deletions runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ use {
native_loader,
native_token::{sol_to_lamports, LAMPORTS_PER_SOL},
nonce::{self, state::DurableNonce},
nonce_info::NonceFull,
packet::PACKET_DATA_SIZE,
poh_config::PohConfig,
program::MAX_RETURN_DATA,
Expand All @@ -102,7 +101,7 @@ use {
transaction_context::TransactionAccount,
},
solana_stake_program::stake_state::{self, StakeStateV2},
solana_svm::transaction_results::DurableNonceFee,
solana_svm::{nonce_info::NonceFull, transaction_results::DurableNonceFee},
solana_vote_program::{
vote_instruction,
vote_state::{
Expand Down
1 change: 0 additions & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ pub mod log;
pub mod native_loader;
pub mod net;
pub mod nonce_account;
pub mod nonce_info;
pub mod offchain_message;
pub mod packet;
pub mod poh_config;
Expand Down
7 changes: 4 additions & 3 deletions svm/src/account_loader.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use {
crate::{
account_overrides::AccountOverrides, account_rent_state::RentState,
account_overrides::AccountOverrides,
account_rent_state::RentState,
nonce_info::{NonceFull, NoncePartial},
transaction_error_metrics::TransactionErrorMetrics,
transaction_processing_callback::TransactionProcessingCallback,
},
Expand All @@ -19,7 +21,6 @@ use {
message::SanitizedMessage,
native_loader,
nonce::State as NonceState,
nonce_info::{NonceFull, NoncePartial},
pubkey::Pubkey,
rent::RentDue,
rent_collector::{RentCollector, RENT_EXEMPT_RENT_EPOCH},
Expand Down Expand Up @@ -449,6 +450,7 @@ mod tests {
use {
super::*,
crate::{
nonce_info::{NonceFull, NoncePartial},
transaction_account_state_info::TransactionAccountStateInfo,
transaction_processing_callback::TransactionProcessingCallback,
},
Expand All @@ -475,7 +477,6 @@ mod tests {
native_loader,
native_token::sol_to_lamports,
nonce,
nonce_info::{NonceFull, NoncePartial},
pubkey::Pubkey,
rent::Rent,
rent_collector::{RentCollector, RENT_EXEMPT_RENT_EPOCH},
Expand Down
1 change: 1 addition & 0 deletions svm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod account_loader;
pub mod account_overrides;
pub mod account_rent_state;
pub mod message_processor;
pub mod nonce_info;
pub mod program_loader;
pub mod runtime_config;
pub mod transaction_account_state_info;
Expand Down
5 changes: 2 additions & 3 deletions sdk/src/nonce_info.rs → svm/src/nonce_info.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(feature = "full")]
use crate::{
use solana_sdk::{
account::{AccountSharedData, ReadableAccount, WritableAccount},
message::SanitizedMessage,
nonce_account,
Expand Down Expand Up @@ -109,7 +108,7 @@ impl NonceInfo for NonceFull {
mod tests {
use {
super::*,
crate::{
solana_sdk::{
hash::Hash,
instruction::Instruction,
message::Message,
Expand Down
2 changes: 1 addition & 1 deletion svm/src/transaction_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
)]
pub use solana_sdk::inner_instruction::{InnerInstruction, InnerInstructionsList};
use {
crate::nonce_info::{NonceFull, NonceInfo},
solana_program_runtime::loaded_programs::ProgramCacheForTxBatch,
solana_sdk::{
nonce_info::{NonceFull, NonceInfo},
rent_debits::RentDebits,
transaction::{self, TransactionError},
transaction_context::TransactionReturnData,
Expand Down

0 comments on commit b284eb0

Please sign in to comment.