diff --git a/.github/ISSUE_TEMPLATE/report-a-bug.md b/.github/ISSUE_TEMPLATE/report-a-bug.md index d27d7ca39..1fa01eec6 100644 --- a/.github/ISSUE_TEMPLATE/report-a-bug.md +++ b/.github/ISSUE_TEMPLATE/report-a-bug.md @@ -15,13 +15,10 @@ _Tell us what happened. In particular, be specific about any changes you made. I _What did you expect to happen after you followed the steps you described in the last section? What actually happened?_ -**Environment** +**Logs** -_Describe the environment in which you encountered this bug. Use the list below as a starting point and add additional information if you think it's relevant._ - -- Operating system: -- Template version/tag: -- Rust version (run `rustup show`): +_Provide any logs including task_ids, tc_cli output, etc; if +applicable, provide screenshots to help illustrate the problem_ **Steps to Reproduce** @@ -32,12 +29,6 @@ _Replace the example steps below with actual steps to reproduce the bug you're r 3. step 2 4. bug... - -**Logs, Errors or Screenshots** - -_Please provide the text of any logs or errors that you experienced; if -applicable, provide screenshots to help illustrate the problem._ - **Additional Information** _Please add any other details that you think may help us solve your problem._ diff --git a/.github/workflows/merge-docker-tc-cli.yaml b/.github/workflows/merge-docker-tc-cli.yaml index 74f15af03..878df2347 100644 --- a/.github/workflows/merge-docker-tc-cli.yaml +++ b/.github/workflows/merge-docker-tc-cli.yaml @@ -50,7 +50,7 @@ jobs: toolchain: stable target: x86_64-unknown-linux-musl,wasm32-unknown-unknown - name: Install musl deps - run: apt-get update && apt-get install -y musl-tools + run: sudo apt-get update && sudo apt-get install -y musl-tools - name: Rust cache uses: Swatinem/rust-cache@v2 - name: Install Foundry diff --git a/Cargo.lock b/Cargo.lock index 714285d05..f7d0de175 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5801,6 +5801,7 @@ dependencies = [ "hyper-util", "log", "rustls 0.23.14", + "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -13337,6 +13338,7 @@ dependencies = [ "pin-project-lite 0.2.14", "quinn 0.11.5", "rustls 0.23.14", + "rustls-native-certs 0.8.0", "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", @@ -14202,6 +14204,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -19501,8 +19516,11 @@ dependencies = [ "percent-encoding", "pin-project", "prost 0.13.3", + "rustls-native-certs 0.8.0", + "rustls-pemfile 2.2.0", "socket2 0.5.7", "tokio", + "tokio-rustls 0.26.0", "tokio-stream", "tower 0.4.13", "tower-layer", diff --git a/config/docker/Dockerfile.tc-cli b/config/docker/Dockerfile.tc-cli index f23ca4dae..79dfdbe75 100644 --- a/config/docker/Dockerfile.tc-cli +++ b/config/docker/Dockerfile.tc-cli @@ -1,3 +1,7 @@ +FROM alpine:latest as certs +RUN apk --update add ca-certificates + FROM scratch +COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY tc-cli tc-cli ENTRYPOINT ["/tc-cli"] diff --git a/gmp/grpc/Cargo.toml b/gmp/grpc/Cargo.toml index 7b59f2171..6a053c82f 100644 --- a/gmp/grpc/Cargo.toml +++ b/gmp/grpc/Cargo.toml @@ -20,7 +20,7 @@ serde = { workspace = true, features = ["derive"] } serde-big-array = "0.5.1" time-primitives = { workspace = true, features = ["std"] } tokio = { workspace = true, features = ["macros", "signal"] } -tonic = "0.12.2" +tonic = { version = "0.12.3", features = ["transport", "tls", "tls-roots"] } [build-dependencies] tonic-build = "0.12.2" diff --git a/gmp/grpc/src/lib.rs b/gmp/grpc/src/lib.rs index 327d88365..f67ed10ef 100644 --- a/gmp/grpc/src/lib.rs +++ b/gmp/grpc/src/lib.rs @@ -10,7 +10,7 @@ use time_primitives::{ use tokio::sync::Mutex; use tonic::metadata::{Ascii, MetadataValue}; use tonic::service::interceptor::{InterceptedService, Interceptor}; -use tonic::transport::Channel; +use tonic::transport::{Channel, ClientTlsConfig}; use tonic::{Request, Status}; mod codec; @@ -60,7 +60,12 @@ impl IConnectorBuilder for Connector { Self: Sized, { let address = gmp_rust::mnemonic_to_address(params.mnemonic); - let channel = Channel::from_shared(params.url)?.connect().await?; + let channel = if params.url.starts_with("https") { + let tls_config = ClientTlsConfig::new().with_native_roots(); + Channel::from_shared(params.url)?.tls_config(tls_config)?.connect().await? + } else { + Channel::from_shared(params.url)?.connect().await? + }; let client = GmpClient::with_interceptor(channel, AddressInterceptor::new(address)); Ok(Self { network: params.network_id, diff --git a/pallets/tasks/src/tests.rs b/pallets/tasks/src/tests.rs index 11b2f76b7..748c53c52 100644 --- a/pallets/tasks/src/tests.rs +++ b/pallets/tasks/src/tests.rs @@ -275,6 +275,22 @@ fn test_max_batches_per_block() { }) } +#[test] +fn test_read_event_task_assignment() { + new_test_ext().execute_with(|| { + register_gateway(ETHEREUM, 42); + let shard = create_shard(ETHEREUM, 3, 1); + let shard2 = create_shard(ETHEREUM, 3, 1); + register_shard(shard); + register_shard(shard2); + Tasks::create_task(ETHEREUM, Task::SubmitGatewayMessage { batch_id: 0 }); + roll(1); + assert!(Tasks::get_shard_tasks(shard2).contains(&0)); + // before `break` was added in #1165 the following assertion failed + assert!(!Tasks::get_shard_tasks(shard).contains(&0)); + }) +} + mod bench_helper { use super::*; diff --git a/tc-cli/Cargo.toml b/tc-cli/Cargo.toml index 85ed262be..96715b3d0 100644 --- a/tc-cli/Cargo.toml +++ b/tc-cli/Cargo.toml @@ -14,7 +14,7 @@ clap.workspace = true futures.workspace = true gmp.workspace = true hex.workspace = true -reqwest = { version = "0.12.7", default-features = false, features = ["json"] } +reqwest = { version = "0.12.7", default-features = false, features = ["json", "rustls-tls-native-roots"] } serde = { workspace = true, features = ["derive"] } serde_yaml = "0.9.34" surf = { version = "2.3.2", default-features = false, features = [ "h1-client-rustls" ] }