Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
priortise txns (#95)
Browse files Browse the repository at this point in the history
* priortise txns

* swap priority order for txns and reqs
  • Loading branch information
move47 authored Apr 23, 2024
1 parent 84ca4eb commit fd64499
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/builder_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,25 @@ impl<TYPES: NodeType> BuilderProgress<TYPES> for BuilderState<TYPES> {
let _builder_handle = async_spawn(async move {
loop {
tracing::debug!("Builder event loop");

// read all the available txns from the channel and process them
while let Ok(tx) = self.tx_receiver.try_recv() {
if let MessageType::TransactionMessage(rtx_msg) = tx {
tracing::debug!(
"Received tx msg in builder {:?}:\n {:?}",
self.built_from_proposed_block,
rtx_msg.tx.commit()
);
if rtx_msg.tx_type == TransactionSource::HotShot {
self.process_hotshot_transaction(rtx_msg.tx);
} else {
self.process_external_transaction(rtx_msg.tx);
}
tracing::debug!("tx map size: {}", self.tx_hash_to_available_txns.len());
}
}

// read all the available requests from the channel and process them
while let Ok(req) = self.req_receiver.try_recv() {
tracing::debug!(
"Received request msg in builder {:?}: {:?}",
Expand Down

0 comments on commit fd64499

Please sign in to comment.