Skip to content

Conversation

@rozbb
Copy link
Contributor

@rozbb rozbb commented Nov 18, 2025

Currently MTC's /get-landmark-bundle endpoint can take up to 30sec to return a bundle response.

This PR:

  1. Caches the response so it doesn't have to compute the bundle every time, just once per hour
  2. Move the bundle computation to a cronjob
  3. Optimizes the bundle computation by caching tiles in the consistency proof computation

This does introduce a potential bug, though. If the landmark sequence and landmark bundle PUT operations do not both succeed, then we will end up in an illegal state, where the sequence and bundle don't match each other. I made a tracking issue for workers-rs here.. The issue also includes a workaround, but it's nasty.

@cjpatton cjpatton self-requested a review November 18, 2025 14:22
Copy link
Contributor

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few minor things

@rozbb rozbb force-pushed the cache-landmark-bundle branch from 32191e5 to 839e843 Compare November 18, 2025 19:30
* Started moving landmark bundle comptuation to cronjob

* Fix type signature of CheckpointCallbacker to let the landmark bundle creator access the checkpoint bytes

* Save the landmark bundle in R2

* Make landmark subtrees endpoint fetch from R2

* Return get-landmark-bundle directly from R2

* Implement cached bucket backend
@rozbb rozbb force-pushed the cache-landmark-bundle branch from 839e843 to 661a36a Compare November 18, 2025 19:35
@cjpatton cjpatton merged commit b3c4404 into cloudflare:main Nov 19, 2025
1 check passed
@rozbb rozbb deleted the cache-landmark-bundle branch November 19, 2025 18:06
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