Skip to content

fix(taiko-client): fix an issue in isBatchPreconfirmed #19314

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 4 commits into from
Apr 21, 2025

Conversation

davidtaikocha
Copy link
Contributor

We need to check the derivation of each block instead of the last one.

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 fixes an issue in the taiko-client where the derivation of each block is now checked instead of validating only the last one.

  • Updated isBatchPreconfirmed to accept a parent header parameter for improved block derivation validation
  • Revised the logic in isBatchPreconfirmed (common.go) to iterate through each block in the batch and update the parent header accordingly

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/taiko-client/driver/chain_syncer/blob/blocks_inserter/pacaya.go Modified call to isBatchPreconfirmed to include a parent header parameter
packages/taiko-client/driver/chain_syncer/blob/blocks_inserter/common.go Updated isBatchPreconfirmed to loop through all blocks and return the header of the last validated block
Comments suppressed due to low confidence (2)

packages/taiko-client/driver/chain_syncer/blob/blocks_inserter/common.go:205

  • [nitpick] Consider renaming the 'parent' parameter to something like 'prevBlockHeader' to clarify that it represents the header of the previously validated block.
parent *types.Header,

packages/taiko-client/driver/chain_syncer/blob/blocks_inserter/pacaya.go:151

  • Ensure that the 'parent' variable passed to isBatchPreconfirmed is initialized correctly in this context, as its value drives the derivation check for every block.
parent,

@davidtaikocha davidtaikocha enabled auto-merge April 21, 2025 12:55
@davidtaikocha davidtaikocha added this pull request to the merge queue Apr 21, 2025
Merged via the queue into main with commit 17346cf Apr 21, 2025
7 checks passed
@davidtaikocha davidtaikocha deleted the fix-isBatchPreconfirmed branch April 21, 2025 18:46
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