-
Notifications
You must be signed in to change notification settings - Fork 29
Reproducible absolute prestate of op-program #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| bin | ||
|
|
||
| rvgo/bin | ||
| rvgo/scripts/go-ffi/go-ffi | ||
| rvgo/test/testdata | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| FROM golang:1.21.3-alpine3.18 as builder | ||
|
|
||
| RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash | ||
|
|
||
| COPY ./go.mod /app/go.mod | ||
| COPY ./go.sum /app/go.sum | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN echo "go mod cache: $(go env GOMODCACHE)" | ||
| RUN echo "go build cache: $(go env GOCACHE)" | ||
|
|
||
| RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build go mod download | ||
|
|
||
| COPY . /app | ||
|
|
||
| # We avoid copying the full .git dir into the build for just some metadata. | ||
| # Instead, specify: | ||
| # --build-arg GIT_COMMIT=$(git rev-parse HEAD) | ||
| # --build-arg GIT_DATE=$(git show -s --format='%ct') | ||
| ARG GIT_COMMIT | ||
| ARG GIT_DATE | ||
|
|
||
| ARG ASTERISC_VERSION=v0.0.0 | ||
| ARG OP_PROGRAM_VERSION=v0.0.0 | ||
|
|
||
| ARG TARGETOS TARGETARCH | ||
|
|
||
| # Build the asterisc, op-program, and op-program-client-riscv.elf binaries. | ||
| RUN --mount=type=cache,target=/root/.cache/go-build cd rvgo && make build \ | ||
| GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="ASTERISC_VERSION" | ||
| RUN --mount=type=cache,target=/root/.cache/go-build cd rvsol/lib/optimism/op-program && make op-program-host \ | ||
| GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROGRAM_VERSION" | ||
| RUN --mount=type=cache,target=/root/.cache/go-build cd rvsol/lib/optimism/op-program && make op-program-client-riscv \ | ||
| GOOS=linux GOARCH=mips GOMIPS=softfloat GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_PROGRAM_VERSION" | ||
|
|
||
| # Run the op-program-client-riscv.elf binary directly through asterisc's load-elf subcommand. | ||
| RUN /app/rvgo/bin/asterisc load-elf --path /app/rvsol/lib/optimism/op-program/bin/op-program-client-riscv.elf --out /app/prestate.json --meta "" | ||
|
|
||
| # Generate the prestate proof containing the absolute pre-state hash. | ||
| RUN /app/rvgo/bin/asterisc run --proof-at '=0' --stop-at '=1' --input /app/prestate.json --meta "" --proof-fmt '/app/%d.json' --output "" | ||
| RUN mv /app/0.json /app/prestate-proof.json | ||
|
|
||
| # Exports files to the specified output location. | ||
| # Writing files to host requires buildkit to be enabled. | ||
| # e.g. `BUILDKIT=1 docker build ...` | ||
| FROM scratch AS export-stage | ||
| COPY --from=builder /app/rvsol/lib/optimism/op-program/bin/op-program . | ||
| COPY --from=builder /app/rvsol/lib/optimism/op-program/bin/op-program-client-riscv.elf . | ||
| COPY --from=builder /app/prestate.json . | ||
| COPY --from=builder /app/prestate-proof.json . | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "op-program": { | ||
| "1.1.0": "0x0338dc64405def7e3b9ce8f5076b422a846d831832617d227f13baf219cb5406", | ||
| "1.2.0": "0x0399525587d7ffb173aaa43f35e21b78f807a0bd3dc80ea6527f407732726351" | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.