Skip to content

Commit

Permalink
feat: Bump Rust builder version (#353)
Browse files Browse the repository at this point in the history
* bump rustc version

* fix clippy

* apply for wasi component adapter crate

* wip

* fix deny.toml

* wip

* wip

* fix

* bump for wasm/cardano

* bump

* add .secret.template file

* bump cat-ci for wasi-hermes-component-adapter

* wip

* fix md

* wip
  • Loading branch information
Mr-Leshiy authored Sep 16, 2024
1 parent 1d0d8c9 commit 3a48a2e
Show file tree
Hide file tree
Showing 44 changed files with 87 additions and 77 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# secrets
**/.secret

### Linux ###
*~

Expand Down
1 change: 1 addition & 0 deletions .secret.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN=Make One at https://github.com/settings/tokens only need public repo, read packages permissions
2 changes: 1 addition & 1 deletion docs/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.1.24 AS docs-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.03 AS docs-ci

IMPORT .. AS repo
IMPORT ../hermes AS hermes
Expand Down
2 changes: 1 addition & 1 deletion hermes/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.24 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.03 AS rust-ci
# Use when debugging cat-ci locally.
# IMPORT ../../catalyst-ci/earthly/rust AS rust-ci

Expand Down
1 change: 0 additions & 1 deletion hermes/bin/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ impl Application {
}

/// Get vfs
#[allow(dead_code)]
pub(crate) fn vfs(&self) -> &Vfs {
self.vfs.as_ref()
}
Expand Down
4 changes: 3 additions & 1 deletion hermes/bin/src/hdf5/resources/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ impl ResourceBuilder {
/// Update current resource to make it relative to the given path.
pub(crate) fn make_relative_to<P: AsRef<Path>>(&mut self, to: P) {
match self {
Self::Fs(fs) => {
Self::Fs(fs) =>
{
#[allow(clippy::needless_borrows_for_generic_args)]
if fs.is_relative() {
*fs = to.as_ref().join(&fs);
}
Expand Down
1 change: 0 additions & 1 deletion hermes/bin/src/runtime_extensions/hermes/cron/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ mod tests {
use super::*;

#[test]
#[allow(clippy::assertions_on_constants)]
fn test_cron_queue() {
let start = NaiveDate::from_ymd_opt(1970, 1, 1)
.unwrap()
Expand Down
11 changes: 5 additions & 6 deletions hermes/bin/src/runtime_extensions/hermes/cron/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ impl Host for HermesRuntimeContext {
/// ## Returns
///
/// - A list of tuples containing the scheduled crontabs and their tags, along with
/// the current retrigger flag.
/// The list is sorted from most crontab that will trigger soonest to latest.
/// Crontabs are only listed once, in the case where a crontab may be scheduled
/// may times before a later one.
/// the current retrigger flag. The list is sorted from most crontab that will
/// trigger soonest to latest. Crontabs are only listed once, in the case where a
/// crontab may be scheduled may times before a later one.
/// - `0` - `cron-tagged` - The Tagged crontab event.
/// - `1` - `bool` - The state of the retrigger flag.
fn ls(&mut self, tag: Option<CronEventTag>) -> wasmtime::Result<Vec<(CronTagged, bool)>> {
Expand Down Expand Up @@ -130,8 +129,8 @@ impl Host for HermesRuntimeContext {
/// If a particular component is out of its allowable range it will be silently
/// clamped within the allowable range of each parameter.
/// Redundant entries will be removed.
/// - For example specifying a `month` as `3` and `2-4` will
/// remove the individual month and only produce the range.
/// - For example specifying a `month` as `3` and `2-4` will remove the individual
/// month and only produce the range.
fn mkcron(
&mut self, dow: CronTime, month: CronTime, day: CronTime, hour: CronTime, minute: CronTime,
) -> wasmtime::Result<CronSched> {
Expand Down
7 changes: 3 additions & 4 deletions hermes/bin/src/runtime_extensions/hermes/cron/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,9 @@ impl InternalState {
/// ## Returns
///
/// - A list of tuples containing the scheduled crontabs and their tags, along with
/// the current retrigger flag. `Vec<(CronEventTag, bool)>`
/// The list is sorted from most crontab that will trigger soonest to latest.
/// Crontabs are only listed once, in the case where a crontab may be scheduled
/// may times before a later one.
/// the current retrigger flag. `Vec<(CronEventTag, bool)>` The list is sorted from
/// most crontab that will trigger soonest to latest. Crontabs are only listed once,
/// in the case where a crontab may be scheduled may times before a later one.
fn ls_crontabs(
&self, app_name: &ApplicationName, tag: Option<CronEventTag>,
) -> Vec<(CronTagged, bool)> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ pub(crate) fn check_signature(
}

/// Derive a new extended private key from the given extended private key.
/// - V2 derivation scheme is used as it is mention in
/// [SLIP-0023](https://github.com/satoshilabs/slips/blob/master/slip-0023.md).
/// - More information about child key derivation can be found in
/// [BIP32-Ed25519](https://input-output-hk.github.io/adrestia/static/Ed25519_BIP.pdf).
/// - V2 derivation scheme is used as it is mention in [SLIP-0023](https://github.com/satoshilabs/slips/blob/master/slip-0023.md).
/// - More information about child key derivation can be found in [BIP32-Ed25519](https://input-output-hk.github.io/adrestia/static/Ed25519_BIP.pdf).
///
/// # Arguments
///
Expand Down
4 changes: 2 additions & 2 deletions hermes/bin/src/runtime_extensions/hermes/crypto/bip39.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ pub(crate) fn mnemonic_to_xprv(mnemonic: &str, passphrase: &str) -> Result<XPrv,
///
/// # Arguments
///
/// - `word_count`: The number of words in the mnemonic. Must be a multiple of
/// 3 and in the range of 12 - 24.
/// - `word_count`: The number of words in the mnemonic. Must be a multiple of 3 and in
/// the range of 12 - 24.
/// - `prefix`: A vector of strings representing the prefix, empty if no prefix.
/// - `language`: The language of the mnemonic.
///
Expand Down
12 changes: 6 additions & 6 deletions hermes/bin/src/runtime_extensions/hermes/hash/blake2b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use crate::runtime_extensions::bindings::hermes::{binary::api::Bstr, hash::api::
/// # Arguments
///
/// - `buf`: A reference to the byte string for which the hash is to be computed.
/// - `outlen`: Optional output length in bytes. If not specified,
/// it defaults to 64 bytes.
/// - `outlen`: Optional output length in bytes. If not specified, it defaults to 64
/// bytes.
///
/// # Returns
///
Expand Down Expand Up @@ -42,12 +42,12 @@ pub(crate) fn blake2b_impl(buf: &Bstr, outlen: Option<u8>) -> Result<Bstr, Errno
/// # Arguments
///
/// - `buf`: A reference to the byte string for which the blake2bMac is to be computed.
/// - `outlen`: Optional output length in bytes. If not specified,
/// it defaults to 64 bytes.
/// - `outlen`: Optional output length in bytes. If not specified, it defaults to 64
/// bytes.
/// - `key`: A reference to the byte string used as the key for computing the blake2bMac.
/// - `salt`: Optional salt value. If not specified, it defaults to an empty byte string.
/// - `personal`: Optional personalization string. If not specified,
/// it defaults to an empty byte string.
/// - `personal`: Optional personalization string. If not specified, it defaults to an
/// empty byte string.
///
/// # Returns
///
Expand Down
2 changes: 2 additions & 0 deletions hermes/bin/src/runtime_extensions/hermes/logging/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ impl Host for HermesRuntimeContext {
/// The format of the backtrace lines is up to the webasm module generating the log.
/// The individual backtrace entries may contain line breaks if the backtrace entry is
/// multiline.
///
/// * Multiline backtrace entries should be de-dented, relative to the first line.
/// * This is to allow the display to properly format multiline entries.
///
/// This format is designed to keep the broadest flexibility for multiple languages
/// capabilities.
/// The backtrace must be sorted with most recent lines of the backtrace occurring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ pub(crate) fn column(stmt_ptr: *mut sqlite3_stmt, index: i32) -> Result<Value, E
SQLITE_FLOAT => Value::Double(sqlite3_column_double(stmt_ptr, index)),
SQLITE_INTEGER => {
let int_value = sqlite3_column_int64(stmt_ptr, index);
if int_value >= i64::from(std::i32::MIN) && int_value <= i64::from(std::i32::MAX) {
let int_value =
i32::try_from(int_value).map_err(|_| Errno::ConvertingNumeric)?;

if let Ok(int_value) = i32::try_from(int_value) {
Value::Int32(int_value)
} else {
Value::Int64(int_value)
Expand Down
4 changes: 2 additions & 2 deletions hermes/bin/src/runtime_extensions/resource_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::app::ApplicationName;

/// `ResourceStorage` struct.
/// - `WitType` represents the type from the wit file definitions and which will appear in
/// the `wasmtime::component::Resource<WitType>` object.
/// the `wasmtime::component::Resource<WitType>` object.
/// - `RustType` actually the type which is bound to the `WitType` and holds all the data
/// needed for the `WitType`.
pub(crate) struct ResourceStorage<WitType, RustType> {
Expand Down Expand Up @@ -96,7 +96,7 @@ where WitType: 'static

/// `ApplicationResourceStorage` struct.
/// - `WitType` represents the type from the wit file definitions and which will appear in
/// the `wasmtime::component::Resource<WitType>` object.
/// the `wasmtime::component::Resource<WitType>` object.
/// - `RustType` actually the type which is bound to the `WitType` and holds all the data
/// needed for the `WitType`.
pub(crate) struct ApplicationResourceStorage<WitType, RustType> {
Expand Down
11 changes: 5 additions & 6 deletions hermes/bin/src/runtime_extensions/wasi/filesystem/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,11 @@ impl filesystem::types::HostDescriptor for HermesRuntimeContext {
///
/// Implementations are encouraged to provide the following properties:
///
/// - If the file is not modified or replaced, the computed hash value should
/// usually not change.
/// - If the object is modified or replaced, the computed hash value should
/// usually change.
/// - The inputs to the hash should not be easily computable from the
/// computed hash.
/// - If the file is not modified or replaced, the computed hash value should usually
/// not change.
/// - If the object is modified or replaced, the computed hash value should usually
/// change.
/// - The inputs to the hash should not be easily computable from the computed hash.
///
/// However, none of these is required.
fn metadata_hash(
Expand Down
4 changes: 2 additions & 2 deletions hermes/bin/src/runtime_extensions/wasi/io/streams/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ impl HostOutputStream for HermesRuntimeContext {
///
/// The behavior of splice is equivalent to:
/// 1. calling `check-write` on the `output-stream`
/// 2. calling `read` on the `input-stream` with the smaller of the
/// `check-write` permitted length and the `len` provided to `splice`
/// 2. calling `read` on the `input-stream` with the smaller of the `check-write`
/// permitted length and the `len` provided to `splice`
/// 3. calling `write` on the `output-stream` with that read data.
///
/// Any error reported by the call to `check-write`, `read`, or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It doesn't matter which network the snapshot is from because the benchmark will
There are 2 modes in which the benchmark can be executed:

| Benchmark name | Description |
---------------------------|--------------|
|--------------------------|--------------|
| pallas | When executed with `--bench-name pallas`, the benchmark reads the Mithril snapshot from origin to its tip using only the `pallas` crate mechanisms |
| cardano&#x2011;chain&#x2011;follower | When executed with `--bench-name cardano-chain-follower` it uses the `cardano-chain-follower` crate to follow the chain from origin to the tip of the specified snapshot |

Expand Down
4 changes: 2 additions & 2 deletions hermes/crates/hermes-ipfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ impl HermesIpfs {
/// List all pins in the IPFS node.
///
/// ## Parameters
/// * `cid` - `Option<Cid>` Optional content identifier to list pins.
/// If `None`, lists all pins.
/// * `cid` - `Option<Cid>` Optional content identifier to list pins. If `None`, lists
/// all pins.
///
/// ## Errors
/// Returns an error if listing pins fails.
Expand Down
16 changes: 11 additions & 5 deletions hermes/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ targets = [
version = 2
ignore = [
{ id = "RUSTSEC-2020-0168", reason = "`mach` is used by wasmtime and we have no control over that." },
{ id = "RUSTSEC-2021-0145", reason = "we don't target windows, and don;t use a custom global allocator." },
{ id = "RUSTSEC-2021-0145", reason = "we don't target windows, and don't use a custom global allocator." },
{ id = "RUSTSEC-2024-0370", reason = "`proc-macro-error` is used by crates we rely on, we can't control what they use."},
]

[bans]
multiple-versions = "warn"
wildcards = 'deny'
deny = [
# { crate = "git2", use-instead = "gix" },
{ crate = "openssl", use-instead = "rustls" },
{ crate = "openssl-sys", use-instead = "rustls" },
# Scylla DB Drivers currently require OpenSSL. Its unavoidable.
# However, there is movement to enable support for Rustls.
# So, for now, allow open-ssl but it needs to be disabled as soon as Scylla DB enables Rustls.
#{ crate = "openssl", use-instead = "rustls" },
#{ crate = "openssl-sys", use-instead = "rustls" },
"libssh2-sys",
# { crate = "git2", use-instead = "gix" },
# { crate = "cmake", use-instead = "cc" },
# { crate = "windows", reason = "bloated and unnecessary", use-instead = "ideally inline bindings, practically, windows-sys" },
]
Expand All @@ -49,8 +53,9 @@ unknown-git = "deny"

# List of URLs for allowed Git repositories
allow-git = [
"https://github.com/input-output-hk/hermes.git",
"https://github.com/input-output-hk/catalyst-libs.git",
"https://github.com/input-output-hk/catalyst-pallas.git",
"https://github.com/input-output-hk/catalyst-mithril.git",
"https://github.com/bytecodealliance/wasmtime",
"https://github.com/aldanor/hdf5-rust",
]
Expand All @@ -73,6 +78,7 @@ allow = [
"ISC",
"Unicode-3.0",
"MPL-2.0",
"Zlib",
]
exceptions = [
#{ allow = ["Zlib"], crate = "tinyvec" },
Expand Down
2 changes: 1 addition & 1 deletion hermes/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.78"
channel = "1.80"
profile = "default"
targets = ["x86_64-unknown-linux-musl"]
2 changes: 1 addition & 1 deletion wasm/integration-test/cardano/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.24 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.03 AS rust-ci
# Use when debugging cat-ci locally.
# IMPORT ../../catalyst-ci/earthly/rust AS rust-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/cardano/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.78"
channel = "1.80"
targets = ["wasm32-wasip1"]
2 changes: 1 addition & 1 deletion wasm/integration-test/clocks/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.1.24 AS wasm-c-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.2.03 AS wasm-c-ci
# Use when debugging cat-ci locally.
# IMPORT ../../../catalyst-ci/earthly/wasm/c AS wasm-c-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/cron/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.1.24 AS wasm-c-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.2.03 AS wasm-c-ci
# Use when debugging cat-ci locally.
# IMPORT ../../../catalyst-ci/earthly/wasm/c AS wasm-c-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/crypto/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.1.24 AS wasm-c-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.2.03 AS wasm-c-ci
# Use when debugging cat-ci locally.
# IMPORT ../../../catalyst-ci/earthly/wasm/c AS wasm-c-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/golang/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust/tools:v3.1.24 AS rust-tools
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust/tools:v3.2.03 AS rust-tools

IMPORT ../../wasi AS wasi
IMPORT ../../wasi-hermes-component-adapter AS wasi-hermes-component-adapter
Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/hashing/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.1.24 AS wasm-c-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.2.03 AS wasm-c-ci
# Use when debugging cat-ci locally.
# IMPORT ../../../catalyst-ci/earthly/wasm/c AS wasm-c-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/http_reply/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.8 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.03 AS rust-ci
# Use when debugging cat-ci locally.
# IMPORT ../../catalyst-ci/earthly/rust AS rust-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/http_reply/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.78"
channel = "1.80"
targets = ["wasm32-unknown-unknown"]
2 changes: 1 addition & 1 deletion wasm/integration-test/ipfs/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.24 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.03 AS rust-ci
# Use when debugging cat-ci locally.
# IMPORT ../../catalyst-ci/earthly/rust AS rust-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/ipfs/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.78"
channel = "1.80"
targets = ["wasm32-unknown-unknown"]
2 changes: 1 addition & 1 deletion wasm/integration-test/localtime/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.1.24 AS wasm-c-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.2.03 AS wasm-c-ci
# Use when debugging cat-ci locally.
# IMPORT ../../../catalyst-ci/earthly/wasm/c AS wasm-c-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/logger/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.1.24 AS wasm-c-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.2.03 AS wasm-c-ci
# Use when debugging cat-ci locally.
# IMPORT ../../../catalyst-ci/earthly/wasm/c AS wasm-c-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/smoke-test/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.1.24 AS wasm-c-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/wasm/c:v3.2.03 AS wasm-c-ci
# Use when debugging cat-ci locally.
# IMPORT ../../../catalyst-ci/earthly/wasm/c AS wasm-c-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/sqlite/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION 0.8

IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.1.24 AS rust-ci
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.03 AS rust-ci
# Use when debugging cat-ci locally.
# IMPORT ../../catalyst-ci/earthly/rust AS rust-ci

Expand Down
2 changes: 1 addition & 1 deletion wasm/integration-test/sqlite/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.78"
channel = "1.80"
targets = ["wasm32-wasip1"]
Loading

0 comments on commit 3a48a2e

Please sign in to comment.