Skip to content
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

Challenger: Pull large preimage proposals from tx logs #10416

Merged
merged 4 commits into from
May 7, 2024

Conversation

mbaxter
Copy link
Contributor

@mbaxter mbaxter commented May 6, 2024

Description

Update the challenger to pull large preimage proposals from logs instead of calldata. This is part of future-proofing the fault dispute system against EIP-3074.

For more details, see the write-up here.

Builds on: #10278.

Tests

Updated fetcher unit tests, and checked that relevant end-to-end tests were still passing.

Metadata

@mbaxter mbaxter requested a review from ajsutton May 6, 2024 17:42
@mbaxter mbaxter marked this pull request as ready for review May 6, 2024 17:46
@mbaxter mbaxter requested a review from a team as a code owner May 6, 2024 17:46
Copy link
Contributor

coderabbitai bot commented May 6, 2024

Walkthrough

Walkthrough

The updates involve modifications to the fetcher.go file, enhancing a function for extracting data from transactions, and changes to fetcher_test.go, including new imports and variable adjustments for testing. These adjustments improve the functionality and testing robustness of the system.

Changes

File Changes
.../keccak/fetcher/fetcher.go Updated function extractRelevantLeavesFromTx to improve data extraction from transactions.
.../keccak/fetcher/fetcher_test.go Added imports (fmt, math). Changed MissingReceiptStatus and updated variable declarations.

Recent Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between b401f72 and fa670a1.
Files selected for processing (2)
  • op-challenger/game/keccak/fetcher/fetcher.go (4 hunks)
  • op-challenger/game/keccak/fetcher/fetcher_test.go (4 hunks)
Additional comments not posted (12)
op-challenger/game/keccak/fetcher/fetcher.go (2)

51-57: The integration of extractRelevantLeavesFromTx within FetchInputs is well-implemented. The error handling and conditional checks are robust.


Line range hint 70-112: The function extractRelevantLeavesFromTx is well-crafted with comprehensive error handling and detailed logging. It effectively filters and processes transaction logs based on the specified conditions.

op-challenger/game/keccak/fetcher/fetcher_test.go (10)

66-74: The test TestFetchLeaves_ErrorOnUnavailableInputBlocks correctly simulates an error scenario and checks the appropriate error message and empty result. Good coverage for error handling.


76-85: The test TestFetchLeaves_ErrorOnUnavailableL1Block effectively checks the fetcher's behavior when an L1 block is not found, ensuring that the error is handled correctly.


87-113: The test TestFetchLeaves_SingleTxSingleLog is comprehensive, covering various transaction origins and ensuring that the fetcher processes logs correctly in each case.


115-128: The test TestFetchLeaves_SingleTxMultipleLogs effectively verifies the fetcher's capability to process multiple logs from a single transaction, ensuring correct data aggregation.


135-149: The test TestFetchLeaves_MultipleBlocksAndLeaves is robust, effectively testing the fetcher's ability to handle and aggregate data from multiple blocks and transactions.


155-169: The test TestFetchLeaves_SkipLogFromWrongContract correctly verifies that the fetcher skips logs from irrelevant contracts, ensuring robust filtering logic.


175-193: The test TestFetchLeaves_SkipProposalWithWrongUUID effectively tests the fetcher's ability to ignore logs with incorrect UUIDs, ensuring accurate data filtering.


195-213: The test TestFetchLeaves_SkipProposalWithWrongClaimant correctly tests the fetcher's filtering logic for logs with incorrect claimant addresses, ensuring that only relevant logs are processed.


215-229: The test TestFetchLeaves_SkipInvalidProposal effectively verifies the fetcher's capability to ignore logs linked to invalid proposals, maintaining data integrity.


235-250: The test TestFetchLeaves_SkipProposalWithInsufficientData correctly tests the fetcher's ability to skip logs with insufficient data, ensuring robust data validation.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

LGTM.

@ajsutton ajsutton added this pull request to the merge queue May 7, 2024
Merged via the queue into develop with commit 1cfd38b May 7, 2024
68 of 69 checks passed
@ajsutton ajsutton deleted the mbax/cp-795/challenger/pull-lpp-from-logs branch May 7, 2024 23:09
@Inphi
Copy link
Contributor

Inphi commented May 8, 2024

Good looks. Do we need to follow up with a post-3074 e2e test?

@ajsutton
Copy link
Contributor

ajsutton commented May 8, 2024

Interesting question - there isn't any implementation of 3074 at the moment that we can use (and may not be - there's a better proposal gaining traction now though it may have similar consequences for large preimages). I was happy with the fact that the existing tests are still passing now we're loading data from logs but I guess that doesn't still depend on something about the top level transaction somehow.

@mbaxter
Copy link
Contributor Author

mbaxter commented May 8, 2024

Yeah, if 3074 or similar gets implemented, would be a good idea to add more e2e tests 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants