Skip to content

Conversation

AmbientTea
Copy link
Contributor

@AmbientTea AmbientTea commented Sep 10, 2025

Description

Caching data source for bridge transfers. It uses the same query as the non-caching data source.

The cache works the following way:

  • Stores utxos in block range [from_block, to_block] (inclusive)
  • If query bounds fall within this range, data is served from the cache. In case of UTXO lower bound, it is required for the block containing this UTXO to fall within the bounds, even if the UTXO is the last one in the block and we technically could serve data from cache if we have the next block.
  • If there's a cache miss, we replace the cache with [query_lower_bound, min(query_upper_bound + cache_lookahead, current_stable_tip)] and serve from cache as normal

Checklist

  • Commit sequence broadly makes sense and commits have useful messages.
  • The size limit of 400 LOC isn't needlessly exceeded
  • The PR refers to a JIRA ticket (if one exists)
  • New tests are added if needed and existing tests are updated.
  • New code is documented and existing documentation is updated.
  • Relevant logging and metrics added
  • Any changes are noted in the changelog.md for affected crate
  • Self-reviewed the diff

@AmbientTea AmbientTea changed the base branch from master to domain-impls September 10, 2025 10:08
@AmbientTea AmbientTea force-pushed the ETCM-12254-bridge-data-source-caching branch from b636850 to 841e48d Compare September 10, 2025 10:08
@AmbientTea AmbientTea marked this pull request as ready for review September 10, 2025 11:43
@AmbientTea AmbientTea changed the title Etcm 12254 bridge data source caching add: ETCM-12254 bridge data caching source Sep 10, 2025
@AmbientTea AmbientTea force-pushed the ETCM-12254-bridge-data-source-caching branch from 82aec51 to 4ed56dc Compare September 11, 2025 12:23
Base automatically changed from domain-impls to master September 11, 2025 12:42
@AmbientTea AmbientTea force-pushed the ETCM-12254-bridge-data-source-caching branch from 4ed56dc to fec0149 Compare September 11, 2025 12:47
@AmbientTea AmbientTea requested a review from LGLO September 11, 2025 12:48
@AmbientTea AmbientTea merged commit 3169afd into master Sep 15, 2025
29 checks passed
@AmbientTea AmbientTea deleted the ETCM-12254-bridge-data-source-caching branch September 15, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants