diff --git a/.github/workflows/run_program.yaml b/.github/workflows/run_program.yaml new file mode 100644 index 0000000..817e0ce --- /dev/null +++ b/.github/workflows/run_program.yaml @@ -0,0 +1,45 @@ +name: Run Program + +on: + push: + branches: [main] + pull_request: + branches: + - "**" + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + run_program: + name: Test SP1 Helios Program + runs-on: [runs-on, runner=4cpu-linux-arm64 , "run-id=${{ github.run_id }}"] + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Install SP1 toolchain + run: | + curl -L https://sp1.succinct.xyz | bash + ~/.sp1/bin/sp1up + ~/.sp1/bin/cargo-prove prove --version + source ~/.bashrc + - name: Run test + run: | + cd script + cargo run --bin test + env: + SOURCE_CONSENSUS_RPC_URL: ${{ secrets.SOURCE_CONSENSUS_RPC_URL }} + SOURCE_CHAIN_ID: ${{ secrets.SOURCE_CHAIN_ID }} + CONTRACT_ADDRESS: ${{ secrets.CONTRACT_ADDRESS }} + PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + DEST_RPC_URL: ${{ secrets.DEST_RPC_URL }} + DEST_CHAIN_ID: ${{ secrets.DEST_CHAIN_ID }} diff --git a/elf/riscv32im-succinct-zkvm-elf b/elf/riscv32im-succinct-zkvm-elf index 4a6ad0c..4bcc6f5 100755 Binary files a/elf/riscv32im-succinct-zkvm-elf and b/elf/riscv32im-succinct-zkvm-elf differ diff --git a/program/src/main.rs b/program/src/main.rs index 0642390..0a4ce6a 100644 --- a/program/src/main.rs +++ b/program/src/main.rs @@ -33,7 +33,11 @@ pub fn main() { // 1. Apply sync committee updates, if any for (index, update) in sync_committee_updates.iter().enumerate() { - println!("Processing update {} of {}.", index + 1, sync_committee_updates.len()); + println!( + "Processing update {} of {}.", + index + 1, + sync_committee_updates.len() + ); let update_is_valid = verify_update(update, expected_current_slot, &store, genesis_root, &forks).is_ok(); diff --git a/script/bin/operator.rs b/script/bin/operator.rs index 760f7e5..f73c097 100644 --- a/script/bin/operator.rs +++ b/script/bin/operator.rs @@ -171,8 +171,12 @@ impl SP1LightClientOperator { // We must still apply the update locally to "sync" the helios client, this is due to // next_sync_committee not being stored when the helios client is bootstrapped. if !sync_committee_updates.is_empty() { - let next_sync_committee = - B256::from_slice(sync_committee_updates[0].next_sync_committee.tree_hash_root().as_ref()); + let next_sync_committee = B256::from_slice( + sync_committee_updates[0] + .next_sync_committee + .tree_hash_root() + .as_ref(), + ); if contract_next_sync_committee == next_sync_committee { println!("Applying optimization, skipping update");