Add check for missing signature with fee'ed transaction
And update fetch-perf-libs version
This commit is contained in:
parent
7dd198a99e
commit
3543a9a49f
|
@ -16,7 +16,7 @@ mkdir -p target/perf-libs
|
||||||
cd target/perf-libs
|
cd target/perf-libs
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
curl https://solana-perf.s3.amazonaws.com/v0.11.0/x86_64-unknown-linux-gnu/solana-perf.tgz | tar zxvf -
|
curl https://solana-perf.s3.amazonaws.com/v0.11.1/x86_64-unknown-linux-gnu/solana-perf.tgz | tar zxvf -
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ -r solana-perf-CUDA_HOME.txt ]]; then
|
if [[ -r solana-perf-CUDA_HOME.txt ]]; then
|
||||||
|
|
|
@ -104,6 +104,9 @@ pub enum BankError {
|
||||||
|
|
||||||
/// Loader call chain too deep
|
/// Loader call chain too deep
|
||||||
CallChainTooDeep,
|
CallChainTooDeep,
|
||||||
|
|
||||||
|
/// Transaction has a fee but has no signature present
|
||||||
|
MissingSignatureForFee,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type Result<T> = result::Result<T, BankError>;
|
pub type Result<T> = result::Result<T, BankError>;
|
||||||
|
@ -637,7 +640,9 @@ impl Bank {
|
||||||
error_counters: &mut ErrorCounters,
|
error_counters: &mut ErrorCounters,
|
||||||
) -> Result<Vec<Account>> {
|
) -> Result<Vec<Account>> {
|
||||||
// Copy all the accounts
|
// Copy all the accounts
|
||||||
if accounts.load(&tx.account_keys[0]).is_none() {
|
if tx.signatures.is_empty() && tx.fee != 0 {
|
||||||
|
Err(BankError::MissingSignatureForFee)
|
||||||
|
} else if accounts.load(&tx.account_keys[0]).is_none() {
|
||||||
error_counters.account_not_found += 1;
|
error_counters.account_not_found += 1;
|
||||||
Err(BankError::AccountNotFound)
|
Err(BankError::AccountNotFound)
|
||||||
} else if accounts.load(&tx.account_keys[0]).unwrap().tokens < tx.fee {
|
} else if accounts.load(&tx.account_keys[0]).unwrap().tokens < tx.fee {
|
||||||
|
|
Loading…
Reference in New Issue