From 0000e5cfaa02c35102ebbf1fd82504553a098e3a Mon Sep 17 00:00:00 2001 From: refcell Date: Thu, 20 Jun 2024 18:39:37 -0400 Subject: [PATCH] chore(workspace): reorganize binary example programs --- Cargo.lock | 10 +++++----- Cargo.toml | 4 ++-- README.md | 2 +- bin/{programs => }/client/Cargo.toml | 14 +++++++------- bin/{programs => }/client/README.md | 0 bin/{programs => }/client/justfile | 0 bin/{programs => }/client/src/boot.rs | 0 .../client/src/comms/caching_oracle.rs | 0 bin/{programs => }/client/src/comms/mod.rs | 0 bin/{programs => }/client/src/hint.rs | 0 bin/{programs => }/client/src/kona.rs | 0 bin/{programs => }/client/src/l1/blob_provider.rs | 0 bin/{programs => }/client/src/l1/chain_provider.rs | 0 bin/{programs => }/client/src/l1/driver.rs | 0 bin/{programs => }/client/src/l1/mod.rs | 0 bin/{programs => }/client/src/l2/chain_provider.rs | 0 bin/{programs => }/client/src/l2/mod.rs | 0 bin/{programs => }/client/src/l2/trie_hinter.rs | 0 bin/{programs => }/client/src/lib.rs | 0 bin/host/Cargo.toml | 2 +- bin/programs/README.md | 3 --- {bin/programs => examples}/minimal/Cargo.lock | 0 {bin/programs => examples}/minimal/Cargo.toml | 4 ++-- {bin/programs => examples}/minimal/README.md | 0 {bin/programs => examples}/minimal/justfile | 8 ++++---- {bin/programs => examples}/minimal/src/main.rs | 0 {bin/programs => examples}/simple-revm/Cargo.lock | 0 {bin/programs => examples}/simple-revm/Cargo.toml | 6 +++--- {bin/programs => examples}/simple-revm/README.md | 0 {bin/programs => examples}/simple-revm/justfile | 8 ++++---- {bin/programs => examples}/simple-revm/src/main.rs | 0 fpvm-tests/justfile | 8 ++++---- 32 files changed, 33 insertions(+), 36 deletions(-) rename bin/{programs => }/client/Cargo.toml (59%) rename bin/{programs => }/client/README.md (100%) rename bin/{programs => }/client/justfile (100%) rename bin/{programs => }/client/src/boot.rs (100%) rename bin/{programs => }/client/src/comms/caching_oracle.rs (100%) rename bin/{programs => }/client/src/comms/mod.rs (100%) rename bin/{programs => }/client/src/hint.rs (100%) rename bin/{programs => }/client/src/kona.rs (100%) rename bin/{programs => }/client/src/l1/blob_provider.rs (100%) rename bin/{programs => }/client/src/l1/chain_provider.rs (100%) rename bin/{programs => }/client/src/l1/driver.rs (100%) rename bin/{programs => }/client/src/l1/mod.rs (100%) rename bin/{programs => }/client/src/l2/chain_provider.rs (100%) rename bin/{programs => }/client/src/l2/mod.rs (100%) rename bin/{programs => }/client/src/l2/trie_hinter.rs (100%) rename bin/{programs => }/client/src/lib.rs (100%) delete mode 100644 bin/programs/README.md rename {bin/programs => examples}/minimal/Cargo.lock (100%) rename {bin/programs => examples}/minimal/Cargo.toml (73%) rename {bin/programs => examples}/minimal/README.md (100%) rename {bin/programs => examples}/minimal/justfile (74%) rename {bin/programs => examples}/minimal/src/main.rs (100%) rename {bin/programs => examples}/simple-revm/Cargo.lock (100%) rename {bin/programs => examples}/simple-revm/Cargo.toml (66%) rename {bin/programs => examples}/simple-revm/README.md (100%) rename {bin/programs => examples}/simple-revm/justfile (74%) rename {bin/programs => examples}/simple-revm/src/main.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index b8d3ad456..643658269 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -58,7 +58,7 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#68639726d659555a9693f3c1656e8efd0e2a5fdf" +source = "git+https://github.com/alloy-rs/alloy#8aa54828c025a99bbe7e2d4fc9768605d172cc6d" dependencies = [ "alloy-eips 0.1.2", "alloy-primitives", @@ -83,7 +83,7 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#68639726d659555a9693f3c1656e8efd0e2a5fdf" +source = "git+https://github.com/alloy-rs/alloy#8aa54828c025a99bbe7e2d4fc9768605d172cc6d" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#68639726d659555a9693f3c1656e8efd0e2a5fdf" +source = "git+https://github.com/alloy-rs/alloy#8aa54828c025a99bbe7e2d4fc9768605d172cc6d" dependencies = [ "alloy-primitives", "serde", @@ -3007,9 +3007,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" [[package]] name = "superchain-primitives" diff --git a/Cargo.toml b/Cargo.toml index 8bdfd48e9..bb18c45c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/README.md b/README.md index 78619722c..0643b675a 100644 --- a/README.md +++ b/README.md @@ -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** diff --git a/bin/programs/client/Cargo.toml b/bin/client/Cargo.toml similarity index 59% rename from bin/programs/client/Cargo.toml rename to bin/client/Cargo.toml index 6fea94b48..b4264fccc 100644 --- a/bin/programs/client/Cargo.toml +++ b/bin/client/Cargo.toml @@ -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 } diff --git a/bin/programs/client/README.md b/bin/client/README.md similarity index 100% rename from bin/programs/client/README.md rename to bin/client/README.md diff --git a/bin/programs/client/justfile b/bin/client/justfile similarity index 100% rename from bin/programs/client/justfile rename to bin/client/justfile diff --git a/bin/programs/client/src/boot.rs b/bin/client/src/boot.rs similarity index 100% rename from bin/programs/client/src/boot.rs rename to bin/client/src/boot.rs diff --git a/bin/programs/client/src/comms/caching_oracle.rs b/bin/client/src/comms/caching_oracle.rs similarity index 100% rename from bin/programs/client/src/comms/caching_oracle.rs rename to bin/client/src/comms/caching_oracle.rs diff --git a/bin/programs/client/src/comms/mod.rs b/bin/client/src/comms/mod.rs similarity index 100% rename from bin/programs/client/src/comms/mod.rs rename to bin/client/src/comms/mod.rs diff --git a/bin/programs/client/src/hint.rs b/bin/client/src/hint.rs similarity index 100% rename from bin/programs/client/src/hint.rs rename to bin/client/src/hint.rs diff --git a/bin/programs/client/src/kona.rs b/bin/client/src/kona.rs similarity index 100% rename from bin/programs/client/src/kona.rs rename to bin/client/src/kona.rs diff --git a/bin/programs/client/src/l1/blob_provider.rs b/bin/client/src/l1/blob_provider.rs similarity index 100% rename from bin/programs/client/src/l1/blob_provider.rs rename to bin/client/src/l1/blob_provider.rs diff --git a/bin/programs/client/src/l1/chain_provider.rs b/bin/client/src/l1/chain_provider.rs similarity index 100% rename from bin/programs/client/src/l1/chain_provider.rs rename to bin/client/src/l1/chain_provider.rs diff --git a/bin/programs/client/src/l1/driver.rs b/bin/client/src/l1/driver.rs similarity index 100% rename from bin/programs/client/src/l1/driver.rs rename to bin/client/src/l1/driver.rs diff --git a/bin/programs/client/src/l1/mod.rs b/bin/client/src/l1/mod.rs similarity index 100% rename from bin/programs/client/src/l1/mod.rs rename to bin/client/src/l1/mod.rs diff --git a/bin/programs/client/src/l2/chain_provider.rs b/bin/client/src/l2/chain_provider.rs similarity index 100% rename from bin/programs/client/src/l2/chain_provider.rs rename to bin/client/src/l2/chain_provider.rs diff --git a/bin/programs/client/src/l2/mod.rs b/bin/client/src/l2/mod.rs similarity index 100% rename from bin/programs/client/src/l2/mod.rs rename to bin/client/src/l2/mod.rs diff --git a/bin/programs/client/src/l2/trie_hinter.rs b/bin/client/src/l2/trie_hinter.rs similarity index 100% rename from bin/programs/client/src/l2/trie_hinter.rs rename to bin/client/src/l2/trie_hinter.rs diff --git a/bin/programs/client/src/lib.rs b/bin/client/src/lib.rs similarity index 100% rename from bin/programs/client/src/lib.rs rename to bin/client/src/lib.rs diff --git a/bin/host/Cargo.toml b/bin/host/Cargo.toml index 87ce616f5..d19ad3ec6 100644 --- a/bin/host/Cargo.toml +++ b/bin/host/Cargo.toml @@ -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" } diff --git a/bin/programs/README.md b/bin/programs/README.md deleted file mode 100644 index a9c2809b5..000000000 --- a/bin/programs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `kona` programs - -This directory contains all client programs checked into `kona`. diff --git a/bin/programs/minimal/Cargo.lock b/examples/minimal/Cargo.lock similarity index 100% rename from bin/programs/minimal/Cargo.lock rename to examples/minimal/Cargo.lock diff --git a/bin/programs/minimal/Cargo.toml b/examples/minimal/Cargo.toml similarity index 73% rename from bin/programs/minimal/Cargo.toml rename to examples/minimal/Cargo.toml index bc8ac4888..550984b91 100644 --- a/bin/programs/minimal/Cargo.toml +++ b/examples/minimal/Cargo.toml @@ -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" diff --git a/bin/programs/minimal/README.md b/examples/minimal/README.md similarity index 100% rename from bin/programs/minimal/README.md rename to examples/minimal/README.md diff --git a/bin/programs/minimal/justfile b/examples/minimal/justfile similarity index 74% rename from bin/programs/minimal/justfile rename to examples/minimal/justfile index b48f74bc6..c8e6ec391 100644 --- a/bin/programs/minimal/justfile +++ b/examples/minimal/justfile @@ -5,8 +5,8 @@ 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 @@ -14,6 +14,6 @@ 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 $@ diff --git a/bin/programs/minimal/src/main.rs b/examples/minimal/src/main.rs similarity index 100% rename from bin/programs/minimal/src/main.rs rename to examples/minimal/src/main.rs diff --git a/bin/programs/simple-revm/Cargo.lock b/examples/simple-revm/Cargo.lock similarity index 100% rename from bin/programs/simple-revm/Cargo.lock rename to examples/simple-revm/Cargo.lock diff --git a/bin/programs/simple-revm/Cargo.toml b/examples/simple-revm/Cargo.toml similarity index 66% rename from bin/programs/simple-revm/Cargo.toml rename to examples/simple-revm/Cargo.toml index 759e7fe44..cb89d36c5 100644 --- a/bin/programs/simple-revm/Cargo.toml +++ b/examples/simple-revm/Cargo.toml @@ -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" diff --git a/bin/programs/simple-revm/README.md b/examples/simple-revm/README.md similarity index 100% rename from bin/programs/simple-revm/README.md rename to examples/simple-revm/README.md diff --git a/bin/programs/simple-revm/justfile b/examples/simple-revm/justfile similarity index 74% rename from bin/programs/simple-revm/justfile rename to examples/simple-revm/justfile index 13e9f3e8b..4d72da496 100644 --- a/bin/programs/simple-revm/justfile +++ b/examples/simple-revm/justfile @@ -5,8 +5,8 @@ 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 @@ -14,6 +14,6 @@ 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 $@ diff --git a/bin/programs/simple-revm/src/main.rs b/examples/simple-revm/src/main.rs similarity index 100% rename from bin/programs/simple-revm/src/main.rs rename to examples/simple-revm/src/main.rs diff --git a/fpvm-tests/justfile b/fpvm-tests/justfile index 86ff23a60..595df49dd 100644 --- a/fpvm-tests/justfile +++ b/fpvm-tests/justfile @@ -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