diff --git a/CHANGELOG.md b/CHANGELOG.md
index 29cad14602c508..118edd898ca416 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,7 +14,6 @@ Release channels have their own copy of this changelog:
## [2.1.0] - Unreleased
-
* Changes
* SDK: removed the `respan` macro. This was marked as "internal use only" and was no longer used internally.
@@ -22,6 +21,12 @@ Release channels have their own copy of this changelog:
* Breaking
* SDK: Support for Borsh v0.9 removed, please use v1 or v0.10 (#1440)
* SDK: `Copy` is no longer derived on `Rent` and `EpochSchedule`, please switch to using `clone()` (solana-labs#32767)
+ * RPC: obsolete and deprecated v1 endpoints are removed. These endpoints are:
+ confirmTransaction, getSignatureStatus, getSignatureConfirmation, getTotalSupply,
+ getConfirmedSignaturesForAddress, getConfirmedBlock, getConfirmedBlocks, getConfirmedBlocksWithLimit,
+ getConfirmedTransaction, getConfirmedSignaturesForAddress2, getRecentBlockhash, getFees,
+ getFeeCalculatorForBlockhash, getFeeRateGovernor, getSnapshotSlot
+ * `--enable-rpc-obsolete_v1_7` flag removed
* Changes
* `central-scheduler` as default option for `--block-production-method` (#34891)
* `solana-rpc-client-api`: `RpcFilterError` depends on `base64` version 0.22, so users may need to upgrade to `base64` version 0.22
diff --git a/rpc-test/tests/rpc.rs b/rpc-test/tests/rpc.rs
index 19bf50d2e4341b..463e2046867346 100644
--- a/rpc-test/tests/rpc.rs
+++ b/rpc-test/tests/rpc.rs
@@ -77,7 +77,7 @@ fn test_rpc_send_tx() {
let bob_pubkey = solana_sdk::pubkey::new_rand();
- let req = json_req!("getRecentBlockhash", json!([]));
+ let req = json_req!("getLatestBlockhash", json!([]));
let json = post_rpc(req, &rpc_url);
let blockhash: Hash = json["result"]["value"]["blockhash"]
diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs
index cb7d1c961aa2f7..4749be383b90c6 100644
--- a/rpc/src/rpc.rs
+++ b/rpc/src/rpc.rs
@@ -39,13 +39,12 @@ use {
solana_rpc_client_api::{
config::*,
custom_error::RpcCustomError,
- deprecated_config::*,
filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType},
request::{
TokenAccountsFilter, DELINQUENT_VALIDATOR_SLOT_DISTANCE,
MAX_GET_CONFIRMED_BLOCKS_RANGE, MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS2_LIMIT,
- MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS_SLOT_RANGE, MAX_GET_PROGRAM_ACCOUNT_FILTERS,
- MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS, MAX_GET_SLOT_LEADERS, MAX_MULTIPLE_ACCOUNTS,
+ MAX_GET_PROGRAM_ACCOUNT_FILTERS, MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS,
+ MAX_GET_SLOT_LEADERS, MAX_MULTIPLE_ACCOUNTS,
MAX_RPC_VOTE_ACCOUNT_INFO_EPOCH_CREDITS_HISTORY, NUM_LARGEST_ACCOUNTS,
},
response::{Response as RpcResponse, *},
@@ -70,7 +69,6 @@ use {
epoch_schedule::EpochSchedule,
exit::Exit,
feature_set,
- fee_calculator::FeeCalculator,
hash::Hash,
message::SanitizedMessage,
pubkey::{Pubkey, PUBKEY_BYTES},
@@ -158,7 +156,6 @@ pub struct JsonRpcConfig {
pub rpc_threads: usize,
pub rpc_niceness_adj: i8,
pub full_api: bool,
- pub obsolete_v1_7_api: bool,
pub rpc_scan_and_fix_roots: bool,
pub max_request_body_size: Option,
/// Disable the health check, used for tests and TestValidator
@@ -802,75 +799,6 @@ impl JsonRpcRequestProcessor {
Ok(new_response(&bank, bank.get_balance(pubkey)))
}
- fn get_recent_blockhash(
- &self,
- commitment: Option,
- ) -> Result> {
- let bank = self.bank(commitment);
- let blockhash = bank.confirmed_last_blockhash();
- let lamports_per_signature = bank
- .get_lamports_per_signature_for_blockhash(&blockhash)
- .unwrap();
- Ok(new_response(
- &bank,
- RpcBlockhashFeeCalculator {
- blockhash: blockhash.to_string(),
- fee_calculator: FeeCalculator::new(lamports_per_signature),
- },
- ))
- }
-
- fn get_fees(&self, commitment: Option) -> Result> {
- let bank = self.bank(commitment);
- let blockhash = bank.confirmed_last_blockhash();
- let lamports_per_signature = bank
- .get_lamports_per_signature_for_blockhash(&blockhash)
- .unwrap();
- #[allow(deprecated)]
- let last_valid_slot = bank
- .get_blockhash_last_valid_slot(&blockhash)
- .expect("bank blockhash queue should contain blockhash");
- let last_valid_block_height = bank
- .get_blockhash_last_valid_block_height(&blockhash)
- .expect("bank blockhash queue should contain blockhash");
- Ok(new_response(
- &bank,
- RpcFees {
- blockhash: blockhash.to_string(),
- fee_calculator: FeeCalculator::new(lamports_per_signature),
- last_valid_slot,
- last_valid_block_height,
- },
- ))
- }
-
- fn get_fee_calculator_for_blockhash(
- &self,
- blockhash: &Hash,
- commitment: Option,
- ) -> Result>> {
- let bank = self.bank(commitment);
- let lamports_per_signature = bank.get_lamports_per_signature_for_blockhash(blockhash);
- Ok(new_response(
- &bank,
- lamports_per_signature.map(|lamports_per_signature| RpcFeeCalculator {
- fee_calculator: FeeCalculator::new(lamports_per_signature),
- }),
- ))
- }
-
- fn get_fee_rate_governor(&self) -> RpcResponse {
- let bank = self.bank(None);
- #[allow(deprecated)]
- let fee_rate_governor = bank.get_fee_rate_governor();
- new_response(
- &bank,
- RpcFeeRateGovernor {
- fee_rate_governor: fee_rate_governor.clone(),
- },
- )
- }
-
pub fn confirm_transaction(
&self,
signature: &Signature,
@@ -971,11 +899,6 @@ impl JsonRpcRequestProcessor {
Ok(bank.transaction_count())
}
- fn get_total_supply(&self, commitment: Option) -> Result {
- let bank = self.bank(commitment);
- Ok(bank.capitalization())
- }
-
fn get_cached_largest_accounts(
&self,
filter: &Option,
@@ -4353,416 +4276,6 @@ pub mod rpc_deprecated_v1_18 {
}
}
-// RPC methods deprecated in v1.9
-pub mod rpc_deprecated_v1_9 {
- #![allow(deprecated)]
- use super::*;
- #[rpc]
- pub trait DeprecatedV1_9 {
- type Metadata;
-
- #[rpc(meta, name = "getRecentBlockhash")]
- fn get_recent_blockhash(
- &self,
- meta: Self::Metadata,
- commitment: Option,
- ) -> Result>;
-
- #[rpc(meta, name = "getFees")]
- fn get_fees(
- &self,
- meta: Self::Metadata,
- commitment: Option,
- ) -> Result>;
-
- #[rpc(meta, name = "getFeeCalculatorForBlockhash")]
- fn get_fee_calculator_for_blockhash(
- &self,
- meta: Self::Metadata,
- blockhash: String,
- commitment: Option,
- ) -> Result>>;
-
- #[rpc(meta, name = "getFeeRateGovernor")]
- fn get_fee_rate_governor(
- &self,
- meta: Self::Metadata,
- ) -> Result>;
-
- #[rpc(meta, name = "getSnapshotSlot")]
- fn get_snapshot_slot(&self, meta: Self::Metadata) -> Result;
- }
-
- pub struct DeprecatedV1_9Impl;
- impl DeprecatedV1_9 for DeprecatedV1_9Impl {
- type Metadata = JsonRpcRequestProcessor;
-
- fn get_recent_blockhash(
- &self,
- meta: Self::Metadata,
- commitment: Option,
- ) -> Result> {
- debug!("get_recent_blockhash rpc request received");
- meta.get_recent_blockhash(commitment)
- }
-
- fn get_fees(
- &self,
- meta: Self::Metadata,
- commitment: Option,
- ) -> Result> {
- debug!("get_fees rpc request received");
- meta.get_fees(commitment)
- }
-
- fn get_fee_calculator_for_blockhash(
- &self,
- meta: Self::Metadata,
- blockhash: String,
- commitment: Option,
- ) -> Result>> {
- debug!("get_fee_calculator_for_blockhash rpc request received");
- let blockhash =
- Hash::from_str(&blockhash).map_err(|e| Error::invalid_params(format!("{e:?}")))?;
- meta.get_fee_calculator_for_blockhash(&blockhash, commitment)
- }
-
- fn get_fee_rate_governor(
- &self,
- meta: Self::Metadata,
- ) -> Result> {
- debug!("get_fee_rate_governor rpc request received");
- Ok(meta.get_fee_rate_governor())
- }
-
- fn get_snapshot_slot(&self, meta: Self::Metadata) -> Result {
- debug!("get_snapshot_slot rpc request received");
-
- meta.snapshot_config
- .and_then(|snapshot_config| {
- snapshot_utils::get_highest_full_snapshot_archive_slot(
- snapshot_config.full_snapshot_archives_dir,
- )
- })
- .ok_or_else(|| RpcCustomError::NoSnapshot.into())
- }
- }
-}
-
-// RPC methods deprecated in v1.7
-pub mod rpc_deprecated_v1_7 {
- #![allow(deprecated)]
- use super::*;
- #[rpc]
- pub trait DeprecatedV1_7 {
- type Metadata;
-
- // DEPRECATED
- #[rpc(meta, name = "getConfirmedBlock")]
- fn get_confirmed_block(
- &self,
- meta: Self::Metadata,
- slot: Slot,
- config: Option>,
- ) -> BoxFuture>>;
-
- // DEPRECATED
- #[rpc(meta, name = "getConfirmedBlocks")]
- fn get_confirmed_blocks(
- &self,
- meta: Self::Metadata,
- start_slot: Slot,
- config: Option,
- commitment: Option,
- ) -> BoxFuture>>;
-
- // DEPRECATED
- #[rpc(meta, name = "getConfirmedBlocksWithLimit")]
- fn get_confirmed_blocks_with_limit(
- &self,
- meta: Self::Metadata,
- start_slot: Slot,
- limit: usize,
- commitment: Option,
- ) -> BoxFuture>>;
-
- // DEPRECATED
- #[rpc(meta, name = "getConfirmedTransaction")]
- fn get_confirmed_transaction(
- &self,
- meta: Self::Metadata,
- signature_str: String,
- config: Option>,
- ) -> BoxFuture>>;
-
- // DEPRECATED
- #[rpc(meta, name = "getConfirmedSignaturesForAddress2")]
- fn get_confirmed_signatures_for_address2(
- &self,
- meta: Self::Metadata,
- address: String,
- config: Option,
- ) -> BoxFuture>>;
- }
-
- pub struct DeprecatedV1_7Impl;
- impl DeprecatedV1_7 for DeprecatedV1_7Impl {
- type Metadata = JsonRpcRequestProcessor;
-
- fn get_confirmed_block(
- &self,
- meta: Self::Metadata,
- slot: Slot,
- config: Option>,
- ) -> BoxFuture>> {
- debug!("get_confirmed_block rpc request received: {:?}", slot);
- Box::pin(async move {
- meta.get_block(slot, config.map(|config| config.convert()))
- .await
- })
- }
-
- fn get_confirmed_blocks(
- &self,
- meta: Self::Metadata,
- start_slot: Slot,
- config: Option,
- commitment: Option,
- ) -> BoxFuture>> {
- let (end_slot, maybe_commitment) =
- config.map(|config| config.unzip()).unwrap_or_default();
- debug!(
- "get_confirmed_blocks rpc request received: {}-{:?}",
- start_slot, end_slot
- );
- Box::pin(async move {
- meta.get_blocks(
- start_slot,
- end_slot,
- Some(RpcContextConfig {
- commitment: commitment.or(maybe_commitment),
- min_context_slot: None,
- }),
- )
- .await
- })
- }
-
- fn get_confirmed_blocks_with_limit(
- &self,
- meta: Self::Metadata,
- start_slot: Slot,
- limit: usize,
- commitment: Option,
- ) -> BoxFuture>> {
- debug!(
- "get_confirmed_blocks_with_limit rpc request received: {}-{}",
- start_slot, limit,
- );
- Box::pin(async move {
- meta.get_blocks_with_limit(
- start_slot,
- limit,
- Some(RpcContextConfig {
- commitment,
- min_context_slot: None,
- }),
- )
- .await
- })
- }
-
- fn get_confirmed_transaction(
- &self,
- meta: Self::Metadata,
- signature_str: String,
- config: Option>,
- ) -> BoxFuture>> {
- debug!(
- "get_confirmed_transaction rpc request received: {:?}",
- signature_str
- );
- let signature = verify_signature(&signature_str);
- if let Err(err) = signature {
- return Box::pin(future::err(err));
- }
- Box::pin(async move {
- meta.get_transaction(signature.unwrap(), config.map(|config| config.convert()))
- .await
- })
- }
-
- fn get_confirmed_signatures_for_address2(
- &self,
- meta: Self::Metadata,
- address: String,
- config: Option,
- ) -> BoxFuture>> {
- let config = config.unwrap_or_default();
- let commitment = config.commitment;
- let verification = verify_and_parse_signatures_for_address_params(
- address,
- config.before,
- config.until,
- config.limit,
- );
-
- match verification {
- Err(err) => Box::pin(future::err(err)),
- Ok((address, before, until, limit)) => Box::pin(async move {
- meta.get_signatures_for_address(
- address,
- before,
- until,
- limit,
- RpcContextConfig {
- commitment,
- min_context_slot: None,
- },
- )
- .await
- }),
- }
- }
- }
-}
-
-// Obsolete RPC methods, collected for easy deactivation and removal
-pub mod rpc_obsolete_v1_7 {
- use super::*;
- #[rpc]
- pub trait ObsoleteV1_7 {
- type Metadata;
-
- // DEPRECATED
- #[rpc(meta, name = "confirmTransaction")]
- fn confirm_transaction(
- &self,
- meta: Self::Metadata,
- signature_str: String,
- commitment: Option,
- ) -> Result>;
-
- // DEPRECATED
- #[rpc(meta, name = "getSignatureStatus")]
- fn get_signature_status(
- &self,
- meta: Self::Metadata,
- signature_str: String,
- commitment: Option,
- ) -> Result