Add validator flag to opt in to cpi and logs storage (bp #14922) (#14973)

* Add validator flag to opt in to cpi and logs storage (#14922)

* Add validator flag to opt in to cpi and logs storage

* Default TestValidator to opt-in; allow using in multinode-demo

* No clone

Co-authored-by: Carl Lin <carl@solana.com>
(cherry picked from commit cbb8b79a60)

* TestValidator store cpi and logs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
mergify[bot]
2021-02-02 02:51:35 +00:00
committed by GitHub
parent 86703384dc
commit d9fcd84bc2
11 changed files with 81 additions and 24 deletions

View File

@@ -984,7 +984,11 @@ fn new_banks_from_ledger(
let blockstore = Arc::new(blockstore);
let transaction_history_services =
if config.rpc_addrs.is_some() && config.rpc_config.enable_rpc_transaction_history {
initialize_rpc_transaction_history_services(blockstore.clone(), exit)
initialize_rpc_transaction_history_services(
blockstore.clone(),
exit,
config.rpc_config.enable_cpi_and_log_storage,
)
} else {
TransactionHistoryServices::default()
};
@@ -1153,9 +1157,13 @@ fn backup_and_clear_blockstore(ledger_path: &Path, start_slot: Slot, shred_versi
fn initialize_rpc_transaction_history_services(
blockstore: Arc<Blockstore>,
exit: &Arc<AtomicBool>,
enable_cpi_and_log_storage: bool,
) -> TransactionHistoryServices {
let (transaction_status_sender, transaction_status_receiver) = unbounded();
let transaction_status_sender = Some(transaction_status_sender);
let transaction_status_sender = Some(TransactionStatusSender {
sender: transaction_status_sender,
enable_cpi_and_log_storage,
});
let transaction_status_service = Some(TransactionStatusService::new(
transaction_status_receiver,
blockstore.clone(),