From 7f55a4bc5f670a44459fb352ca1017d3cbd5f3ac Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:51:48 -0600 Subject: [PATCH] v2.0: Remove support for deprecated rpc endpoints (backport of #1809) (#1886) * Remove support for deprecated rpc endpoints (#1809) * Remove rpc_obsolete_v1_7 * Remove rpc_deprecated_v1_7 * Remove rpc_deprecated_v1_9 * Add CHANGELOG entry * Add another CHANGELOG entry (cherry picked from commit 83527d95777b21cdd155a6293ca4fdc740eda7a6) # Conflicts: # CHANGELOG.md * Fix conflict --------- Co-authored-by: Tyera --- CHANGELOG.md | 6 + rpc-test/tests/rpc.rs | 2 +- rpc/src/rpc.rs | 638 +---------------------------------------- rpc/src/rpc_service.rs | 9 +- validator/src/cli.rs | 6 - validator/src/main.rs | 1 - 6 files changed, 12 insertions(+), 650 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34e9b57dc3c368..43b5133e6731e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,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>>; - - // DEPRECATED (used by Trust Wallet) - #[rpc(meta, name = "getSignatureConfirmation")] - fn get_signature_confirmation( - &self, - meta: Self::Metadata, - signature_str: String, - commitment: Option, - ) -> Result>; - - // DEPRECATED - #[rpc(meta, name = "getTotalSupply")] - fn get_total_supply( - &self, - meta: Self::Metadata, - commitment: Option, - ) -> Result; - - // DEPRECATED - #[rpc(meta, name = "getConfirmedSignaturesForAddress")] - fn get_confirmed_signatures_for_address( - &self, - meta: Self::Metadata, - pubkey_str: String, - start_slot: Slot, - end_slot: Slot, - ) -> Result>; - } - - pub struct ObsoleteV1_7Impl; - impl ObsoleteV1_7 for ObsoleteV1_7Impl { - type Metadata = JsonRpcRequestProcessor; - - fn confirm_transaction( - &self, - meta: Self::Metadata, - id: String, - commitment: Option, - ) -> Result> { - debug!("confirm_transaction rpc request received: {:?}", id); - let signature = verify_signature(&id)?; - meta.confirm_transaction(&signature, commitment) - } - - fn get_signature_status( - &self, - meta: Self::Metadata, - signature_str: String, - commitment: Option, - ) -> Result>> { - debug!( - "get_signature_status rpc request received: {:?}", - signature_str - ); - let signature = verify_signature(&signature_str)?; - meta.get_signature_status(signature, commitment) - } - - fn get_signature_confirmation( - &self, - meta: Self::Metadata, - signature_str: String, - commitment: Option, - ) -> Result> { - debug!( - "get_signature_confirmation rpc request received: {:?}", - signature_str - ); - let signature = verify_signature(&signature_str)?; - meta.get_signature_confirmation_status(signature, commitment) - } - - fn get_total_supply( - &self, - meta: Self::Metadata, - commitment: Option, - ) -> Result { - debug!("get_total_supply rpc request received"); - meta.get_total_supply(commitment) - } - - fn get_confirmed_signatures_for_address( - &self, - meta: Self::Metadata, - pubkey_str: String, - start_slot: Slot, - end_slot: Slot, - ) -> Result> { - debug!( - "get_confirmed_signatures_for_address rpc request received: {:?} {:?}-{:?}", - pubkey_str, start_slot, end_slot - ); - let pubkey = verify_pubkey(&pubkey_str)?; - if end_slot < start_slot { - return Err(Error::invalid_params(format!( - "start_slot {start_slot} must be less than or equal to end_slot {end_slot}" - ))); - } - if end_slot - start_slot > MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS_SLOT_RANGE { - return Err(Error::invalid_params(format!( - "Slot range too large; max {MAX_GET_CONFIRMED_SIGNATURES_FOR_ADDRESS_SLOT_RANGE}" - ))); - } - Ok(meta - .get_confirmed_signatures_for_address(pubkey, start_slot, end_slot) - .iter() - .map(|signature| signature.to_string()) - .collect()) - } - } -} - const MAX_BASE58_SIZE: usize = 1683; // Golden, bump if PACKET_DATA_SIZE changes const MAX_BASE64_SIZE: usize = 1644; // Golden, bump if PACKET_DATA_SIZE changes fn decode_and_deserialize( @@ -4937,8 +4450,7 @@ pub fn populate_blockstore_for_tests( pub mod tests { use { super::{ - rpc_accounts::*, rpc_accounts_scan::*, rpc_bank::*, rpc_deprecated_v1_9::*, - rpc_full::*, rpc_minimal::*, *, + rpc_accounts::*, rpc_accounts_scan::*, rpc_bank::*, rpc_full::*, rpc_minimal::*, *, }, crate::{ optimistically_confirmed_bank_tracker::{ @@ -4975,9 +4487,8 @@ pub mod tests { self, state::{AddressLookupTable, LookupTableMeta}, }, - clock::MAX_PROCESSING_AGE, compute_budget::ComputeBudgetInstruction, - fee_calculator::{FeeRateGovernor, DEFAULT_BURN_PERCENT}, + fee_calculator::FeeRateGovernor, hash::{hash, Hash}, instruction::InstructionError, message::{ @@ -5139,7 +4650,6 @@ pub mod tests { io.extend_with(rpc_accounts::AccountsDataImpl.to_delegate()); io.extend_with(rpc_accounts_scan::AccountsScanImpl.to_delegate()); io.extend_with(rpc_full::FullImpl.to_delegate()); - io.extend_with(rpc_deprecated_v1_9::DeprecatedV1_9Impl.to_delegate()); Self { io, meta, @@ -7007,146 +6517,6 @@ pub mod tests { ); } - #[test] - fn test_rpc_get_recent_blockhash() { - let rpc = RpcHandler::start(); - let bank = rpc.working_bank(); - let recent_blockhash = bank.confirmed_last_blockhash(); - let RpcHandler { meta, io, .. } = rpc; - - let req = r#"{"jsonrpc":"2.0","id":1,"method":"getRecentBlockhash"}"#; - let res = io.handle_request_sync(req, meta); - let expected = json!({ - "jsonrpc": "2.0", - "result": { - "context": {"slot": 0, "apiVersion": RpcApiVersion::default()}, - "value":{ - "blockhash": recent_blockhash.to_string(), - "feeCalculator": { - "lamportsPerSignature": TEST_SIGNATURE_FEE, - } - }, - }, - "id": 1 - }); - let expected: Response = - serde_json::from_value(expected).expect("expected response deserialization"); - let result: Response = serde_json::from_str(&res.expect("actual response")) - .expect("actual response deserialization"); - assert_eq!(result, expected); - } - - #[test] - fn test_rpc_get_fees() { - let rpc = RpcHandler::start(); - let bank = rpc.working_bank(); - let recent_blockhash = bank.confirmed_last_blockhash(); - let RpcHandler { meta, io, .. } = rpc; - - let req = r#"{"jsonrpc":"2.0","id":1,"method":"getFees"}"#; - let res = io.handle_request_sync(req, meta); - let expected = json!({ - "jsonrpc": "2.0", - "result": { - "context": {"slot": 0, "apiVersion": RpcApiVersion::default()}, - "value": { - "blockhash": recent_blockhash.to_string(), - "feeCalculator": { - "lamportsPerSignature": TEST_SIGNATURE_FEE, - }, - "lastValidSlot": MAX_PROCESSING_AGE, - "lastValidBlockHeight": MAX_PROCESSING_AGE, - }, - }, - "id": 1 - }); - let expected: Response = - serde_json::from_value(expected).expect("expected response deserialization"); - let result: Response = serde_json::from_str(&res.expect("actual response")) - .expect("actual response deserialization"); - assert_eq!(result, expected); - } - - #[test] - fn test_rpc_get_fee_calculator_for_blockhash() { - let rpc = RpcHandler::start(); - let bank = rpc.working_bank(); - let recent_blockhash = bank.confirmed_last_blockhash(); - let RpcHandler { meta, io, .. } = rpc; - - let lamports_per_signature = bank.get_lamports_per_signature(); - let fee_calculator = RpcFeeCalculator { - fee_calculator: FeeCalculator::new(lamports_per_signature), - }; - - let req = format!( - r#"{{"jsonrpc":"2.0","id":1,"method":"getFeeCalculatorForBlockhash","params":["{recent_blockhash:?}"]}}"# - ); - let res = io.handle_request_sync(&req, meta.clone()); - let expected = json!({ - "jsonrpc": "2.0", - "result": { - "context": {"slot": 0, "apiVersion": RpcApiVersion::default()}, - "value":fee_calculator, - }, - "id": 1 - }); - let expected: Response = - serde_json::from_value(expected).expect("expected response deserialization"); - let result: Response = serde_json::from_str(&res.expect("actual response")) - .expect("actual response deserialization"); - assert_eq!(result, expected); - - // Expired (non-existent) blockhash - let req = format!( - r#"{{"jsonrpc":"2.0","id":1,"method":"getFeeCalculatorForBlockhash","params":["{:?}"]}}"#, - Hash::default() - ); - let res = io.handle_request_sync(&req, meta); - let expected = json!({ - "jsonrpc": "2.0", - "result": { - "context": {"slot": 0, "apiVersion": RpcApiVersion::default()}, - "value":Value::Null, - }, - "id": 1 - }); - let expected: Response = - serde_json::from_value(expected).expect("expected response deserialization"); - let result: Response = serde_json::from_str(&res.expect("actual response")) - .expect("actual response deserialization"); - assert_eq!(result, expected); - } - - #[test] - fn test_rpc_get_fee_rate_governor() { - let RpcHandler { meta, io, .. } = RpcHandler::start(); - - let req = r#"{"jsonrpc":"2.0","id":1,"method":"getFeeRateGovernor"}"#; - let res = io.handle_request_sync(req, meta); - let expected = json!({ - "jsonrpc": "2.0", - "result": { - "context": {"slot": 0, "apiVersion": RpcApiVersion::default()}, - "value":{ - "feeRateGovernor": { - "burnPercent": DEFAULT_BURN_PERCENT, - "maxLamportsPerSignature": TEST_SIGNATURE_FEE, - "minLamportsPerSignature": TEST_SIGNATURE_FEE, - "targetLamportsPerSignature": TEST_SIGNATURE_FEE, - "targetSignaturesPerSlot": 0 - } - }, - }, - "id": 1 - }); - let expected: Response = - serde_json::from_value(expected).expect("expected response deserialization"); - let result: Response = serde_json::from_str(&res.expect("actual response")) - .expect("actual response deserialization"); - assert_eq!(result, expected); - } - #[test] fn test_rpc_fail_request_airdrop() { let RpcHandler { meta, io, .. } = RpcHandler::start(); diff --git a/rpc/src/rpc_service.rs b/rpc/src/rpc_service.rs index 00f319f1c27b6f..d22d21c0803d02 100644 --- a/rpc/src/rpc_service.rs +++ b/rpc/src/rpc_service.rs @@ -7,8 +7,7 @@ use { optimistically_confirmed_bank_tracker::OptimisticallyConfirmedBank, rpc::{ rpc_accounts::*, rpc_accounts_scan::*, rpc_bank::*, rpc_deprecated_v1_18::*, - rpc_deprecated_v1_7::*, rpc_deprecated_v1_9::*, rpc_full::*, rpc_minimal::*, - rpc_obsolete_v1_7::*, *, + rpc_full::*, rpc_minimal::*, *, }, rpc_cache::LargestAccountsCache, rpc_health::*, @@ -453,7 +452,6 @@ impl JsonRpcService { }; let full_api = config.full_api; - let obsolete_v1_7_api = config.obsolete_v1_7_api; let max_request_body_size = config .max_request_body_size .unwrap_or(MAX_REQUEST_BODY_SIZE); @@ -508,13 +506,8 @@ impl JsonRpcService { io.extend_with(rpc_accounts::AccountsDataImpl.to_delegate()); io.extend_with(rpc_accounts_scan::AccountsScanImpl.to_delegate()); io.extend_with(rpc_full::FullImpl.to_delegate()); - io.extend_with(rpc_deprecated_v1_7::DeprecatedV1_7Impl.to_delegate()); - io.extend_with(rpc_deprecated_v1_9::DeprecatedV1_9Impl.to_delegate()); io.extend_with(rpc_deprecated_v1_18::DeprecatedV1_18Impl.to_delegate()); } - if obsolete_v1_7_api { - io.extend_with(rpc_obsolete_v1_7::ObsoleteV1_7Impl.to_delegate()); - } let request_middleware = RpcRequestMiddleware::new( ledger_path, diff --git a/validator/src/cli.rs b/validator/src/cli.rs index dc1b783eba8298..f32dd9f5cae8e1 100644 --- a/validator/src/cli.rs +++ b/validator/src/cli.rs @@ -211,12 +211,6 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> { .takes_value(false) .help("Expose RPC methods for querying chain state and transaction history"), ) - .arg( - Arg::with_name("obsolete_v1_7_rpc_api") - .long("enable-rpc-obsolete_v1_7") - .takes_value(false) - .help("Enable the obsolete RPC methods removed in v1.7"), - ) .arg( Arg::with_name("private_rpc") .long("private-rpc") diff --git a/validator/src/main.rs b/validator/src/main.rs index a87f6b3f488d9c..f6cdcdd928eb3a 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -1402,7 +1402,6 @@ pub fn main() { solana_net_utils::parse_host_port(address).expect("failed to parse faucet address") }), full_api, - obsolete_v1_7_api: matches.is_present("obsolete_v1_7_rpc_api"), max_multiple_accounts: Some(value_t_or_exit!( matches, "rpc_max_multiple_accounts",