From 4fd75a1bb313474e5c715f87552f48492eb30b14 Mon Sep 17 00:00:00 2001 From: Tyera Date: Fri, 28 Jun 2024 19:13:14 -0600 Subject: [PATCH] Remove rpc endpoint deprecated in v1.18 (#1897) * Remove rpc_deprecated_v1_18 * Update changelog * Fixup redelegation test (cherry picked from commit 99b2d5ad60c1163620befd3340a5a38a084037a9) --- CHANGELOG.md | 2 +- rpc/src/rpc.rs | 36 ------------------------------------ rpc/src/rpc_service.rs | 6 +----- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d2b933269a53..0b603c7cf98c76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ Release channels have their own copy of this changelog: confirmTransaction, getSignatureStatus, getSignatureConfirmation, getTotalSupply, getConfirmedSignaturesForAddress, getConfirmedBlock, getConfirmedBlocks, getConfirmedBlocksWithLimit, getConfirmedTransaction, getConfirmedSignaturesForAddress2, getRecentBlockhash, getFees, - getFeeCalculatorForBlockhash, getFeeRateGovernor, getSnapshotSlot + getFeeCalculatorForBlockhash, getFeeRateGovernor, getSnapshotSlot getStakeActivation * `--enable-rpc-obsolete_v1_7` flag removed * Changes * `central-scheduler` as default option for `--block-production-method` (#34891) diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs index 4749be383b90c6..51c651b481aa71 100644 --- a/rpc/src/rpc.rs +++ b/rpc/src/rpc.rs @@ -4240,42 +4240,6 @@ fn rpc_perf_sample_from_perf_sample(slot: u64, sample: PerfSample) -> RpcPerfSam } } -pub mod rpc_deprecated_v1_18 { - use super::*; - #[rpc] - pub trait DeprecatedV1_18 { - type Metadata; - - // DEPRECATED - #[rpc(meta, name = "getStakeActivation")] - fn get_stake_activation( - &self, - meta: Self::Metadata, - pubkey_str: String, - config: Option, - ) -> Result; - } - - pub struct DeprecatedV1_18Impl; - impl DeprecatedV1_18 for DeprecatedV1_18Impl { - type Metadata = JsonRpcRequestProcessor; - - fn get_stake_activation( - &self, - meta: Self::Metadata, - pubkey_str: String, - config: Option, - ) -> Result { - debug!( - "get_stake_activation rpc request received: {:?}", - pubkey_str - ); - let pubkey = verify_pubkey(&pubkey_str)?; - meta.get_stake_activation(&pubkey, config) - } - } -} - 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( diff --git a/rpc/src/rpc_service.rs b/rpc/src/rpc_service.rs index d22d21c0803d02..fed748d709472b 100644 --- a/rpc/src/rpc_service.rs +++ b/rpc/src/rpc_service.rs @@ -5,10 +5,7 @@ use { cluster_tpu_info::ClusterTpuInfo, max_slots::MaxSlots, optimistically_confirmed_bank_tracker::OptimisticallyConfirmedBank, - rpc::{ - rpc_accounts::*, rpc_accounts_scan::*, rpc_bank::*, rpc_deprecated_v1_18::*, - rpc_full::*, rpc_minimal::*, *, - }, + rpc::{rpc_accounts::*, rpc_accounts_scan::*, rpc_bank::*, rpc_full::*, rpc_minimal::*, *}, rpc_cache::LargestAccountsCache, rpc_health::*, }, @@ -506,7 +503,6 @@ 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_18::DeprecatedV1_18Impl.to_delegate()); } let request_middleware = RpcRequestMiddleware::new(