Skip to content

Commit 7d94b96

Browse files
authored
fix: disable DCI queries on Base and Unichain (#632)
2 parents cdc1beb + 7cbc552 commit 7d94b96

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

tycho-client/src/feed/synchronizer.rs

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use tokio::{
1515
use tracing::{debug, error, info, instrument, trace, warn};
1616
use tycho_common::{
1717
dto::{
18-
BlockChanges, BlockParam, ComponentTvlRequestBody, EntryPointWithTracingParams,
18+
BlockChanges, BlockParam, Chain, ComponentTvlRequestBody, EntryPointWithTracingParams,
1919
ExtractorIdentity, ProtocolComponent, ResponseAccount, ResponseProtocolState,
2020
TracingResult, VersionParam,
2121
},
@@ -274,18 +274,25 @@ where
274274
HashMap::new()
275275
};
276276

277-
// Fetch entrypoints
278-
let entrypoints_result = self
279-
.rpc_client
280-
.get_traced_entry_points_paginated(
281-
self.extractor_id.chain,
282-
&self.extractor_id.name,
283-
&component_ids,
284-
100,
285-
4,
286-
)
287-
.await?;
288-
tracked_components.process_entrypoints(&entrypoints_result.clone().into())?;
277+
//TODO: Improve this, we should not query for every component, but only for the ones that
278+
// could have entrypoints. Maybe apply a filter per protocol?
279+
let entrypoints_result = if self.extractor_id.chain == Chain::Ethereum {
280+
// Fetch entrypoints
281+
let result = self
282+
.rpc_client
283+
.get_traced_entry_points_paginated(
284+
self.extractor_id.chain,
285+
&self.extractor_id.name,
286+
&component_ids,
287+
100,
288+
4,
289+
)
290+
.await?;
291+
tracked_components.process_entrypoints(&result.clone().into())?;
292+
Some(result)
293+
} else {
294+
None
295+
};
289296

290297
// Fetch protocol states
291298
let mut protocol_states = self
@@ -320,9 +327,13 @@ where
320327
.get(&component.id)
321328
.cloned(),
322329
entrypoints: entrypoints_result
323-
.traced_entry_points
324-
.get(&component.id)
325-
.cloned()
330+
.as_ref()
331+
.map(|r| {
332+
r.traced_entry_points
333+
.get(&component.id)
334+
.cloned()
335+
.unwrap_or_default()
336+
})
326337
.unwrap_or_default(),
327338
},
328339
))

0 commit comments

Comments
 (0)