Skip to content

Commit

Permalink
chore(workspace): reorganize binary example programs (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell authored Jun 21, 2024
1 parent 5acf0fe commit 5655e48
Show file tree
Hide file tree
Showing 32 changed files with 33 additions and 36 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = ["crates/*", "bin/host", "bin/programs/*", "examples/*"]
default-members = ["bin/host", "bin/programs/*"]
members = ["crates/*", "bin/host", "bin/client", "examples/*"]
default-members = ["bin/host", "bin/client"]
exclude = ["fpvm-tests/cannon-rs-tests"]
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rollup state transition in order to verify an [L2 output root][g-output-root] fr

**`kona`**

- [`client`](./bin/programs/client): The bare-metal program that runs on top of a [fault proof VM][g-fault-proof-vm].
- [`client`](./bin/client): The bare-metal program that runs on top of a [fault proof VM][g-fault-proof-vm].
- [`host`](./bin/host): The host program that runs natively alongside the FPVM, serving as the [Preimage Oracle][g-preimage-oracle] server.

**Build Pipelines**
Expand Down
14 changes: 7 additions & 7 deletions bin/programs/client/Cargo.toml → bin/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ async-trait.workspace = true
tracing.workspace = true

# local
kona-common = { path = "../../../crates/common", version = "0.0.1" }
kona-common-proc = { path = "../../../crates/common-proc", version = "0.0.1" }
kona-preimage = { path = "../../../crates/preimage", version = "0.0.1" }
kona-primitives = { path = "../../../crates/primitives", version = "0.0.1" }
kona-mpt = { path = "../../../crates/mpt", version = "0.0.1" }
kona-derive = { path = "../../../crates/derive", default-features = false, version = "0.0.1" }
kona-executor = { path = "../../../crates/executor", version = "0.0.1" }
kona-common = { path = "../../crates/common", version = "0.0.1" }
kona-common-proc = { path = "../../crates/common-proc", version = "0.0.1" }
kona-preimage = { path = "../../crates/preimage", version = "0.0.1" }
kona-primitives = { path = "../../crates/primitives", version = "0.0.1" }
kona-mpt = { path = "../../crates/mpt", version = "0.0.1" }
kona-derive = { path = "../../crates/derive", default-features = false, version = "0.0.1" }
kona-executor = { path = "../../crates/executor", version = "0.0.1" }

tracing-subscriber = { version = "0.3.18", optional = true }

Expand Down
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.
2 changes: 1 addition & 1 deletion bin/host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ alloy-consensus.workspace = true
alloy-rlp.workspace = true

# local
kona-client = { path = "../programs/client", version = "0.1.0" }
kona-client = { path = "../client", version = "0.1.0" }
kona-common = { path = "../../crates/common", version = "0.0.1" }
kona-preimage = { path = "../../crates/preimage", version = "0.0.1" }
kona-mpt = { path = "../../crates/mpt", version = "0.0.1" }
Expand Down
3 changes: 0 additions & 3 deletions bin/programs/README.md

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ homepage.workspace = true
[dependencies]
cfg-if.workspace = true
anyhow.workspace = true
kona-common = { path = "../../../crates/common" }
kona-common-proc = { path = "../../../crates/common-proc" }
kona-common = { path = "../../crates/common" }
kona-common-proc = { path = "../../crates/common-proc" }

[[bin]]
name = "minimal"
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions bin/programs/minimal/justfile → examples/minimal/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ build-cannon *args='':
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/../../../:/workdir \
-w="/workdir/bin/programs/minimal" \
-v `pwd`/../../:/workdir \
-w="/workdir/examples/minimal" \
ghcr.io/ethereum-optimism/kona/cannon-builder:main cargo build -Zbuild-std --bin minimal $@

# Build for the `asterisc` target
build-asterisc *args='':
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/../../../:/workdir \
-w="/workdir/bin/programs/minimal" \
-v `pwd`/../../:/workdir \
-w="/workdir/examples/minimal" \
ghcr.io/ethereum-optimism/kona/asterisc-builder:main cargo build -Zbuild-std --bin minimal $@
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ anyhow.workspace = true
revm.workspace = true
cfg-if.workspace = true

kona-common = { path = "../../../crates/common" }
kona-common-proc = { path = "../../../crates/common-proc" }
kona-preimage = { path = "../../../crates/preimage" }
kona-common = { path = "../../crates/common" }
kona-common-proc = { path = "../../crates/common-proc" }
kona-preimage = { path = "../../crates/preimage" }

[[bin]]
name = "simple-revm"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ build-cannon *args='':
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/../../../:/workdir \
-w="/workdir/bin/programs/simple-revm" \
-v `pwd`/../../:/workdir \
-w="/workdir/examples/simple-revm" \
ghcr.io/ethereum-optimism/kona/cannon-builder:main cargo build -Zbuild-std --bin simple-revm $@

# Build for the `asterisc` target
build-asterisc *args='':
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/../../../:/workdir \
-w="/workdir/bin/programs/simple-revm" \
-v `pwd`/../../:/workdir \
-w="/workdir/examples/simple-revm" \
ghcr.io/ethereum-optimism/kona/asterisc-builder:main cargo build -Zbuild-std --bin simple-revm $@
File renamed without changes.
8 changes: 4 additions & 4 deletions fpvm-tests/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ test: build-cannon-examples build-asterisc-examples test-cannon test-asterisc

# Build cannon programs
build-cannon-examples:
@cd ../bin/programs/minimal && just build-cannon --profile release-client-lto
@cd ../bin/programs/simple-revm && just build-cannon --profile release-client-lto
@cd ../examples/minimal && just build-cannon --profile release-client-lto
@cd ../examples/simple-revm && just build-cannon --profile release-client-lto

# Build asterisc programs
build-asterisc-examples:
@cd ../bin/programs/minimal && just build-asterisc --profile release-client-lto
@cd ../bin/programs/simple-revm && just build-asterisc --profile release-client-lto
@cd ../examples/minimal && just build-asterisc --profile release-client-lto
@cd ../examples/simple-revm && just build-asterisc --profile release-client-lto

# Test programs on `cannon`
test-cannon: test-cannon-go test-cannon-rs
Expand Down

0 comments on commit 5655e48

Please sign in to comment.