Skip to content

Commit

Permalink
Merge branch 'development' into junius/feat-new-timegraph-tokenomics
Browse files Browse the repository at this point in the history
  • Loading branch information
ana-junius authored Oct 15, 2024
2 parents d686fde + d0cc4b2 commit 224f750
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 17 deletions.
15 changes: 3 additions & 12 deletions .github/ISSUE_TEMPLATE/report-a-bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand All @@ -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._
2 changes: 1 addition & 1 deletion .github/workflows/merge-docker-tc-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions config/docker/Dockerfile.tc-cli
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion gmp/grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 7 additions & 2 deletions gmp/grpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 16 additions & 0 deletions pallets/tasks/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down
2 changes: 1 addition & 1 deletion tc-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ] }
Expand Down

0 comments on commit 224f750

Please sign in to comment.