Refactor to continuous background preimage generation and L1 finality caching#30
Refactor to continuous background preimage generation and L1 finality caching#30
Conversation
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
|
@yoshidan I still see the warning: |
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
|
@siburu I fixed the conflict now. |
ikehara
left a comment
There was a problem hiding this comment.
Some findings were reported by AI. I reviewed them and commented on the actual issues.
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
c8d4331 to
5880fe4
Compare
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
ikehara
left a comment
There was a problem hiding this comment.
Are there any metrics we can check to see if it’s working properly?
I’m concerned that, without metrics, we won’t be able to monitor the progress of preimage generation.
No dedicated metrics exist, but we can get the latest preimage metadata through the "/get_latest_metadata" API. |
Description
This PR significantly refactors the architecture to switch from on-demand preimage generation to a continuous, always-on background generation model. This improves response latency and ensures preimages are readily available for finalized blocks.
Key Changes
Continuous Preimage Collection: Introduced PreimageCollector, which runs in the background to continuously fetch L1 finality updates and generate preimages for the range between the agreed L2 block and the finalized L2 block.
Decoupled Serving: The HTTP server now serves already generated preimages from the repository (FilePreimageRepository), decoupling the generation logic from the request path.
L1 Finality Caching: Implementing FinalizedL1Repository to persistently store the latest finalized L1 headers.
API Updates:
Concurrency & Maintenance: