getMinimumBalanceForRentExemption now only responds to valid account lengths
This commit is contained in:
parent
073cee0143
commit
9e96180ce4
|
@ -52,6 +52,7 @@ use solana_sdk::{
|
|||
pubkey::Pubkey,
|
||||
signature::Signature,
|
||||
stake_history::StakeHistory,
|
||||
system_instruction,
|
||||
sysvar::{stake_history, Sysvar},
|
||||
timing::slot_duration_from_slots_per_year,
|
||||
transaction::{self, Transaction},
|
||||
|
@ -1833,6 +1834,9 @@ impl RpcSol for RpcSolImpl {
|
|||
"get_minimum_balance_for_rent_exemption rpc request received: {:?}",
|
||||
data_len
|
||||
);
|
||||
if data_len as u64 > system_instruction::MAX_PERMITTED_DATA_LENGTH {
|
||||
return Err(Error::invalid_request());
|
||||
}
|
||||
Ok(meta.get_minimum_balance_for_rent_exemption(data_len, commitment))
|
||||
}
|
||||
|
||||
|
@ -2539,7 +2543,7 @@ pub mod tests {
|
|||
message::Message,
|
||||
nonce, rpc_port,
|
||||
signature::{Keypair, Signer},
|
||||
system_instruction, system_program, system_transaction,
|
||||
system_program, system_transaction,
|
||||
transaction::{self, TransactionError},
|
||||
};
|
||||
use solana_transaction_status::{EncodedTransaction, TransactionWithStatusMeta, UiMessage};
|
||||
|
|
Loading…
Reference in New Issue