Currently, Asterisc only supports the local devnet launched from the Optimism monorepo.
- Update the git submodule
- Run
git submodule update --init --remote
in the project root.
- Run
- Build the Asterisc binary and generate prestate proof
- Run
make prestate
in the project root.
- Run
To run tests on rvsol/src/RISCV.sol implementation, run the following in the project root:
(cd rvgo/scripts/go-ffi && go build)
cd rvsol
forge test -vvv --ffi
- Running local devnet launched from the Optimism monorepo
- Run
make devnet-up
in the monorepo root. - Set the env var
TARGET_L1_RPC_URL
to the L1 RPC endpoint (Local devnet L1:http://localhost:8545
) - Set the env var
TARGET_L2_DEPLOYMENT_FILE
to the path of devnet deployment file (optimism/packages/contracts-bedrock/deployments/devnetL1/.deploy
) - Set the env var
TARGET_L2_DEPLOY_CONFIG
to the path of devnet deploy config file (optimism/packages/contracts-bedrock/deploy-config/devnetL1.json
)
- Run
- Asterisc absolute prestate of op-program
- Run
make op-program-client-riscv
in `optimism/op-program - Set the built elf file path to the env var
OP_PROGRAM_PATH
(optimism/op-program/bin/op-program-client-riscv.elf
)
- Run
- Build Asterisc binary and contracts
- Run
make build
in the project root
- Run
- Generate prestate proof
- Run
make prestate
in the project root
- Run
- Run deploy script
- Run
./scripts/deploy.sh
inrvsol
- Run
- There are few issues with Foundry.
- Run script directly without manual build does not work with the current version of Foundry (2024-03-15
3fa0270
). You must runmake build
before running the deploy script. (issue) - Some older version(2024-02-01
2f4b5db
) of Foundry makes a dependency error reported above issue. Use the latest version of Foundry!
- Run script directly without manual build does not work with the current version of Foundry (2024-03-15
- The deploy script can be run only once on the devnet because of the
create2
salt. To rerun the script for dev purpose, you must restart the devnet withmake devnet-clean && make devnet-up
command on the monorepo.