diff --git a/.github/workflows/bento-release.yml b/.github/workflows/bento-release.yml index 177b352b4..0bf4f3d90 100644 --- a/.github/workflows/bento-release.yml +++ b/.github/workflows/bento-release.yml @@ -18,7 +18,7 @@ on: env: RISC0_TOOLCHAIN_VERSION: 1.88.0 RISC0_CRATE_VERSION: "3.0.3" - RUST_VERSION: "1.88.0" + RUST_VERSION: "1.91.1" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/broker-release.yml b/.github/workflows/broker-release.yml index 952def50c..892436d9b 100644 --- a/.github/workflows/broker-release.yml +++ b/.github/workflows/broker-release.yml @@ -18,7 +18,7 @@ on: env: RISC0_TOOLCHAIN_VERSION: 1.88.0 RISC0_CRATE_VERSION: "3.0.3" - RUST_VERSION: "1.88.0" + RUST_VERSION: "1.91.1" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} FOUNDRY_VERSION: v1.2.3 diff --git a/.vscode/settings.json b/.vscode/settings.json index 407808197..6f6503ab9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,11 +8,14 @@ "CARGO_TARGET_DIR": "target/analyzer" }, "rust-analyzer.check.command": "clippy", - "rust-analyzer.check.extraArgs": ["--target-dir=target/analyzer"], + "rust-analyzer.check.extraArgs": [ + "--target-dir=target/analyzer" + ], "rust-analyzer.linkedProjects": [ "./Cargo.toml", "./crates/boundless-cli/Cargo.toml", "./crates/broker/Cargo.toml", + "./bento/Cargo.toml", // "./crates/guest/assessor/assessor-guest/Cargo.toml", // "./crates/guest/util/echo/Cargo.toml", // "./crates/guest/util/identity/Cargo.toml", @@ -20,7 +23,12 @@ // "./examples/smart-contract-requestor/Cargo.toml", // "./examples/counter-with-callback/Cargo.toml" ], - "rust-analyzer.files.exclude": ["./lib/", "./contracts/out/"], + "rust-analyzer.files.exclude": [ + // Exclude solidity artifacts and dependencies + "./lib/", + "./contracts/out/", + "./out/", + ], "[javascript][javascriptreact][typescript][typescriptreact][github-actions-workflow][json][css]": { "editor.defaultFormatter": "biomejs.biome", "editor.codeActionsOnSave": { @@ -32,11 +40,13 @@ "biome.rename": true, "biome.enabled": true, "biome.lspBin": "documentation/node_modules/.bin/biome", - "cSpell.words": ["offchain"], + "cSpell.words": [ + "offchain" + ], "[typescript]": { "editor.defaultFormatter": "vscode.typescript-language-features" }, "[json]": { "editor.defaultFormatter": "vscode.json-language-features" } -} +} \ No newline at end of file diff --git a/crates/boundless-cli/src/commands/prover/generate_config.rs b/crates/boundless-cli/src/commands/prover/generate_config.rs index 1ec844227..b411d2405 100644 --- a/crates/boundless-cli/src/commands/prover/generate_config.rs +++ b/crates/boundless-cli/src/commands/prover/generate_config.rs @@ -931,7 +931,7 @@ impl ProverGenerateConfig { prices_per_mcycle.sort_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal)); // Calculate median (50th percentile) - let median_price = if prices_per_mcycle.len() % 2 == 0 { + let median_price = if prices_per_mcycle.len().is_multiple_of(2) { let mid = prices_per_mcycle.len() / 2; (prices_per_mcycle[mid - 1] + prices_per_mcycle[mid]) / 2.0 } else { diff --git a/crates/boundless-cli/src/indexer_client.rs b/crates/boundless-cli/src/indexer_client.rs index dd83a600b..b27721d55 100644 --- a/crates/boundless-cli/src/indexer_client.rs +++ b/crates/boundless-cli/src/indexer_client.rs @@ -236,45 +236,6 @@ pub struct PaginationInfo { pub limit: u32, } -#[derive(Debug, Deserialize, Serialize)] -pub struct StakingEntry { - pub staker_address: String, - pub epoch: u64, - pub staked_amount: String, - pub staked_amount_formatted: String, - pub is_withdrawing: bool, - pub rewards_generated: String, - pub rewards_generated_formatted: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub rank: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub rewards_delegated_to: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub votes_delegated_to: Option, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct StakingSummary { - pub staker_address: String, - pub total_staked: String, - pub total_staked_formatted: String, - pub is_withdrawing: bool, - pub epochs_participated: u64, - pub total_rewards_generated: String, - pub total_rewards_generated_formatted: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub rewards_delegated_to: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub votes_delegated_to: Option, -} - -#[derive(Debug, Deserialize, Serialize)] -pub struct StakingHistoryResponse { - pub entries: Vec, - pub pagination: PaginationInfo, - pub summary: Option, -} - #[derive(Debug, Deserialize, Serialize)] pub struct EpochStakingSummary { pub epoch: u64, @@ -293,13 +254,6 @@ pub struct EpochStakingSummary { pub last_updated_at: Option, } -#[derive(Debug, Deserialize, Serialize)] -pub struct EpochStakingResponse { - pub entries: Vec, - pub pagination: PaginationInfo, - pub summary: Option, -} - #[derive(Debug, Deserialize, Serialize)] pub struct PovwEntry { #[serde(skip_serializing_if = "Option::is_none")] @@ -349,13 +303,6 @@ pub struct EpochPovwSummary { pub last_updated_at: Option, } -#[derive(Debug, Deserialize, Serialize)] -pub struct EpochPovwResponse { - pub entries: Vec, - pub pagination: PaginationInfo, - pub summary: Option, -} - ///Data for a specific address in a specific epoch #[derive(Debug, Deserialize, Serialize)] pub struct EpochPovwAddressData { diff --git a/crates/broker/src/config.rs b/crates/broker/src/config.rs index e0edf50dd..e3f8501bd 100644 --- a/crates/broker/src/config.rs +++ b/crates/broker/src/config.rs @@ -166,10 +166,11 @@ mod defaults { } /// Order pricing priority mode for determining which orders to price first -#[derive(Debug, Deserialize, Serialize, Clone, Copy, PartialEq, Eq)] +#[derive(Default, Debug, Deserialize, Serialize, Clone, Copy, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum OrderPricingPriority { /// Process orders in random order to distribute competition among provers + #[default] Random, /// Process orders in the order they were observed (FIFO) ObservationTime, @@ -177,14 +178,8 @@ pub enum OrderPricingPriority { ShortestExpiry, } -impl Default for OrderPricingPriority { - fn default() -> Self { - Self::Random - } -} - /// Order commitment priority mode for determining which orders to commit to first -#[derive(Debug, Deserialize, Serialize, Clone, Copy, PartialEq, Eq)] +#[derive(Default, Debug, Deserialize, Serialize, Clone, Copy, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub enum OrderCommitmentPriority { /// Process orders in random order to distribute competition among provers @@ -194,15 +189,10 @@ pub enum OrderCommitmentPriority { /// Process lock-and-fulfill orders by highest ETH payment, then fulfill-after-lock-expire random weighted by collateral reward Price, /// Process lock-and-fulfill orders by highest ETH price per cycle, then fulfill-after-lock-expire random weighted by collateral reward + #[default] CyclePrice, } -impl Default for OrderCommitmentPriority { - fn default() -> Self { - Self::CyclePrice - } -} - /// All configuration related to markets mechanics #[derive(Debug, Deserialize, Serialize)] #[non_exhaustive] diff --git a/crates/lambdas/indexer-api/src/models.rs b/crates/lambdas/indexer-api/src/models.rs index 3ceaa2225..7e20435e1 100644 --- a/crates/lambdas/indexer-api/src/models.rs +++ b/crates/lambdas/indexer-api/src/models.rs @@ -16,6 +16,7 @@ use serde::{Deserialize, Serialize}; use utoipa::ToSchema; /// Health check response +#[allow(dead_code)] #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct HealthResponse { pub status: String, diff --git a/crates/lambdas/indexer-api/tests/local_integration.rs b/crates/lambdas/indexer-api/tests/local_integration.rs index 65df49726..8883a28ab 100644 --- a/crates/lambdas/indexer-api/tests/local_integration.rs +++ b/crates/lambdas/indexer-api/tests/local_integration.rs @@ -233,7 +233,7 @@ impl SharedTestEnv { } // Print progress every 5 seconds - if start.elapsed().as_secs() % 5 == 0 { + if start.elapsed().as_secs().is_multiple_of(5) { let size = std::fs::metadata(db_path).map(|m| m.len()).unwrap_or(0); debug!( "Still indexing... (elapsed: {}s, DB size: {} bytes)", diff --git a/dockerfiles/agent.dockerfile b/dockerfiles/agent.dockerfile index b37fae340..d55325094 100644 --- a/dockerfiles/agent.dockerfile +++ b/dockerfiles/agent.dockerfile @@ -19,7 +19,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \ # Install rust and target version (should match rust-toolchain.toml for best speed) RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \ && chmod -R a+w $RUSTUP_HOME $CARGO_HOME \ - && rustup install 1.88 + && rustup install 1.91.1 # Install protoc RUN curl -o protoc.zip -L https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-linux-x86_64.zip \ diff --git a/dockerfiles/agent.prebuilt.dockerfile b/dockerfiles/agent.prebuilt.dockerfile index d9fc32c77..cea98eb9f 100644 --- a/dockerfiles/agent.prebuilt.dockerfile +++ b/dockerfiles/agent.prebuilt.dockerfile @@ -31,7 +31,7 @@ ENV PATH="/root/.cargo/bin:${PATH}" # Install rust and target version (should match rust-toolchain.toml for best speed) RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \ && chmod -R a+w $RUSTUP_HOME $CARGO_HOME \ - && rustup install 1.88 + && rustup install 1.91.1 # Install RISC0 specifically for groth16 component - this layer will be cached unless RISC0_HOME changes RUN curl -L https://risczero.com/install | bash && \ diff --git a/dockerfiles/bento_cli.dockerfile b/dockerfiles/bento_cli.dockerfile index 716774f9c..58c85d4ca 100644 --- a/dockerfiles/bento_cli.dockerfile +++ b/dockerfiles/bento_cli.dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -ARG RUST_IMG=rust:1.88-bookworm +ARG RUST_IMG=rust:1.91.1-bookworm ARG S3_CACHE_PREFIX="public/rust-cache-docker-Linux-X64/sccache" FROM ${RUST_IMG} AS rust-builder diff --git a/dockerfiles/broker.dockerfile b/dockerfiles/broker.dockerfile index 694a07fdc..089f2b03c 100644 --- a/dockerfiles/broker.dockerfile +++ b/dockerfiles/broker.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.88.0-bookworm AS init +FROM rust:1.91.1-bookworm AS init RUN apt-get -qq update && \ apt-get install -y -q clang @@ -64,7 +64,7 @@ SHELL ["/bin/bash", "-c"] RUN cargo build --release --bin broker && \ cp /src/target/release/broker /src/broker -FROM rust:1.88.0-bookworm AS runtime +FROM rust:1.91.1-bookworm AS runtime RUN mkdir /app/ diff --git a/dockerfiles/distributor.dockerfile b/dockerfiles/distributor.dockerfile index bd7cbc74f..272fd8c57 100644 --- a/dockerfiles/distributor.dockerfile +++ b/dockerfiles/distributor.dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM rust:1.88.0-bookworm AS init +FROM rust:1.91.1-bookworm AS init RUN apt-get -qq update && \ apt-get install -y -q clang diff --git a/dockerfiles/market-indexer.dockerfile b/dockerfiles/market-indexer.dockerfile index 0fdc890f8..bb7ceaa4c 100644 --- a/dockerfiles/market-indexer.dockerfile +++ b/dockerfiles/market-indexer.dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM rust:1.88.0-bookworm AS init +FROM rust:1.91.1-bookworm AS init RUN apt-get -qq update && \ apt-get install -y -q clang diff --git a/dockerfiles/order_generator.dockerfile b/dockerfiles/order_generator.dockerfile index 1196b95f8..2bc450f75 100644 --- a/dockerfiles/order_generator.dockerfile +++ b/dockerfiles/order_generator.dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM rust:1.88.0-bookworm AS init +FROM rust:1.91.1-bookworm AS init RUN apt-get -qq update && \ apt-get install -y -q clang diff --git a/dockerfiles/order_stream.dockerfile b/dockerfiles/order_stream.dockerfile index cb7f1b3e1..163dd64b8 100644 --- a/dockerfiles/order_stream.dockerfile +++ b/dockerfiles/order_stream.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.88.0-bookworm AS init +FROM rust:1.91.1-bookworm AS init RUN apt-get -qq update && \ apt-get install -y -q clang @@ -64,7 +64,7 @@ SHELL ["/bin/bash", "-c"] RUN cargo build --release -p order-stream --bin order_stream && \ cp /src/target/release/order_stream /src/order_stream -FROM rust:1.88.0-bookworm AS runtime +FROM rust:1.91.1-bookworm AS runtime RUN mkdir /app/ diff --git a/dockerfiles/rest_api.dockerfile b/dockerfiles/rest_api.dockerfile index b45cb6772..17166e078 100644 --- a/dockerfiles/rest_api.dockerfile +++ b/dockerfiles/rest_api.dockerfile @@ -1,6 +1,6 @@ ARG S3_CACHE_PREFIX="public/rust-cache-docker-Linux-X64/sccache" -FROM rust:1.85.0-bookworm AS builder +FROM rust:1.91.1-bookworm AS builder RUN apt-get -qq update && apt-get install -y -q clang @@ -23,7 +23,7 @@ RUN --mount=type=secret,id=ci_cache_creds,target=/root/.aws/credentials \ cp bento/target/release/rest_api /src/rest_api && \ sccache --show-stats -FROM rust:1.85.0-bookworm AS runtime +FROM rust:1.91.1-bookworm AS runtime RUN mkdir /app/ && \ apt -qq update && \ diff --git a/dockerfiles/rewards-indexer.dockerfile b/dockerfiles/rewards-indexer.dockerfile index 73597f6f8..9c61b247a 100644 --- a/dockerfiles/rewards-indexer.dockerfile +++ b/dockerfiles/rewards-indexer.dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM rust:1.88.0-bookworm AS init +FROM rust:1.91.1-bookworm AS init RUN apt-get -qq update && \ apt-get install -y -q clang diff --git a/dockerfiles/slasher.dockerfile b/dockerfiles/slasher.dockerfile index c9a43d8e5..40b0b3f59 100644 --- a/dockerfiles/slasher.dockerfile +++ b/dockerfiles/slasher.dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM rust:1.88.0-bookworm AS init +FROM rust:1.91.1-bookworm AS init RUN apt-get -qq update && \ apt-get install -y -q clang diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 95794a1ae..79adf203d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.89" +channel = "1.91.1" components = ["clippy", "rustfmt", "rust-src"] profile = "minimal"