Skip to content

Commit

Permalink
chore: move proposer (#87)
Browse files Browse the repository at this point in the history
* chore: move proposer

* fix proposer

* proposer succinct

* fix: docker

---------

Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
jtguibas and Ubuntu authored Aug 30, 2024
1 parent 5895a14 commit 62751dd
Show file tree
Hide file tree
Showing 61 changed files with 22 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/op_proposer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches:
- main
paths:
- 'op-proposer-go/**'
- 'proposer/**', 'elf/**'
push:
branches:
- main
paths:
- 'op-proposer-go/**'
- 'proposer/**', 'elf/**'

jobs:
test_op_proposer_go:
Expand All @@ -27,7 +27,7 @@ jobs:
go-version: '1.22'
- name: Run main_test.go
run: go test -v ./server/main_test.go
working-directory: op-proposer-go
working-directory: proposer/op
env:
L2_RPC: ${{ secrets.L2_RPC }}
L2_NODE_RPC: ${{ secrets.L2_NODE_RPC }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- "programs/**"
- "native-host/**"
- "zkvm-host/**"
- "op-succinct-proposer/**"
- "proposer/succinct/**"
- "Cargo.toml"
merge_group:

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = [
"crates/*",
"native-host",
"zkvm-host",
"op-succinct-proposer",
"proposer/succinct",
]
resolver = "2"

Expand Down Expand Up @@ -61,7 +61,7 @@ hex = "0.4.3"
client-utils = { path = "crates/client-utils" }
host-utils = { path = "crates/host-utils" }
zkvm-host = { path = "zkvm-host" }
op-succinct-proposer = { path = "op-succinct-proposer" }
op-succinct-proposer = { path = "proposer/succinct" }

# ethereum
alloy = { version = "0.2", default-features = false, features = ["full"] }
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
op-succinct-server:
build:
context: .
dockerfile: ./op-succinct-proposer/Dockerfile.server
dockerfile: ./proposer/succinct/Dockerfile.server
env_file:
- .env.server
restart: unless-stopped
Expand All @@ -14,7 +14,7 @@ services:
op-succinct-proposer:
build:
context: .
dockerfile: ./op-succinct-proposer/Dockerfile.op_proposer
dockerfile: ./proposer/op/Dockerfile.op_proposer
env_file:
- .env.server
restart: unless-stopped
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM golang:1.22 AS go-builder
# Set up Go environment
FROM go-builder AS optimism-builder
WORKDIR /optimism
COPY ./op-proposer-go/ /optimism/op-proposer
COPY ./proposer/op /optimism/op-proposer
WORKDIR /optimism/op-proposer/proposer
RUN make op-proposer
RUN ls -l /optimism/op-proposer/proposer
Expand All @@ -23,7 +23,7 @@ RUN apt-get update && apt-get install -y \
COPY --from=optimism-builder /optimism/op-proposer/proposer/bin/op-proposer /usr/local/bin/op-proposer

# Set the entrypoint to run op-proposer with environment variables
COPY ./op-succinct-proposer/op_proposer.sh /usr/local/bin/op_proposer.sh
COPY ./proposer/op/op_proposer.sh /usr/local/bin/op_proposer.sh

# Make the binary and entrypoint executable.
RUN ls -l /usr/local/bin/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ RUN apt-get update && apt-get install -y \
wget \
git \
build-essential \
# g++-x86-64-linux-gnu \
# libc6-dev-amd64-cross \
&& rm -rf /var/lib/apt/lists/*

# Install Go 1.22
Expand All @@ -23,8 +21,8 @@ ENV PATH="${GOPATH}/bin:${PATH}"
# Set up Go environment
WORKDIR /app

# Copy the local op-proposer-go directory
COPY ./op-proposer-go /app/op-proposer-go
# Copy the local proposer/op directory
COPY ./proposer/op /app/op-proposer-go

# Change to the server directory and build the application
WORKDIR /app/op-proposer-go/server
Expand Down
6 changes: 3 additions & 3 deletions op-proposer-go/Makefile → proposer/op/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ SHELL := /bin/bash
bindings:
@echo "Generating bindings for ZKL2OutputOracle.sol..."
@mkdir -p bin generated_bindings
@cd ../contracts/src/ && forge install && forge build
@cd ../contracts/ && forge inspect src/ZKL2OutputOracle.sol:ZKL2OutputOracle abi > ../op-proposer-go/generated_bindings/ZKL2OutputOracle.abi
@cd ../contracts/ && forge inspect src/ZKL2OutputOracle.sol:ZKL2OutputOracle bytecode > ../op-proposer-go/generated_bindings/ZKL2OutputOracle.bin
@cd ../contracts/ && forge install && forge build
@cd ../contracts/ && forge inspect src/ZKL2OutputOracle.sol:ZKL2OutputOracle abi > ../proposer/op/generated_bindings/ZKL2OutputOracle.abi
@cd ../contracts/ && forge inspect src/ZKL2OutputOracle.sol:ZKL2OutputOracle bytecode > ../proposer/op/generated_bindings/ZKL2OutputOracle.bin
@abigen --abi generated_bindings/ZKL2OutputOracle.abi --bin generated_bindings/ZKL2OutputOracle.bin --pkg bindings --type ZKL2OutputOracle --out ./bindings/zkl2outputoracle.go
@rm -rf generated_bindings
@echo "Bindings generated successfully."
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ just

Then start the host in the background.
```bash
docker build -t span_batch_server -f op-succinct-proposer/Dockerfile.span_batch_server .
docker build -t span_batch_server -f proposer/op/Dockerfile.span_batch_server .
docker run -p 8080:8080 -d span_batch_server
```

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN curl -L https://sp1.succinct.xyz | bash && \
# Copy the relevant OP Succinct server files.
COPY Cargo.toml Cargo.lock ./
COPY zkvm-host ./zkvm-host
COPY op-succinct-proposer ./op-succinct-proposer
COPY proposer/succinct ./proposer/succinct
COPY native-host ./native-host
COPY elf ./elf
COPY crates ./crates
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::{
};
use tokio::task::block_in_place;

pub const MULTI_BLOCK_ELF: &[u8] = include_bytes!("../../elf/range-elf");
pub const MULTI_BLOCK_ELF: &[u8] = include_bytes!("../../../elf/range-elf");

/// The arguments for the host executable.
#[derive(Debug, Clone, Parser)]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use sp1_sdk::{
use std::{env, fs, time::Duration};
use tower_http::limit::RequestBodyLimitLayer;

pub const MULTI_BLOCK_ELF: &[u8] = include_bytes!("../../elf/range-elf");
pub const AGG_ELF: &[u8] = include_bytes!("../../elf/aggregation-elf");
pub const MULTI_BLOCK_ELF: &[u8] = include_bytes!("../../../elf/range-elf");
pub const AGG_ELF: &[u8] = include_bytes!("../../../elf/aggregation-elf");

#[derive(Deserialize, Serialize, Debug)]
struct SpanProofRequest {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use anyhow::Result;
use log::info;
use sp1_sdk::{utils, HashableKey, ProverClient};

pub const AGG_ELF: &[u8] = include_bytes!("../../elf/aggregation-elf");
pub const MULTI_BLOCK_ELF: &[u8] = include_bytes!("../../elf/range-elf");
pub const AGG_ELF: &[u8] = include_bytes!("../../../elf/aggregation-elf");
pub const MULTI_BLOCK_ELF: &[u8] = include_bytes!("../../../elf/range-elf");

use clap::Parser;

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 62751dd

Please sign in to comment.