Skip to content

base/fp-test-cases

Folders and files

NameName
Last commit message
Last commit date
Aug 27, 2024
Feb 12, 2025
Sep 5, 2024
Feb 12, 2025
Sep 4, 2024
Sep 6, 2024
Jan 24, 2025
Sep 5, 2024
Sep 4, 2024
Jan 23, 2025
Jan 23, 2025
Sep 6, 2024
Jan 30, 2025
Sep 5, 2024
Feb 12, 2025

Repository files navigation

Fault Proof Test Cases

Setup

Clone the ethereum-optimism/optimism repository and build op-program and cannon:

$ cd /path/to/your/workspace
$ git clone git@github.com:ethereum-optimism/optimism.git
$ cd optimism
$ make op-program cannon
$ cd cannon
$ ./bin/cannon load-elf --path=../op-program/bin/op-program-client.elf

Configure the environment variables in the .env file:

OPTIMISM_DIR=/path/to/ethereum-optimsm/optimism

Create a foundry test wallet (based on the default anvil mnemonic):

cast wallet import TEST --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

Install kurtosis (required for creating a local devnet).

Usage

Build the opfp binary

$ just build

Start a local devnet

Create a local devnet with the default config file (devnet/standard.yaml)

$ just create-devnet

Create a local devnet with a custom config file

Config files must follow the format described in the optimism-package repository.

$ just devnet-config-file=devnet/minimal.yaml create-devnet

Get the current L2 block gas limit

$ just get-l2-block-gas-limit

Update the current L2 block gas limit

$ just l2-block-gas-limit=<new_gas_limit> update-l2-block-gas-limit

Cleanup a local devnet

$ just cleanup-devnet

Generate Fixtures (requires a local devnet)

$ just name=<script name> script-args="<script args>" generate-fixture
# Example
$ just name=Reader script-args="2000000" generate-fixture

Test Fixtures in op-program

Using fixtures defined by the script name and arguments

$ just name=<script name> script-args="<script args>" run-fixture
# Example
$ just name=Reader script-args="2000000" run-fixture

Using a fixture file

$ just fixture-file=<fixture file> run-fixture
# Example
$ just fixture-file=fixtures/Reader-2000000.json run-fixture

Test Fixtures in Cannon

Using fixtures defined by the script name and arguments

$ just name=<script name> script-args="<script args>" cannon-fixture
# Example
$ just name=Reader script-args="2000000" cannon-fixture

Using a fixture file

$ just fixture-file=<fixture file> run-fixture
# Example
$ just fixture-file=fixtures/Reader-2000000.json cannon-fixture