Conversation
431b459 to
76bef9f
Compare
|
|
||
| - uses: actions/checkout@v6 | ||
| with: | ||
| submodules: 'recursive' |
| let mut last_metrics_report = Instant::now(); | ||
| let mut metrics = BamReceiveAndBufferMetrics::default(); | ||
| let mut stats = ReceivingStats::default(); | ||
| let mut prevalidated = Vec::new(); |
There was a problem hiding this comment.
reuse across the containers instead of alloc'ing in the while loop
|
|
||
| Ok(( | ||
| atomic_txn_batch.clone(), | ||
| batch_index, |
| .zip(batch.sanitized_transactions().iter()), | ||
| processed_transactions.into_iter(), | ||
| ); | ||
| self.seq_not_conflict_batch_reusables.set(reusables); |
There was a problem hiding this comment.
don't lose the reusables, otherwise we keep the empty containers
| processed_transactions | ||
| .into_iter() | ||
| .zip(batch.sanitized_transactions().iter()), | ||
| processed_transactions.into_iter(), |
There was a problem hiding this comment.
already zipped above
| type PrevalidationResult = Result<(AtomicTxnBatch, bool, u32, u64), (Reason, u32)>; | ||
| type PrevalidationOutput = (Vec<PrevalidationResult>, ReceivingStats); | ||
|
|
||
| type PrevalidationResult = Result<(usize, bool, u32, u64), (Reason, u32)>; |
|
|
||
| for (transaction, transaction_info) in transactions { | ||
| let account_keys = transaction_info.account_keys(); | ||
| let write_account_locks = account_keys |
There was a problem hiding this comment.
old code does 3 iterations over all account keys for the txn
| .iter() | ||
| .enumerate() | ||
| .filter_map(|(index, key)| (!transaction_info.is_writable(index)).then_some(key)); | ||
| let has_contention = write_account_locks.clone().any(|key| { |
There was a problem hiding this comment.
this is a full iteration over all account keys
| transaction_read_locks.clear(); | ||
| let mut has_contention = false; | ||
| for (key, writable) in | ||
| TransactionAccountLocksIterator::new(transaction_info).accounts_with_is_writable() |
There was a problem hiding this comment.
single iteration over all account keys
| processed_results: vec![ | ||
| TransactionResult::NotCommitted( | ||
| NotCommittedReason::PohTimeout, | ||
| NotCommittedReason::PohTimeout, // Note: ChannelFull, ChannelDisconnected, MaxHeightReached are misreported as a PohTimeout |
37401ad to
b944569
Compare
| fn normalize_bam_url(url_str: &str) -> Result<String, BamUrlError> { | ||
| // If empty, return empty string to disable BAM | ||
| if url_str.trim().is_empty() { | ||
| return Ok(String::new()); |
There was a problem hiding this comment.
this is dangerous
| /// ``` | ||
| pub fn extract_bam_url(matches: &ArgMatches) -> Result<Option<String>, BamUrlError> { | ||
| match matches.value_of("bam_url") { | ||
| Some(url) => normalize_bam_url(url).map(Some), |
There was a problem hiding this comment.
since above always returns Ok(""), we will return Ok(Some("")) here
| ); | ||
| } | ||
|
|
||
| *meta.bam_url.lock().unwrap() = bam_url; |
There was a problem hiding this comment.
this would cause us to store new empty url here
8b07d91 to
2453df2
Compare
| @@ -807,7 +814,7 @@ impl ReceiveAndBuffer for BamReceiveAndBuffer { | |||
|
|
|||
| // If BAM is not enabled, drain the channel | |||
There was a problem hiding this comment.
this would multiply num_dropped_without_parsing for each packet dropped
| } | ||
|
|
||
| pub fn execute(subcommand_matches: &ArgMatches, ledger_path: &Path) -> crate::commands::Result<()> { | ||
| if !subcommand_matches.is_present("bam_url") { |
There was a problem hiding this comment.
don't delete bam config if --bam-url not passed to agave-validator set-bam-config
| jito_protos::proto::bam_types::TransactionError { | ||
| index: index as u32, | ||
| reason: DeserializationErrorReason::SanitizeError as i32, | ||
| reason: TransactionErrorReason::SanitizeFailure as i32, |
There was a problem hiding this comment.
blacklisted account rejection reports a TransactionError with DeserializationErrorReason::SanitizeError as the reason. That enum doesn’t match TransactionErrorReason (it maps to INSUFFICIENT_FUNDS_FOR_FEE), so BAM will see the wrong error code
b144abf to
fd2be04
Compare
Bugs:
agave-validator --ledger /solana/ledger set-bam-configwill stop bam (should have--bam-urlto empty to stop bam), see stoppage at https://jitolabs.grafana.net/goto/ef9gr7lzl9dz4e?orgId=1agave-validator --ledger /solana/ledger set-bam-config --bam-url ""will set url to empty string (not disable! we'd keep trying to connect to"")Perf:
Correctness: