Skip to content

feat(taiko-client): introduce ImportPendingBlocksFromCache in PreconfBlockAPIServer #19339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 28, 2025

Conversation

davidtaikocha
Copy link
Contributor

@davidtaikocha davidtaikocha commented Apr 27, 2025

After this PR, when a newly started L2 EE chain has finished a beacon sync, driver will try to import pending P2P preconf blocks in the cache.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new method, ImportPendingBlocksFromCache, in the PreconfBlockAPIServer to recover pending preconfirmation blocks from the cache and integrates it with the L2ChainSyncer.

  • Implements ImportPendingBlocksFromCache in server.go
  • Propagates the latest payload from queue.go
  • Updates driver.go and chain_syncer.go to wire the new functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/taiko-client/driver/preconf_blocks/server.go Adds the ImportPendingBlocksFromCache method to retrieve pending blocks
packages/taiko-client/driver/preconf_blocks/queue.go Updates the payloadQueue structure to store the latest payload
packages/taiko-client/driver/driver.go Sets the preconfirmation block server in the driver configuration
packages/taiko-client/driver/chain_syncer/chain_syncer.go Triggers population of pending preconfirmation blocks during chain synchronization

@davidtaikocha davidtaikocha requested a review from Copilot April 27, 2025 06:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces functionality to import pending preconfirmation blocks from the cache into the preconfirmation block server and properly wires it into the chain synchronization process.

  • Introduces the ImportPendingBlocksFromCache method in PreconfBlockAPIServer.
  • Adds a helper method getLatestPayload in the payloadQueue.
  • Connects the preconfirmation block server within the driver and chain syncer for proper integration.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/taiko-client/driver/preconf_blocks/server.go Adds ImportPendingBlocksFromCache, with a minor spelling issue in variable naming.
packages/taiko-client/driver/preconf_blocks/queue.go Introduces the getLatestPayload helper to retrieve the latest payload from the queue.
packages/taiko-client/driver/driver.go Sets the preconfirmation block server in the driver.
packages/taiko-client/driver/chain_syncer/chain_syncer.go Integrates the preconfirmation block server for block recovery on chain sync.

Copy link

codecov bot commented Apr 27, 2025

Codecov Report

Attention: Patch coverage is 16.83168% with 84 lines in your changes missing coverage. Please review.

Project coverage is 38.68%. Comparing base (abcc6a6) to head (b0cc15a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/taiko-client/driver/chain_syncer/chain_syncer.go 7.14% 39 Missing ⚠️
...kages/taiko-client/driver/preconf_blocks/server.go 0.00% 36 Missing ⚠️
...ckages/taiko-client/driver/preconf_blocks/queue.go 0.00% 8 Missing ⚠️
packages/taiko-client/driver/preconf_blocks/api.go 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...driver/chain_syncer/blob/blocks_inserter/pacaya.go 75.50% <100.00%> (+1.34%) ⬆️
packages/taiko-client/driver/driver.go 19.31% <100.00%> (+0.25%) ⬆️
packages/taiko-client/driver/preconf_blocks/api.go 0.00% <0.00%> (ø)
...ckages/taiko-client/driver/preconf_blocks/queue.go 86.48% <0.00%> (-10.49%) ⬇️
...kages/taiko-client/driver/preconf_blocks/server.go 18.18% <0.00%> (-1.29%) ⬇️
...s/taiko-client/driver/chain_syncer/chain_syncer.go 29.54% <7.14%> (-5.97%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abcc6a6...b0cc15a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@davidtaikocha davidtaikocha added this pull request to the merge queue Apr 28, 2025
Merged via the queue into main with commit 0da05f5 Apr 28, 2025
10 checks passed
@davidtaikocha davidtaikocha deleted the ImportPendingBlocksFromCache branch April 28, 2025 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants