From fc825f30eb50920f5cba3731305d1671354c4af7 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Thu, 6 Feb 2025 23:51:15 -0800 Subject: [PATCH 1/9] feat: 1.81 doesn't support const mut --- .github/workflows/action_tests.yaml | 1 + .github/workflows/book.yaml | 2 ++ .github/workflows/client_host.yaml | 1 + .github/workflows/monorepo_pin_update.yaml | 2 ++ .github/workflows/release.yaml | 2 ++ .github/workflows/rust_ci.yaml | 11 +++++++++++ crates/mpt/src/list_walker.rs | 2 +- crates/proof-sdk/proof-interop/src/consolidation.rs | 2 +- crates/proof-sdk/proof/src/l2/chain_provider.rs | 2 +- crates/proof-sdk/std-fpvm/src/channel.rs | 2 +- rust-toolchain.toml | 2 ++ 11 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/action_tests.yaml b/.github/workflows/action_tests.yaml index 9dc4867d09..64c4b81e4b 100644 --- a/.github/workflows/action_tests.yaml +++ b/.github/workflows/action_tests.yaml @@ -18,6 +18,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: llvm-tools-preview + toolchain: 1.81 - uses: taiki-e/install-action@cargo-llvm-cov - name: Clone monorepo run: just monorepo diff --git a/.github/workflows/book.yaml b/.github/workflows/book.yaml index 7b2464809c..b1d75c7bae 100644 --- a/.github/workflows/book.yaml +++ b/.github/workflows/book.yaml @@ -14,6 +14,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81 - name: Setup mdbook run: | cargo install --version 0.4.40 mdbook diff --git a/.github/workflows/client_host.yaml b/.github/workflows/client_host.yaml index 114f0468fd..2e0fbdf8cb 100644 --- a/.github/workflows/client_host.yaml +++ b/.github/workflows/client_host.yaml @@ -24,6 +24,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: components: llvm-tools-preview + toolchain: 1.81 - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true diff --git a/.github/workflows/monorepo_pin_update.yaml b/.github/workflows/monorepo_pin_update.yaml index bbcc5641f7..1b95189fc5 100644 --- a/.github/workflows/monorepo_pin_update.yaml +++ b/.github/workflows/monorepo_pin_update.yaml @@ -17,6 +17,8 @@ jobs: token: ${{ secrets.PAT_TOKEN }} - uses: taiki-e/install-action@just - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81 - name: Update Monorepo Commit run: just update-monorepo - name: Create Pull Request diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 81b1e80be8..4b7f5bed84 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,6 +18,8 @@ jobs: submodules: true - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81 - name: Commit Cargo.lock run: | git config --local user.email "action@github.com" diff --git a/.github/workflows/rust_ci.yaml b/.github/workflows/rust_ci.yaml index 708a568f37..537d7c6c4d 100644 --- a/.github/workflows/rust_ci.yaml +++ b/.github/workflows/rust_ci.yaml @@ -19,6 +19,8 @@ jobs: - uses: taiki-e/install-action@just - name: Install Rust stable toolchain uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81 - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true @@ -70,6 +72,8 @@ jobs: - uses: taiki-e/install-action@just - name: Install Rust stable toolchain uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81 - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true @@ -94,6 +98,8 @@ jobs: - uses: taiki-e/install-action@just - name: Install Rust stable toolchain uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81 - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true @@ -120,6 +126,8 @@ jobs: - uses: taiki-e/install-action@just - name: Install Rust stable toolchain uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81 - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true @@ -138,6 +146,8 @@ jobs: - uses: taiki-e/install-action@just - name: Install Rust stable toolchain uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.81 - uses: taiki-e/install-action@cargo-hack - uses: Swatinem/rust-cache@v2 with: @@ -154,6 +164,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: llvm-tools-preview + toolchain: 1.81 - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true diff --git a/crates/mpt/src/list_walker.rs b/crates/mpt/src/list_walker.rs index 57045532dc..702ec8247c 100644 --- a/crates/mpt/src/list_walker.rs +++ b/crates/mpt/src/list_walker.rs @@ -77,7 +77,7 @@ where /// Takes the inner list of the [OrderedListWalker], returning it and setting the inner list to /// [None]. - pub const fn take_inner(&mut self) -> Option> { + pub fn take_inner(&mut self) -> Option> { self.inner.take() } diff --git a/crates/proof-sdk/proof-interop/src/consolidation.rs b/crates/proof-sdk/proof-interop/src/consolidation.rs index 99dd27307e..72d2fa0d05 100644 --- a/crates/proof-sdk/proof-interop/src/consolidation.rs +++ b/crates/proof-sdk/proof-interop/src/consolidation.rs @@ -40,7 +40,7 @@ where C: CommsClient + Send + Sync, { /// Creates a new [SuperchainConsolidator] with the given providers and [Header]s. - pub const fn new( + pub fn new( boot_info: &'a mut BootInfo, interop_provider: OracleInteropProvider, l2_providers: HashMap>, diff --git a/crates/proof-sdk/proof/src/l2/chain_provider.rs b/crates/proof-sdk/proof/src/l2/chain_provider.rs index e3fd577e42..3756b9c85c 100644 --- a/crates/proof-sdk/proof/src/l2/chain_provider.rs +++ b/crates/proof-sdk/proof/src/l2/chain_provider.rs @@ -39,7 +39,7 @@ impl OracleL2ChainProvider { } /// Sets the L2 chain ID to use for the provider's hints. - pub const fn set_chain_id(&mut self, chain_id: Option) { + pub fn set_chain_id(&mut self, chain_id: Option) { self.chain_id = chain_id; } diff --git a/crates/proof-sdk/std-fpvm/src/channel.rs b/crates/proof-sdk/std-fpvm/src/channel.rs index febd36ab17..d143aa89a0 100644 --- a/crates/proof-sdk/std-fpvm/src/channel.rs +++ b/crates/proof-sdk/std-fpvm/src/channel.rs @@ -69,7 +69,7 @@ struct ReadFuture<'a> { impl<'a> ReadFuture<'a> { /// Create a new [ReadFuture] from a channel and a buffer. - const fn new(channel: FileChannel, buf: &'a mut [u8]) -> Self { + fn new(channel: FileChannel, buf: &'a mut [u8]) -> Self { Self { channel, buf: RefCell::new(buf), read: 0 } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..4cef0b738f --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.81" From 27b2b254c7ee19a33e4151efca7ad8eec93aad34 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 7 Feb 2025 00:04:30 -0800 Subject: [PATCH 2/9] feat: fix frame_queue const --- crates/derive/src/test_utils/frame_queue.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/derive/src/test_utils/frame_queue.rs b/crates/derive/src/test_utils/frame_queue.rs index 1cb151c0bd..cd0f3df1fc 100644 --- a/crates/derive/src/test_utils/frame_queue.rs +++ b/crates/derive/src/test_utils/frame_queue.rs @@ -31,7 +31,7 @@ impl TestFrameQueueProvider { } /// Sets the origin for the [MockFrameQueueProvider]. - pub const fn set_origin(&mut self, origin: BlockInfo) { + pub fn set_origin(&mut self, origin: BlockInfo) { self.origin = Some(origin); } } From 18f51b017b062fa53e2f19ca7c7e84dbdc211c1f Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 7 Feb 2025 00:18:19 -0800 Subject: [PATCH 3/9] fix: rm nightly --- .vscode/settings.json | 5 ----- justfile | 10 +++++----- 2 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 0e8a88da7a..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rust-analyzer.rustfmt.extraArgs": [ - "+nightly" - ] -} \ No newline at end of file diff --git a/justfile b/justfile index 6bdde9f250..bb5e9e6da5 100644 --- a/justfile +++ b/justfile @@ -55,15 +55,15 @@ hack: # Fixes the formatting of the workspace fmt-native-fix: - cargo +nightly fmt --all + cargo fmt --all # Check the formatting of the workspace fmt-native-check: - cargo +nightly fmt --all -- --check + cargo fmt --all -- --check # Lint the workspace lint-native: fmt-native-check lint-docs - cargo +nightly clippy --workspace --all --all-features --all-targets -- -D warnings + cargo clippy --workspace --all --all-features --all-targets -- -D warnings # Lint the workspace (mips arch). Currently, only the `kona-std-fpvm` crate is linted for the `cannon` target, as it is the only crate with architecture-specific code. lint-cannon: @@ -72,7 +72,7 @@ lint-cannon: --platform linux/amd64 \ -v `pwd`/:/workdir \ -w="/workdir" \ - ghcr.io/op-rs/kona/cannon-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features -Zbuild-std=core,alloc -- -D warnings + ghcr.io/op-rs/kona/cannon-builder:main cargo clippy -p kona-std-fpvm --all-features -Zbuild-std=core,alloc -- -D warnings # Lint the workspace (risc-v arch). Currently, only the `kona-std-fpvm` crate is linted for the `asterisc` target, as it is the only crate with architecture-specific code. lint-asterisc: @@ -81,7 +81,7 @@ lint-asterisc: --platform linux/amd64 \ -v `pwd`/:/workdir \ -w="/workdir" \ - ghcr.io/op-rs/kona/asterisc-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features -Zbuild-std=core,alloc -- -D warnings + ghcr.io/op-rs/kona/asterisc-builder:main cargo clippy -p kona-std-fpvm --all-features -Zbuild-std=core,alloc -- -D warnings # Lint the Rust documentation lint-docs: From 092858691c909550ff24c06d939488c2e8abad54 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 7 Feb 2025 12:38:24 -0800 Subject: [PATCH 4/9] fix: is_sorted_by_key --- crates/interop/src/super_root.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/interop/src/super_root.rs b/crates/interop/src/super_root.rs index 2b4a3704ba..7340bb2808 100644 --- a/crates/interop/src/super_root.rs +++ b/crates/interop/src/super_root.rs @@ -125,7 +125,7 @@ mod test { ], ); - assert!(super_root.output_roots.is_sorted_by_key(|r| r.chain_id)); + assert!(super_root.output_roots.windows(2).all(|w| w[0].chain_id <= w[1].chain_id)); } #[test] From c43cbeb3c2757df0d4a9fc1a53ab0f30ef1dea5b Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 7 Feb 2025 12:41:18 -0800 Subject: [PATCH 5/9] nightly lint --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index bb5e9e6da5..e58749530d 100644 --- a/justfile +++ b/justfile @@ -63,7 +63,7 @@ fmt-native-check: # Lint the workspace lint-native: fmt-native-check lint-docs - cargo clippy --workspace --all --all-features --all-targets -- -D warnings + cargo +nightly clippy --workspace --all --all-features --all-targets -- -D warnings # Lint the workspace (mips arch). Currently, only the `kona-std-fpvm` crate is linted for the `cannon` target, as it is the only crate with architecture-specific code. lint-cannon: From 5d6c9ab6e6a991a42e57e4525e5a40cbefb0d4cd Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 7 Feb 2025 12:45:37 -0800 Subject: [PATCH 6/9] nightly fmt --- justfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index e58749530d..dcb23e3cf2 100644 --- a/justfile +++ b/justfile @@ -55,11 +55,11 @@ hack: # Fixes the formatting of the workspace fmt-native-fix: - cargo fmt --all + cargo +nightly fmt --all # Check the formatting of the workspace fmt-native-check: - cargo fmt --all -- --check + cargo +nightly fmt --all -- --check # Lint the workspace lint-native: fmt-native-check lint-docs From 235e5e42a51cb27deb91008e2d3933f7563f0a39 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 7 Feb 2025 12:52:09 -0800 Subject: [PATCH 7/9] allow --- crates/mpt/src/list_walker.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/mpt/src/list_walker.rs b/crates/mpt/src/list_walker.rs index 702ec8247c..1cdf49a35b 100644 --- a/crates/mpt/src/list_walker.rs +++ b/crates/mpt/src/list_walker.rs @@ -75,6 +75,7 @@ where Ok(()) } + #[allow(clippy::missing_const_for_fn)] /// Takes the inner list of the [OrderedListWalker], returning it and setting the inner list to /// [None]. pub fn take_inner(&mut self) -> Option> { From f854cf4cbd86d3e25e6ff277f01937c14c035191 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 7 Feb 2025 12:56:59 -0800 Subject: [PATCH 8/9] fix: remove clippy warn --- crates/derive/src/attributes/stateful.rs | 1 - crates/derive/src/stages/batch/batch_validator.rs | 1 - crates/mpt/src/list_walker.rs | 1 - justfile | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/derive/src/attributes/stateful.rs b/crates/derive/src/attributes/stateful.rs index 16fa8e2aa1..06f88ed4e2 100644 --- a/crates/derive/src/attributes/stateful.rs +++ b/crates/derive/src/attributes/stateful.rs @@ -1,4 +1,3 @@ -#![allow(clippy::unnecessary_map_or)] //! The [`AttributesBuilder`] and it's default implementation. use crate::{ diff --git a/crates/derive/src/stages/batch/batch_validator.rs b/crates/derive/src/stages/batch/batch_validator.rs index 6f807b7585..d1ff9499ab 100644 --- a/crates/derive/src/stages/batch/batch_validator.rs +++ b/crates/derive/src/stages/batch/batch_validator.rs @@ -1,4 +1,3 @@ -#![allow(clippy::unnecessary_map_or)] //! Contains the [BatchValidator] stage. use super::NextBatchProvider; diff --git a/crates/mpt/src/list_walker.rs b/crates/mpt/src/list_walker.rs index 1cdf49a35b..702ec8247c 100644 --- a/crates/mpt/src/list_walker.rs +++ b/crates/mpt/src/list_walker.rs @@ -75,7 +75,6 @@ where Ok(()) } - #[allow(clippy::missing_const_for_fn)] /// Takes the inner list of the [OrderedListWalker], returning it and setting the inner list to /// [None]. pub fn take_inner(&mut self) -> Option> { diff --git a/justfile b/justfile index dcb23e3cf2..a0cd370884 100644 --- a/justfile +++ b/justfile @@ -63,7 +63,7 @@ fmt-native-check: # Lint the workspace lint-native: fmt-native-check lint-docs - cargo +nightly clippy --workspace --all --all-features --all-targets -- -D warnings + cargo clippy --workspace --all --all-features --all-targets -- -D warnings # Lint the workspace (mips arch). Currently, only the `kona-std-fpvm` crate is linted for the `cannon` target, as it is the only crate with architecture-specific code. lint-cannon: From b47199717df03c4e13949039e4a156f07c28fa4f Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Fri, 7 Feb 2025 16:10:21 -0800 Subject: [PATCH 9/9] expose start_server --- bin/host/src/single/cfg.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/host/src/single/cfg.rs b/bin/host/src/single/cfg.rs index be1ccf1c29..d7b9abcf88 100644 --- a/bin/host/src/single/cfg.rs +++ b/bin/host/src/single/cfg.rs @@ -124,7 +124,7 @@ impl SingleChainHost { } /// Starts the preimage server, communicating with the client over the provided channels. - async fn start_server(&self, hint: C, preimage: C) -> Result>> + pub async fn start_server(&self, hint: C, preimage: C) -> Result>> where C: Channel + Send + Sync + 'static, {