Skip to content

feat(taiko-client): add more double-checks in isKnownCanonicalBlock #19473

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

Conversation

davidtaikocha
Copy link
Contributor

No description provided.

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

Adds comprehensive validation checks within isKnownCanonicalBlock to guard against mismatched block metadata and logs warnings on failure.

  • Introduces a deferred warning log for any validation error
  • Adds explicit comparisons for parent hash, transactions, anchor tx, uncle hash, coinbase, difficulty, mix digest, block number, gas limit, timestamp, extra data, base fee, and withdrawals
  • Returns detailed error messages on the first detected mismatch
Comments suppressed due to low confidence (1)

packages/taiko-client/driver/chain_syncer/event/blocks_inserter/common.go:347

  • You’ve added checks for an empty transaction list and other mismatches. It would be good to add unit tests that simulate each failure case to ensure these new branches are covered.
if block.Transactions().Len() == 0 {

Copy link

codecov bot commented May 17, 2025

Codecov Report

Attention: Patch coverage is 1.78571% with 55 lines in your changes missing coverage. Please review.

Project coverage is 34.40%. Comparing base (6e5b8c8) to head (dce5eb1).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...river/chain_syncer/event/blocks_inserter/common.go 1.78% 41 Missing and 14 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...river/chain_syncer/event/blocks_inserter/common.go 66.26% <1.78%> (-9.98%) ⬇️

... 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 6e5b8c8...dce5eb1. 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 May 19, 2025
Merged via the queue into main with commit bf86754 May 19, 2025
9 checks passed
@davidtaikocha davidtaikocha deleted the more-double-checks branch May 19, 2025 01:17
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