Skip to content

Commit

Permalink
v2.0: Remove rpc endpoint deprecated in v1.18 (backport of anza-xyz#1897
Browse files Browse the repository at this point in the history
) (anza-xyz#1926)

Remove rpc endpoint deprecated in v1.18 (anza-xyz#1897)

* Remove rpc_deprecated_v1_18

* Update changelog

* Fixup redelegation test

(cherry picked from commit 99b2d5a)

Co-authored-by: Tyera <tyera@anza.xyz>
  • Loading branch information
2 people authored and neutrinoks committed Jul 17, 2024
1 parent cacc847 commit d9ed63e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 42 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
* Deprecated methods are removed from `RpcClient` and `RpcClient::nonblocking`
* Changes
Expand Down
36 changes: 0 additions & 36 deletions rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RpcEpochConfig>,
) -> Result<RpcStakeActivation>;
}

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<RpcEpochConfig>,
) -> Result<RpcStakeActivation> {
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<T>(
Expand Down
6 changes: 1 addition & 5 deletions rpc/src/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*,
},
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d9ed63e

Please sign in to comment.