Skip to content

Commit

Permalink
Merge pull request #5587 from oasisprotocol/ptrus/stable/23.0.x/go-1.…
Browse files Browse the repository at this point in the history
…21.8

[stable/23.0.x] go: update to 1.21.8
  • Loading branch information
ptrus authored Mar 7, 2024
2 parents 96bb870 + 52e9da9 commit 0c49f47
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 57 deletions.
1 change: 1 addition & 0 deletions .changelog/5513.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump Rust toolchain to 2024-01-08
1 change: 1 addition & 0 deletions .changelog/5587.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go: Update go to 1.21.8
2 changes: 1 addition & 1 deletion .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
go-version: "1.21.8"
- name: Set up Rust
run: rustup show
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-reproducibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
go-version: "1.21.8"
- name: Set up Rust
working-directory: build${{ matrix.build_number }}
run: rustup show
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
go-version: "1.21.8"
- name: Set up Rust
run: rustup show
- name: Install Oasis Node prerequisites
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
go-version: "1.21.8"

- name: Set up Rust
run: rustup show
Expand Down
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct_field_align_threshold = 0
enum_discrim_align_threshold = 0
match_arm_blocks = true
force_multiline_blocks = false
fn_args_layout = "Tall"
fn_params_layout = "Tall"
brace_style = "SameLineWhere"
control_brace_style = "AlwaysSameLine"
trailing_semicolon = true
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions docker/oasis-core-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:22.04

# Package versions.
ARG GO_VERSION=1.21.0
ARG GO_VERSION=1.21.8
ARG GO_NANCY_VERSION=1.0.33
ARG GO_NANCY_CHECKSUM=a4bf5290d41b095c04f941ed5380674770c79d59735e33b1bd07a5cd5fbb135d
ARG GO_PROTOC_VERSION=3.6.1
Expand All @@ -10,7 +10,7 @@ ARG GOLANGCILINT_VERSION=1.54.2
ARG GOCOVMERGE_VERSION=b5bfa59ec0adc420475f97f89b58045c721d761c
ARG GOFUMPT_VERSION=v0.5.0
ARG GOIMPORTS_VERSION=v0.12.0
ARG RUST_NIGHTLY_VERSION=2023-01-16
ARG RUST_NIGHTLY_VERSION=2024-01-08
ARG JEMALLOC_VERSION=5.2.1
ARG JEMALLOC_CHECKSUM=34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6

Expand Down Expand Up @@ -52,8 +52,8 @@ RUN curl "https://sh.rustup.rs" -sfo rustup.sh && \
sh rustup.sh -y --default-toolchain nightly-${RUST_NIGHTLY_VERSION} && \
rustup target add x86_64-fortanix-unknown-sgx && \
rustup component add rustfmt && \
cargo install --git https://github.com/fortanix/rust-sgx --rev 998c34d158a69dd1af33f22587e8ae1c26ca6a27 fortanix-sgx-tools && \
cargo install --git https://github.com/fortanix/rust-sgx --rev 998c34d158a69dd1af33f22587e8ae1c26ca6a27 sgxs-tools && \
cargo install --git https://github.com/fortanix/rust-sgx --rev c9028cffb8d80fe325f10eefb26f1f912c235c21 fortanix-sgx-tools && \
cargo install --git https://github.com/fortanix/rust-sgx --rev c9028cffb8d80fe325f10eefb26f1f912c235c21 sgxs-tools && \
cargo install cargo-audit

# Install Go and utilities.
Expand Down
14 changes: 7 additions & 7 deletions docs/development-setup/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Core:
```
<!-- markdownlint-enable line-length -->

* [Go] (at least version 1.21.0).
* [Go] (at least version 1.21.8).

If your distribution provides a new-enough version of Go, just use that.

Expand All @@ -52,18 +52,18 @@ Core:
* [ensure `$GOPATH/bin` is in your `PATH`](
https://tip.golang.org/doc/code.html#GOPATH),
* [install the desired version of Go](
https://golang.org/doc/install#extra_versions), e.g. 1.21.0, with:
https://golang.org/doc/install#extra_versions), e.g. 1.21.8, with:

```
go install golang.org/dl/go1.21.0@latest
go1.21.0 download
go install golang.org/dl/go1.21.8@latest
go1.21.8 download
```

* instruct the build system to use this particular version of Go by setting
the `OASIS_GO` environment variable in your `~/.bashrc`:

```
export OASIS_GO=go1.21.0
export OASIS_GO=go1.21.8
```

* [Rust].
Expand Down Expand Up @@ -125,8 +125,8 @@ Core:
active toolchain
----------------
nightly-2023-01-16-x86_64-unknown-linux-gnu (overridden by '/code/rust-toolchain.toml')
rustc 1.68.0-nightly (9e75dddf6 2023-01-15)
nightly-2024-01-08-x86_64-unknown-linux-gnu (overridden by '/code/rust-toolchain.toml')
rustc 1.77.0-nightly (75c68cfd2 2024-01-07)
```

* (**OPTIONAL**) [gofumpt] and [goimports].
Expand Down
4 changes: 2 additions & 2 deletions go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d
google.golang.org/grpc v1.59.0
google.golang.org/grpc/security/advancedtls v0.0.0-20221004221323-12db695f1648
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v3 v3.0.1
)

Expand Down Expand Up @@ -193,4 +193,4 @@ require (
lukechampine.com/blake3 v1.2.1 // indirect
)

go 1.21
go 1.21.8
4 changes: 2 additions & 2 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1093,8 +1093,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
18 changes: 3 additions & 15 deletions keymanager/src/crypto/packing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ pub fn unpack_runtime_id_epoch(data: Vec<u8>) -> Option<(Namespace, EpochTime)>
return None;
}

let runtime_id: Namespace = data
.get(0..NAMESPACE_SIZE)
.unwrap()
.try_into()
.expect("slice with incorrect length");
let runtime_id: Namespace = data.get(0..NAMESPACE_SIZE).unwrap().into();

let epoch = u64::from_le_bytes(
data.get(NAMESPACE_SIZE..)
Expand All @@ -65,11 +61,7 @@ pub fn unpack_runtime_id_generation(data: Vec<u8>) -> Option<(Namespace, u64)> {
return None;
}

let runtime_id: Namespace = data
.get(0..NAMESPACE_SIZE)
.unwrap()
.try_into()
.expect("slice with incorrect length");
let runtime_id: Namespace = data.get(0..NAMESPACE_SIZE).unwrap().into();

let generation = u64::from_le_bytes(
data.get(NAMESPACE_SIZE..)
Expand Down Expand Up @@ -100,11 +92,7 @@ pub fn unpack_runtime_id_generation_epoch(data: Vec<u8>) -> Option<(Namespace, u
return None;
}

let runtime_id: Namespace = data
.get(0..NAMESPACE_SIZE)
.unwrap()
.try_into()
.expect("slice with incorrect length");
let runtime_id: Namespace = data.get(0..NAMESPACE_SIZE).unwrap().into();

let generation = u64::from_le_bytes(
data.get(NAMESPACE_SIZE..NAMESPACE_SIZE + GENERATION_SIZE)
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/consensus/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl RolesMask {

impl PartialOrd for RolesMask {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.0.partial_cmp(&other.0)
Some(self.cmp(other))
}
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/consensus/tendermint/verifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@ impl Verifier {
let peer_id = PeerId::new([0; 20]);
let clock = Box::new(InsecureClock);
let verifier = Box::new(PredicateVerifier::new(
ProdPredicates::default(),
ProdPredicates,
ProvidedVotingPowerCalculator::<signature::DomSepVerifier>::default(),
ProdCommitValidator::default(),
ProdCommitValidator,
));
let io = Box::new(Io::new(&self.protocol));

Expand Down
4 changes: 0 additions & 4 deletions runtime/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ use crate::{

/// Starts the runtime.
pub fn start_runtime(initializer: Box<dyn Initializer>, config: Config) {
// Output backtraces in debug builds.
#[cfg(debug_assertions)]
std::env::set_var("RUST_BACKTRACE", "1");

// Initialize logging.
init_logger(log::Level::Info);
let logger = get_logger("runtime");
Expand Down
4 changes: 0 additions & 4 deletions runtime/src/storage/mkvs/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ mod overlay;
mod prefetch;
mod remove;

pub use commit::*;
pub use errors::*;
pub use insert::*;
pub use iterator::*;
pub use node::*;
pub use overlay::*;
pub use remove::*;

use std::{cell::RefCell, fmt, rc::Rc};

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-01-16"
channel = "nightly-2024-01-08"
targets = ["x86_64-fortanix-unknown-sgx"]
components = ["clippy", "rustfmt"]
1 change: 1 addition & 0 deletions tests/runtimes/simple-keymanager/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub fn main_with_version(version: Version) {
let init = new_keymanager(api::trusted_policy_signers());

// Determine test trust root based on build settings.
#[allow(clippy::option_env_unwrap)]
let trust_root = option_env!("OASIS_TESTS_CONSENSUS_TRUST_HEIGHT").map(|height| {
let hash = option_env!("OASIS_TESTS_CONSENSUS_TRUST_HASH").unwrap();
let runtime_id = option_env!("OASIS_TESTS_CONSENSUS_TRUST_RUNTIME_ID").unwrap();
Expand Down
1 change: 1 addition & 0 deletions tests/runtimes/simple-keyvalue/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ pub fn main_with_version(version: Version) {
};

// Determine test trust root based on build settings.
#[allow(clippy::option_env_unwrap)]
let trust_root = option_env!("OASIS_TESTS_CONSENSUS_TRUST_HEIGHT").map(|height| {
let hash = option_env!("OASIS_TESTS_CONSENSUS_TRUST_HASH").unwrap();
let runtime_id = option_env!("OASIS_TESTS_CONSENSUS_TRUST_RUNTIME_ID").unwrap();
Expand Down
4 changes: 1 addition & 3 deletions tests/upgrade/post/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/oasisprotocol/oasis-core/test-upgrade

go 1.21

toolchain go1.21.0
go 1.21.8

replace (
github.com/cometbft/cometbft => github.com/oasisprotocol/cometbft v0.37.2-oasis1
Expand Down
2 changes: 0 additions & 2 deletions tests/upgrade/post/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,6 @@ github.com/oasisprotocol/cometbft v0.37.2-oasis1 h1:7yr/5f0vV1bQLKoZHFhs3mcHay3n
github.com/oasisprotocol/cometbft v0.37.2-oasis1/go.mod h1:w7GZmT0jJ/i9Uz9ZWtzE3chuNZ3phUboSrFzPZIoYts=
github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg=
github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s=
github.com/oasisprotocol/oasis-core/go v0.2202.1-0.20231007081532-553e006f90d6 h1:nI4czq/c7ZapUqSJuE/LflHyWLu/LnJN81nOBRmOgLQ=
github.com/oasisprotocol/oasis-core/go v0.2202.1-0.20231007081532-553e006f90d6/go.mod h1:lWZtDYY7ziW20hVzqnSt8UQlUkXNHisG3bS6Q3eTsqQ=
github.com/oasisprotocol/oasis-core/go v0.2202.1-0.20231010115211-e67f164f7842 h1:2MXcN7dTHnHKjCDTVjP0011vtkYU1hQxqL4JmdQAU3Q=
github.com/oasisprotocol/oasis-core/go v0.2202.1-0.20231010115211-e67f164f7842/go.mod h1:lWZtDYY7ziW20hVzqnSt8UQlUkXNHisG3bS6Q3eTsqQ=
github.com/oasisprotocol/safeopen v0.0.0-20200528085122-e01cfdfc7661 h1:MB73kGMtuMGS+6VDoU/mitzff7Cu+aZo9ta5wabuxVA=
Expand Down

0 comments on commit 0c49f47

Please sign in to comment.