Skip to content

Commit

Permalink
run asterisc too
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Jul 1, 2024
1 parent 7c1486f commit 0d753c1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/client_host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ env:
CARGO_TERM_COLOR: always
jobs:
host-client-offline-runs:
name: ${{ matrix.name }}
name: ${{ matrix.target}} ${{ matrix.name }}
strategy:
matrix:
target: ["native", "asterisc"]
name:
[
"OP Mainnet (Ecotone) - Block #122093770",
Expand All @@ -28,7 +29,18 @@ jobs:
with:
cache-on-failure: true
prefix-key: ${{ matrix.target }}
- name: Set environment
- name: Setup Go toolchain
if: "!contains(matrix.target, 'native')"
uses: actions/setup-go@v5
with:
go-version: "1.21.6"
- name: Build & Install `asterisc`
if: "!contains(matrix.target, 'native')"
run: |
git clone https://github.com/ethereum-optimism/asterisc.git
cd asterisc && make build-rvgo
mv asterisc/bin/aserisc /usr/local/bin/
- name: Set run environment
run: |
if [[ ${{ contains(matrix.name, 122093770) }} == true ]]; then
BLOCK_NUMBER=122093770
Expand Down Expand Up @@ -56,7 +68,7 @@ jobs:
- name: Run host + client offline
working-directory: ./bin/client
run: |
just run-client-native-offline \
just run-client-${{ matrix.target }}-offline \
$BLOCK_NUMBER \
$L2_CLAIM \
$L2_OUTPUT_ROOT \
Expand Down
45 changes: 45 additions & 0 deletions bin/client/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,48 @@ run-client-native-offline block_number l2_claim l2_output_root l2_head l1_head l
--exec $CLIENT_BIN_PATH \
--data-dir ./data \
{{verbosity}}

# Run the client program on asterisc with the host program detached, in offline mode.
run-client-asterisc-offline block_number l2_claim l2_output_root l2_head l1_head l2_chain_id verbosity:
#!/usr/bin/env bash
HOST_BIN_PATH="./target/release/kona-host"
CLIENT_BIN_PATH="./target/riscv64gc-unknown-none-elf/release-client-lto/kona"
STATE_PATH="./state.json"

L2_BLOCK_NUMBER={{block_number}}
L2_CLAIM={{l2_claim}}
L2_OUTPUT_ROOT={{l2_output_root}}
L2_HEAD={{l2_head}}
L1_HEAD={{l1_head}}
L2_CHAIN_ID={{l2_chain_id}}

# Move to the workspace root
cd $(git rev-parse --show-toplevel)

echo "Building client program for RISC-V target..."
just build-asterisc --bin kona --profile release-client-lto

echo "Loading client program into Asterisc state format..."
asterisc load-elf --path=$CLIENT_BIN_PATH

echo "Building host program for native target..."
cargo build --bin kona-host --release

echo "Running asterisc"
asterisc run \
--info-at '%10000000' \
--proof-at never \
--input $STATE_PATH \
-- \
$HOST_BIN_PATH \
--l1-head $L1_HEAD \
--l2-head $L2_HEAD \
--l2-claim $L2_CLAIM \
--l2-output-root $L2_OUTPUT_ROOT \
--l2-block-number $L2_BLOCK_NUMBER \
--l2-chain-id $L2_CHAIN_ID \
--server \
--data-dir ./data \
--exec "" \
{{verbosity}}

0 comments on commit 0d753c1

Please sign in to comment.