Skip to content

feat(taiko-client): add checks to ensure preconfirmation blocks are based on canonical chain #19379

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 6 commits into from
May 2, 2025

Conversation

davidtaikocha
Copy link
Contributor

@davidtaikocha davidtaikocha commented May 2, 2025

This will introduce an O(n) search through RPC calls when the preconf block is in another (valid / invalid) fork, we can optimize it by moving the search to a new taiko-geth RPC method later.

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 adds a check to ensure that preconfirmation blocks belong to the canonical chain by fetching the canonical parent block and validating its hash against the provided executable data.

  • Fetch the canonical parent block via the L2 header API.
  • Compare the canonical parent's hash with that of the executable data and return an error if they do not match.

@davidtaikocha davidtaikocha marked this pull request as draft May 2, 2025 07:03
@davidtaikocha davidtaikocha marked this pull request as ready for review May 2, 2025 08:36
@davidtaikocha davidtaikocha requested a review from Copilot May 2, 2025 08:37
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 adds validations to ensure that preconfirmation blocks are part of the canonical chain. It introduces stricter error messages in the preconfirmation check and implements a new helper function (IsInCanonicalChain) to traverse and verify the chain linkage.

Copy link

codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 24.32432% with 28 lines in your changes missing coverage. Please review.

Project coverage is 38.58%. Comparing base (efe2d99) to head (c289cff).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...river/chain_syncer/event/blocks_inserter/pacaya.go 24.32% 23 Missing and 5 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...river/chain_syncer/event/blocks_inserter/pacaya.go 69.12% <24.32%> (-6.38%) ⬇️

... 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 efe2d99...c289cff. 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 changed the title feat(taiko-client): add checks to ensure preconfirmation blocks are in canonical chain feat(taiko-client): add checks to ensure preconfirmation blocks are based on canonical chain May 2, 2025
@cyberhorsey cyberhorsey added this pull request to the merge queue May 2, 2025
Merged via the queue into main with commit 22e8a64 May 2, 2025
10 checks passed
@cyberhorsey cyberhorsey deleted the more-checks-preconf branch May 2, 2025 18:43
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