Skip to content

Commit

Permalink
chore(apps/hermes): switch to stable rust
Browse files Browse the repository at this point in the history
  • Loading branch information
Riateche committed Nov 5, 2024
1 parent ad04400 commit 4ae66e1
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
profile: minimal
toolchain: nightly-2024-08-04
components: rustfmt, clippy
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.82.0
components: rustfmt, clippy
- name: Install protoc
uses: arduino/setup-protoc@v3
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ repos:
- id: cargo-clippy-hermes
name: Cargo clippy for Hermes
language: "rust"
entry: cargo +nightly-2024-03-26 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo +1.82.0 clippy --manifest-path ./apps/hermes/server/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: apps/hermes
# Hooks for Fortuna
Expand Down
8 changes: 4 additions & 4 deletions apps/hermes/server/Cargo.lock

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

10 changes: 2 additions & 8 deletions apps/hermes/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# The rust version itself is not so important as we install a fixed
# nightly version. We use the latest stable version to get the latest
# updates and dependencies.
FROM rust:1.77.0 AS build
FROM rust:1.82.0 AS build

# Install OS packages
RUN apt-get update && apt-get install --yes \
build-essential curl clang libssl-dev protobuf-compiler

# Set default toolchain
RUN rustup default nightly-2024-03-26

# Build
WORKDIR /src
COPY apps/hermes/server apps/hermes/server
Expand All @@ -20,7 +14,7 @@ WORKDIR /src/apps/hermes/server

RUN --mount=type=cache,target=/root/.cargo/registry cargo build --release

FROM rust:1.77.0
FROM rust:1.82.0

# Copy artifacts from other images
COPY --from=build /src/apps/hermes/server/target/release/hermes /usr/local/bin/
2 changes: 1 addition & 1 deletion apps/hermes/server/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2024-03-26"
channel = "1.82.0"
3 changes: 0 additions & 3 deletions apps/hermes/server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(never_type)]
#![feature(btree_cursors)]

use {
anyhow::Result,
clap::{
Expand Down
2 changes: 1 addition & 1 deletion apps/hermes/server/src/network/pythnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async fn fetch_bridge_data(
}
}

pub async fn run<S>(store: Arc<S>, pythnet_ws_endpoint: String) -> Result<!>
pub async fn run<S>(store: Arc<S>, pythnet_ws_endpoint: String) -> Result<()>
where
S: Aggregates,
S: Wormhole,
Expand Down
2 changes: 1 addition & 1 deletion apps/hermes/server/src/network/wormhole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ where
}

#[tracing::instrument(skip(opts, state))]
async fn run<S>(opts: RunOptions, state: Arc<S>) -> Result<!>
async fn run<S>(opts: RunOptions, state: Arc<S>) -> Result<()>
where
S: Wormhole,
S: Send + Sync + 'static,
Expand Down
5 changes: 2 additions & 3 deletions apps/hermes/server/src/state/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use {
HashMap,
HashSet,
},
ops::Bound,
sync::Arc,
},
strum::IntoEnumIterator,
Expand Down Expand Up @@ -300,8 +299,8 @@ async fn retrieve_message_state(

// Get the first element that is greater than or equal to the lookup time.
key_cache
.lower_bound(Bound::Included(&lookup_time))
.peek_next()
.range(lookup_time..)
.next()
.map(|(_, v)| v)
.cloned()
}
Expand Down

0 comments on commit 4ae66e1

Please sign in to comment.