Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Add integration tests to allow loading in Taiko blocks into the circuit #120

Merged
merged 14 commits into from
Jul 15, 2023

Conversation

xiaodino
Copy link

@xiaodino xiaodino commented Jun 26, 2023

Description

This PR introduces a convenient method for testing circuits against actual Taiko block data. It doesn't need to run a node software.

It incorporates the ability to load Taiko block data through the URL "https://rpc.internal.taiko.xyz/." To set this URL, use the command export
GETH0_URL="https://rpc.internal.taiko.xyz"

The integration tests included in this PR cover the following circuit:

  • EVM circuit
  • Super circuit

and the following example blocks:

  • the block that has only one anchor
  • the block that has propose block contract call
  • the block that has prove block contract call
  • the block that has ERC20 transfer

Issue Link

#108

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Contents

This PR includes two integration tests:

  • taiko_circuit_input_builder.rs: Tests the circuit input builder.
  • taiko_circuits.rs: Tests the circuit prover.

The PR is not to address the circuit prover failures such as invalid signature.

How Has This Been Tested?

Block explorer URL is https://explorer.internal.taiko.xyz

export GETH0_URL="https://rpc.internal.taiko.xyz"
./run.sh --steps setup --tests taiko_circuit_input_builder
./run.sh --steps tests --tests taiko_circuits::mock_prover

@xiaodino xiaodino changed the title Xiaodino/loading taiko Allow loading in Taiko blocks into the circuit Jun 26, 2023
@xiaodino xiaodino changed the title Allow loading in Taiko blocks into the circuit Add integration tests to allow loading in Taiko blocks into the circuit Jun 26, 2023
@Brechtpd Brechtpd requested a review from smtmfft June 26, 2023 16:58
@xiaodino xiaodino requested a review from johntaiko June 30, 2023 04:16
Copy link

@Brechtpd Brechtpd left a comment

Choose a reason for hiding this comment

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

This is cool. :)

I think next steps would be:

  • Connect to the actual Taiko circuits
    • Make the tests pass (looks like there is some invalid signature problem, maybe related to the chain id or something)
  • Local data generation:
    -Allow generating the data locally using a Taiko node like currently is possible from a standard geth node.
    • Modify that test data generation to include the anchor transaction (maybe a simplified dummy anchor function because otherwise the circuits already seem to have to be quite big).

integration-tests/src/lib.rs Outdated Show resolved Hide resolved
Copy link

@Brechtpd Brechtpd left a comment

Choose a reason for hiding this comment

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

This looks good, but let's first do the next steps written in my comment above before merging this one in the master. Or at least the part of connecting with the Taiko super circuit and making sure the tests don't fail. The offchain test generation using a Taiko node can be done afterwards if that makes things simpler.

@xiaodino xiaodino merged commit 7d575e8 into main Jul 15, 2023
@xiaodino xiaodino deleted the xiaodino/loading-taiko branch July 15, 2023 05:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants