Add fee-calculator logging (#11001)

This commit is contained in:
Tyera Eulberg
2020-07-10 18:04:49 -06:00
committed by GitHub
parent 60b1bcddb5
commit 82caa50781
2 changed files with 30 additions and 4 deletions

View File

@ -62,13 +62,26 @@ impl TransactionStatusService {
.zip(balances.post_balances) .zip(balances.post_balances)
{ {
if Bank::can_commit(&status) && !transaction.signatures.is_empty() { if Bank::can_commit(&status) && !transaction.signatures.is_empty() {
let fee_calculator = match hash_age_kind { let (fee_calculator, hash_kind) = match hash_age_kind.clone() {
Some(HashAgeKind::DurableNonce(_, account)) => { Some(HashAgeKind::DurableNonce(_, account)) => {
nonce_utils::fee_calculator_of(&account) info!("nonce_account: {:?}", account);
(nonce_utils::fee_calculator_of(&account), "durable_nonce")
} }
_ => bank.get_fee_calculator(&transaction.message().recent_blockhash), _ => (
bank.get_fee_calculator(&transaction.message().recent_blockhash),
"recent_blockhash",
),
};
if fee_calculator.is_none() {
error!(
"{:?} {:?} fee_calculator: {:?}",
transaction.signatures[0],
hash_kind,
fee_calculator.is_some()
);
info!("{:?}", status);
} }
.expect("FeeCalculator must exist"); let fee_calculator = fee_calculator.expect("FeeCalculator must exist");
let fee = fee_calculator.calculate_fee(transaction.message()); let fee = fee_calculator.calculate_fee(transaction.message());
let (writable_keys, readonly_keys) = let (writable_keys, readonly_keys) =
transaction.message.get_account_keys_by_lock_type(); transaction.message.get_account_keys_by_lock_type();

View File

@ -1537,6 +1537,7 @@ impl Bank {
.map(|(tx, (res, hash_age_kind))| { .map(|(tx, (res, hash_age_kind))| {
let (fee_calculator, is_durable_nonce) = match hash_age_kind { let (fee_calculator, is_durable_nonce) = match hash_age_kind {
Some(HashAgeKind::DurableNonce(_, account)) => { Some(HashAgeKind::DurableNonce(_, account)) => {
info!("nonce_account: {:?}", account);
(nonce_utils::fee_calculator_of(account), true) (nonce_utils::fee_calculator_of(account), true)
} }
_ => ( _ => (
@ -1546,6 +1547,18 @@ impl Bank {
false, false,
), ),
}; };
if fee_calculator.is_none() {
error!(
"{:?} {:?} fee_calculator: {:?}",
tx.signatures[0],
if is_durable_nonce {
"durable_nonce"
} else {
"recent_blockhash"
},
fee_calculator.is_some()
);
}
let fee_calculator = fee_calculator.ok_or(TransactionError::BlockhashNotFound)?; let fee_calculator = fee_calculator.ok_or(TransactionError::BlockhashNotFound)?;
let fee = fee_calculator.calculate_fee(tx.message()); let fee = fee_calculator.calculate_fee(tx.message());