Wait for caffeination height before starting Espresso batcher#367
Wait for caffeination height before starting Espresso batcher#367philippecamacho merged 9 commits intocelo-integration-rebase-14.2from
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Espresso batcher's operational logic by introducing a "caffeination height" mechanism. This ensures that the batcher only becomes active and processes blocks once the underlying L2 chain has reached a specified block height. This change prevents the batcher from interacting with or submitting blocks that are considered too early in the chain's progression, thereby aligning its behavior with specific chain state requirements. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to delay the Espresso batcher startup until the L2 chain reaches a configurable CaffeinationHeightL2. This is achieved by adding a waiting loop at the beginning of the batcher startup process and clamping the block loading range to respect this height. The changes are logical and well-implemented. I have one suggestion to improve the polling logic in waitForCaffeinationHeight to avoid an unnecessary initial delay.
|
One comment I thought about when reviewing this PR is that liveness can be broken by hardcoding the caffeinated height in the config to a very high value. This would prevent the batcher from posting anything and is a value that we don't include or planned to include in the enclave hash measurement. |
@jjeangal can't one just not run the batcher at all if they wanted to? Enclave operator can always break liveness. |
304daab to
13385d3
Compare
Yes that is true, just thinking out loud! |
philippecamacho
left a comment
There was a problem hiding this comment.
LGTM
Note: I added some unit tests and have them run in CI.
.github/workflows/unit-tests.yml
Outdated
There was a problem hiding this comment.
@philippecamacho this is unnecessary, all espresso tests are run by integration tests job and all batcher tests are run by vanilla OP pipeline in CircleCI.
4ea8191 to
8d9a97e
Compare
Block batcher startup until the L2 unsafe head reaches CaffeinationHeightL2, preventing the batcher from submitting blocks below the caffeination threshold. The block loader also clamps its start range to the caffeination height so pre-caffeination blocks are never enqueued. Co-authored-by: OpenCode <noreply@opencode.ai>
6e54181 to
74db6fc
Compare
88a929e
into
celo-integration-rebase-14.2
Block batcher startup until the L2 unsafe head reaches CaffeinationHeightL2, preventing the batcher from submitting blocks below the caffeination threshold. The block loader also clamps its start range to the caffeination height so pre-caffeination blocks are never enqueued.
Closes https://app.asana.com/1/1208976916964769/project/1209976130071762/task/1213545066241809
This PR:
Makes espresso-mode batcher respect CaffeinationHeightL2 - it will not start posting before the chain reaches that height
This PR does not:
Change anything else
Key places to review: