Store versioned transactions in the ledger, disabled by default (#19139)
* Add support for versioned transactions, but disable by default * merge conflicts * trent's feedback * bump Cargo.lock * Fix transaction error encoding * Rename legacy_transaction method * cargo clippy * Clean up casts, int arithmetic, and unused methods * Check for duplicates in sanitized message conversion * fix clippy * fix new test * Fix bpf conditional compilation for message module
This commit is contained in:
@@ -92,7 +92,7 @@ impl TransactionStatusService {
|
||||
log_messages,
|
||||
rent_debits,
|
||||
) in izip!(
|
||||
&transactions,
|
||||
transactions,
|
||||
statuses,
|
||||
balances.pre_balances,
|
||||
balances.post_balances,
|
||||
@@ -100,20 +100,18 @@ impl TransactionStatusService {
|
||||
token_balances.post_token_balances,
|
||||
inner_instructions_iter,
|
||||
transaction_logs_iter,
|
||||
rent_debits.into_iter(),
|
||||
rent_debits,
|
||||
) {
|
||||
if Bank::can_commit(&status) && !transaction.signatures.is_empty() {
|
||||
if Bank::can_commit(&status) {
|
||||
let fee_calculator = nonce_rollback
|
||||
.map(|nonce_rollback| nonce_rollback.fee_calculator())
|
||||
.unwrap_or_else(|| {
|
||||
#[allow(deprecated)]
|
||||
bank.get_fee_calculator(&transaction.message().recent_blockhash)
|
||||
bank.get_fee_calculator(transaction.message().recent_blockhash())
|
||||
})
|
||||
.expect("FeeCalculator must exist");
|
||||
#[allow(deprecated)]
|
||||
let fee = fee_calculator.calculate_fee(transaction.message());
|
||||
let (writable_keys, readonly_keys) =
|
||||
transaction.message.get_account_keys_by_lock_type();
|
||||
let fee = transaction.message().calculate_fee(&fee_calculator);
|
||||
let tx_account_locks = transaction.get_account_locks();
|
||||
|
||||
let inner_instructions = inner_instructions.map(|inner_instructions| {
|
||||
inner_instructions
|
||||
@@ -146,9 +144,9 @@ impl TransactionStatusService {
|
||||
blockstore
|
||||
.write_transaction_status(
|
||||
slot,
|
||||
transaction.signatures[0],
|
||||
writable_keys,
|
||||
readonly_keys,
|
||||
*transaction.signature(),
|
||||
tx_account_locks.writable,
|
||||
tx_account_locks.readonly,
|
||||
TransactionStatusMeta {
|
||||
status,
|
||||
fee,
|
||||
|
||||
Reference in New Issue
Block a user