Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Commit adcc435

Browse files
Update avalanche-types
1 parent 50f5d41 commit adcc435

File tree

20 files changed

+1674
-1257
lines changed

20 files changed

+1674
-1257
lines changed

Cargo.toml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "avalanche-types"
3-
version = "0.0.394" # https://crates.io/crates/avalanche-types
3+
version = "0.0.396" # https://crates.io/crates/avalanche-types
44
edition = "2021"
55
rust-version = "1.69" # use "rustup override set stable" to overwrite current toolchain
66
publish = true
@@ -20,7 +20,7 @@ cert-manager = "0.0.10" # https://github.com/gyuho/cert-manager
2020
chrono = "0.4.24"
2121
cmp-manager = "0.0.1"
2222
ecdsa = { version = "0.16.7", features = ["rfc6979", "verifying"] } # https://github.com/RustCrypto/elliptic-curves/tree/master/k256
23-
ethers-core = { version = "=2.0.4", features = ["eip712"] } # https://github.com/gakonst/ethers-rs/releases
23+
ethers-core = { version = "=2.0.6", features = ["eip712"] } # https://github.com/gakonst/ethers-rs/releases
2424
hex = "0.4.3"
2525
hmac = "0.12.1"
2626
k256 = { version = "0.13.1", features = ["ecdsa"] } # https://github.com/RustCrypto/elliptic-curves/tree/master/k256
@@ -48,7 +48,7 @@ zeroize = "1.6.0" # for "BLS
4848
secp256k1 = { version = "0.27.0", features = ["global-context", "rand-std", "recovery"], optional = true } # https://crates.io/crates/secp256k1
4949

5050
# [OPTIONAL] for "kms_aws"
51-
aws-manager = { version = "0.28.0", features = ["kms"], optional = true } # https://github.com/gyuho/aws-manager/tags
51+
aws-manager = { version = "0.28.1", features = ["kms"], optional = true } # https://github.com/gyuho/aws-manager/tags
5252
aws-sdk-kms = { version = "0.28.0", optional = true } # https://crates.io/crates/aws-sdk-kms/versions
5353

5454
# [OPTIONAL] for "message"
@@ -66,9 +66,9 @@ tokio = { version = "1.28.1", features = ["full"], optional = true } # https://g
6666
rlp = { version = "0.5.2", default-features = false, features = ["std"], optional = true }
6767

6868
# [OPTIONAL] for "wallet_evm"
69-
ethers = { version = "=2.0.4", features = ["eip712"], optional = true } # https://github.com/gakonst/ethers-rs/releases
70-
ethers-providers = { version = "=2.0.4", optional = true } # https://github.com/gakonst/ethers-rs/releases
71-
ethers-signers = { version = "=2.0.4", optional = true } # https://github.com/gakonst/ethers-rs/releases
69+
ethers = { version = "=2.0.6", features = ["eip712"], optional = true } # https://github.com/gakonst/ethers-rs/releases
70+
ethers-providers = { version = "=2.0.6", optional = true } # https://github.com/gakonst/ethers-rs/releases
71+
ethers-signers = { version = "=2.0.6", optional = true } # https://github.com/gakonst/ethers-rs/releases
7272

7373
# [OPTIONAL] for "subnet"
7474
futures = { version = "0.3.28", optional = true }
@@ -90,7 +90,7 @@ tower-service = { version = "0.3.2", optional = true }
9090
prometheus = { version = "0.13.3", default-features = false, features = ["process"], optional = true }
9191

9292
# [OPTIONAL] for "codec"
93-
base64 = { version = "0.21.1", optional = true } # https://github.com/marshallpierce/rust-base64
93+
base64 = { version = "0.21.2", optional = true } # https://github.com/marshallpierce/rust-base64
9494
num-bigint = { version = "0.4.3", optional = true }
9595

9696
[build-dependencies]
@@ -107,7 +107,8 @@ tokio-test = "0.4.2"
107107

108108
# Add optional features to docs.
109109
[package.metadata.docs.rs]
110-
features = ["subnet", "subnet_metrics"]
110+
all-features = true
111+
rustdoc-args = ["--cfg", "docsrs"]
111112

112113
[features]
113114
default = [

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
| v0.0.201-271 | v1.9.6,v1.9.7 | 22 |
1414
| v0.0.272-291 | v1.9.8,v1.9.9 | 23 |
1515
| v0.0.292-335 | v1.9.10,v1.9.16 | 24 |
16-
| v0.0.336+ | v1.10.0 | 25 |
16+
| v0.0.336-390 | v1.10.0 | 25 |
17+
| v0.0.391+ | v1.10.1+ | 26 |
1718

1819
## Introduction
1920

scripts/examples.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if ! [[ "$0" =~ scripts/examples.sh ]]; then
66
exit 255
77
fi
88

9-
cargo run --example key_cert --features="cert" -- /tmp/test.insecure.key /tmp/test.insecure.cert
9+
cargo run --example key_cert -- /tmp/test.insecure.key /tmp/test.insecure.cert
1010

1111
# cargo run --example key_secp256k1_kms_aws --features="kms_aws"
1212

scripts/protobuf_codegen.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# protocol version is the version of the gRPC proto definitions
44
# as defined by the avalanchego rpcchainvm.
55
# ref. https://github.com/ava-labs/avalanchego/blob/v1.9.11/version/constants.go#L15-L17
6-
PROTOCOL_VERSION='24'
6+
PROTOCOL_VERSION='26'
77

88
if ! [[ "$0" =~ scripts/protobuf_codegen.sh ]]; then
99
echo "must be run from repository root"
1010
exit 255
1111
fi
1212

1313
# ref. https://docs.buf.build/installation
14-
BUF_VERSION='1.15.1'
14+
BUF_VERSION='1.19.0'
1515
if [[ $(buf --version | cut -f2 -d' ') != "${BUF_VERSION}" ]]; then
1616
echo "could not find buf ${BUF_VERSION}, is it installed + in PATH?"
1717
exit 255

src/jsonrpc/admin.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ mod tests {
7878

7979
#[test]
8080
fn test_deserialization() {
81-
let resp = ChainAliasResponse {
81+
let expected = ChainAliasResponse {
8282
jsonrpc: String::from(DEFAULT_VERSION),
8383
id: DEFAULT_ID,
8484
};
8585

86-
let expected = r#"{"jsonrpc": "2.0","id": 1,"result": {}}"#.as_bytes();
86+
let response = r#"{"jsonrpc": "2.0","id": 1,"result": {}}"#.as_bytes();
8787
let deserialized: ChainAliasResponse =
88-
serde_json::from_slice(expected).expect("failed deserialization");
88+
serde_json::from_slice(response).expect("failed deserialization");
8989

90-
assert_eq!(resp, deserialized);
90+
assert_eq!(expected, deserialized);
9191
}
9292
}

src/jsonrpc/client/admin.rs

+7-12
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ pub async fn alias_chain(
2222
}
2323
})?;
2424

25-
let u = if let Some(scheme) = scheme {
26-
if let Some(port) = port {
27-
format!("{scheme}://{host}:{port}/ext/admin")
28-
} else {
29-
format!("{scheme}://{host}/ext/admin")
30-
}
31-
} else {
32-
format!("http://{host}/ext/admin")
25+
let url = match (scheme, port) {
26+
(Some(scheme), Some(port)) => format!("{scheme}://{host}:{port}/ext/admin"),
27+
(Some(scheme), _) => format!("{scheme}://{host}/ext/admin"),
28+
_ => format!("http://{host}/ext/admin"),
3329
};
34-
log::info!("getting network name for {u}");
30+
log::info!("getting network name for {url}");
3531

3632
let data = ChainAliasRequest {
3733
params: Some(ChainAliasParams { chain, alias }),
@@ -58,7 +54,7 @@ pub async fn alias_chain(
5854
})?;
5955

6056
let resp = req_cli_builder
61-
.post(&u)
57+
.post(&url)
6258
.header(CONTENT_TYPE, "application/json")
6359
.body(d)
6460
.send()
@@ -77,9 +73,8 @@ pub async fn alias_chain(
7773
retryable: false,
7874
}
7975
})?;
80-
let out: Vec<u8> = out.into();
8176

82-
let response: ChainAliasResponse = serde_json::from_slice(&out)
77+
let response: ChainAliasResponse = serde_json::from_slice(out.as_ref())
8378
.map_err(|e| Error::Other {
8479
message: format!("failed serde_json::from_slice '{}'", e),
8580
retryable: false,

src/message/accepted.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ impl Message {
2222
chain_id: prost::bytes::Bytes::new(),
2323
request_id: 0,
2424
container_ids: Vec::new(),
25-
engine_type: p2p::EngineType::Unspecified.into(),
2625
},
2726
gzip_compress: false,
2827
}

src/message/accepted_frontier.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ impl Message {
2222
chain_id: prost::bytes::Bytes::new(),
2323
request_id: 0,
2424
container_ids: Vec::new(),
25-
engine_type: p2p::EngineType::Unspecified.into(),
2625
},
2726
gzip_compress: false,
2827
}

src/message/ancestors.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ impl Message {
2222
chain_id: prost::bytes::Bytes::new(),
2323
request_id: 0,
2424
containers: Vec::new(),
25-
engine_type: p2p::EngineType::Unspecified.into(),
2625
},
2726
gzip_compress: false,
2827
}

src/message/chits.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ impl Message {
2323
request_id: 0,
2424
preferred_container_ids: Vec::new(),
2525
accepted_container_ids: Vec::new(),
26-
engine_type: p2p::EngineType::Unspecified.into(),
2726
},
2827
gzip_compress: false,
2928
}

src/proto/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ pub mod pb;
66
#[doc(hidden)]
77
pub use pb::*;
88

9-
/// ref. <https://github.com/ava-labs/avalanchego/blob/v1.9.11/version/constants.go#L15-L17>
10-
pub const PROTOCOL_VERSION: u32 = 25;
9+
/// ref. <https://github.com/ava-labs/avalanchego/blob/v1.10.1/version/constants.go#L15-L17>
10+
pub const PROTOCOL_VERSION: u32 = 26;

src/proto/pb/message.rs

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// @generated
2+
#[allow(clippy::derive_partial_eq_without_eq)]
3+
#[derive(Clone, PartialEq, ::prost::Message)]
4+
pub struct Message {
5+
#[prost(oneof="message::Message", tags="1")]
6+
pub message: ::core::option::Option<message::Message>,
7+
}
8+
/// Nested message and enum types in `Message`.
9+
pub mod message {
10+
#[allow(clippy::derive_partial_eq_without_eq)]
11+
#[derive(Clone, PartialEq, ::prost::Oneof)]
12+
pub enum Message {
13+
#[prost(message, tag="1")]
14+
Tx(super::Tx),
15+
}
16+
}
17+
#[allow(clippy::derive_partial_eq_without_eq)]
18+
#[derive(Clone, PartialEq, ::prost::Message)]
19+
pub struct Tx {
20+
/// The byte representation of this transaction.
21+
#[prost(bytes="bytes", tag="1")]
22+
pub tx: ::prost::bytes::Bytes,
23+
}
24+
/// Encoded file descriptor set for the `message` package
25+
pub const FILE_DESCRIPTOR_SET: &[u8] = &[
26+
0x0a, 0xc0, 0x03, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x74, 0x78, 0x2e,
27+
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x33,
28+
0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x0a, 0x02, 0x74, 0x78, 0x18,
29+
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e,
30+
0x54, 0x78, 0x48, 0x00, 0x52, 0x02, 0x74, 0x78, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
31+
0x61, 0x67, 0x65, 0x22, 0x14, 0x0a, 0x02, 0x54, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18,
32+
0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x78, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74,
33+
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x76, 0x61, 0x2d, 0x6c, 0x61, 0x62, 0x73,
34+
0x2f, 0x61, 0x76, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f,
35+
0x74, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4a, 0x9b, 0x02,
36+
0x0a, 0x06, 0x12, 0x04, 0x00, 0x00, 0x0f, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00,
37+
0x00, 0x12, 0x0a, 0x08, 0x0a, 0x01, 0x02, 0x12, 0x03, 0x02, 0x00, 0x10, 0x0a, 0x08, 0x0a, 0x01,
38+
0x08, 0x12, 0x03, 0x04, 0x00, 0x47, 0x0a, 0x09, 0x0a, 0x02, 0x08, 0x0b, 0x12, 0x03, 0x04, 0x00,
39+
0x47, 0x0a, 0x0a, 0x0a, 0x02, 0x04, 0x00, 0x12, 0x04, 0x06, 0x00, 0x0a, 0x01, 0x0a, 0x0a, 0x0a,
40+
0x03, 0x04, 0x00, 0x01, 0x12, 0x03, 0x06, 0x08, 0x0f, 0x0a, 0x0c, 0x0a, 0x04, 0x04, 0x00, 0x08,
41+
0x00, 0x12, 0x04, 0x07, 0x02, 0x09, 0x03, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x08, 0x00, 0x01,
42+
0x12, 0x03, 0x07, 0x08, 0x0f, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x00, 0x12, 0x03, 0x08,
43+
0x04, 0x0e, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x06, 0x12, 0x03, 0x08, 0x04, 0x06,
44+
0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x01, 0x12, 0x03, 0x08, 0x07, 0x09, 0x0a, 0x0c,
45+
0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x08, 0x0c, 0x0d, 0x0a, 0x0a, 0x0a, 0x02,
46+
0x04, 0x01, 0x12, 0x04, 0x0c, 0x00, 0x0f, 0x01, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x01, 0x01, 0x12,
47+
0x03, 0x0c, 0x08, 0x0a, 0x0a, 0x3b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x00, 0x12, 0x03, 0x0e, 0x02,
48+
0x0f, 0x1a, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x72, 0x65, 0x70,
49+
0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74,
50+
0x68, 0x69, 0x73, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
51+
0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x05, 0x12, 0x03, 0x0e, 0x02, 0x07, 0x0a,
52+
0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x01, 0x12, 0x03, 0x0e, 0x08, 0x0a, 0x0a, 0x0c, 0x0a,
53+
0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0e, 0x0d, 0x0e, 0x62, 0x06, 0x70, 0x72, 0x6f,
54+
0x74, 0x6f, 0x33,
55+
];
56+
// @@protoc_insertion_point(module)

src/proto/pb/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ pub mod keystore {
5555
include!("keystore.rs");
5656
// @@protoc_insertion_point(keystore)
5757
}
58+
// @@protoc_insertion_point(attribute:message)
59+
pub mod message {
60+
include!("message.rs");
61+
// @@protoc_insertion_point(message)
62+
}
5863
// @@protoc_insertion_point(attribute:messenger)
5964
pub mod messenger {
6065
include!("messenger.rs");
@@ -82,6 +87,11 @@ pub mod sharedmemory {
8287
include!("sharedmemory.rs");
8388
// @@protoc_insertion_point(sharedmemory)
8489
}
90+
// @@protoc_insertion_point(attribute:sync)
91+
pub mod sync {
92+
include!("sync.rs");
93+
// @@protoc_insertion_point(sync)
94+
}
8595
// @@protoc_insertion_point(attribute:validatorstate)
8696
pub mod validatorstate {
8797
include!("validatorstate.rs");

0 commit comments

Comments
 (0)