File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1018,6 +1018,17 @@ impl TriggersAdapterTrait<Chain> for TriggersAdapter {
10181018
10191019 let block = match self.chain_client.as_ref() {
10201020 ChainClient::Firehose(endpoints) => {
1021+ let chain_store = self.chain_store.cheap_clone();
1022+ // First try to get the block from the store
1023+ if let Ok(blocks) = chain_store.blocks(vec![block.hash.clone()]).await {
1024+ if let Some(block) = blocks.first() {
1025+ if let Ok(block) = json::from_value::<LightEthereumBlock>(block.clone()) {
1026+ return Ok(block.parent_ptr());
1027+ }
1028+ }
1029+ }
1030+
1031+ // If not in store, fetch from Firehose
10211032 let endpoint = endpoints.endpoint().await?;
10221033 let logger = self.logger.clone();
10231034 let retry_log_message =
You can’t perform that action at this time.
0 commit comments