Skip to content

Commit 1fed095

Browse files
authored
fix: remove bundle polling for now; update logging level (#29)
* fix: remove bundle polling for now * drive-by: add logging, update logging level to info
1 parent 9e74869 commit 1fed095

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/tasks/block.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ impl BlockBuilder {
128128
}
129129

130130
async fn get_transactions(&mut self, in_progress: &mut InProgressBlock) {
131+
tracing::info!("query transactions from cache");
131132
let txns = self.tx_poller.check_tx_cache().await;
132133
match txns {
133134
Ok(txns) => {
135+
tracing::info!("got transactions response");
134136
for txn in txns.into_iter() {
135137
in_progress.ingest_tx(&txn);
136138
}
@@ -142,10 +144,12 @@ impl BlockBuilder {
142144
self.tx_poller.evict();
143145
}
144146

145-
async fn get_bundles(&mut self, in_progress: &mut InProgressBlock) {
147+
async fn _get_bundles(&mut self, in_progress: &mut InProgressBlock) {
148+
tracing::info!("query bundles from cache");
146149
let bundles = self.bundle_poller.check_bundle_cache().await;
147150
match bundles {
148151
Ok(bundles) => {
152+
tracing::info!("got bundles response");
149153
for bundle in bundles {
150154
in_progress.ingest_bundle(bundle);
151155
}
@@ -177,23 +181,25 @@ impl BlockBuilder {
177181
loop {
178182
// sleep the buffer time
179183
tokio::time::sleep(Duration::from_secs(self.secs_to_next_target())).await;
180-
tracing::trace!("beginning block build cycle");
184+
tracing::info!("beginning block build cycle");
181185

182186
// Build a block
183187
let mut in_progress = InProgressBlock::default();
184188
self.get_transactions(&mut in_progress).await;
185-
self.get_bundles(&mut in_progress).await;
189+
190+
// TODO: Implement bundle ingestion #later
191+
// self.get_bundles(&mut in_progress).await;
186192

187193
// submit the block if it has transactions
188194
if !in_progress.is_empty() {
189-
tracing::debug!(txns = in_progress.len(), "sending block to submit task");
195+
tracing::info!(txns = in_progress.len(), "sending block to submit task");
190196
let in_progress_block = std::mem::take(&mut in_progress);
191197
if outbound.send(in_progress_block).is_err() {
192198
tracing::debug!("downstream task gone");
193199
break;
194200
}
195201
} else {
196-
tracing::debug!("no transactions, skipping block submission");
202+
tracing::info!("no transactions, skipping block submission");
197203
}
198204
}
199205
}

0 commit comments

Comments
 (0)