Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 17b1b56

Browse files
author
Tyera
authored
rpc: turn off getStakeActivation epoch parameter (#33156)
* Return error on past-epoch parameter * Update docs
1 parent 05622c1 commit 17b1b56

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

docs/src/api/methods/_getStakeActivation.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Configuration object containing the following fields:
4141
<Field name="epoch" type="u64" optional={true}>
4242
epoch for which to calculate activation details. If parameter not provided,
4343
defaults to current epoch.
44+
**DEPRECATED**, inputs other than the current epoch return an error.
4445
</Field>
4546

4647
</Parameter>

rpc/src/rpc.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,14 +1719,10 @@ impl JsonRpcRequestProcessor {
17191719
min_context_slot: config.min_context_slot,
17201720
})?;
17211721
let epoch = config.epoch.unwrap_or_else(|| bank.epoch());
1722-
if bank.epoch().saturating_sub(epoch) > solana_sdk::stake_history::MAX_ENTRIES as u64 {
1722+
if epoch != bank.epoch() {
17231723
return Err(Error::invalid_params(format!(
1724-
"Invalid param: epoch {epoch:?} is too far in the past"
1725-
)));
1726-
}
1727-
if epoch > bank.epoch() {
1728-
return Err(Error::invalid_params(format!(
1729-
"Invalid param: epoch {epoch:?} has not yet started"
1724+
"Invalid param: epoch {epoch:?}. Only the current epoch ({:?}) is supported",
1725+
bank.epoch()
17301726
)));
17311727
}
17321728

0 commit comments

Comments
 (0)