Skip to content

Commit

Permalink
0.0.10: Add support for AvalancheGo Protocol Version 23 (#96)
Browse files Browse the repository at this point in the history
* deps: bump

*: react to bump

---------

Signed-off-by: Sam Batschelet <[email protected]>
  • Loading branch information
hexfusion authored Mar 1, 2023
1 parent 42834ce commit 5d4a3ba
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 33 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ See [`bin/timestampvm`](timestampvm/src/bin/timestampvm/main.rs) for plugin impl
## AvalancheGo Compatibility
| Version(s) | AvalancheGo Version(s) |
| --- | --- |
| v0.0.6 | v1.9.2,v1.9.3 |
| v0.0.7 | v1.9.4 |
| v0.0.8 | v1.9.7 |
| v0.0.6 | v1.9.2,v1.9.3 |
| v0.0.7 | v1.9.4 |
| v0.0.8, v0.0.9 | v1.9.7 |
| v0.0.10 | v1.9.8, v1.9.9 |

## Example

Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ homepage = "https://avax.network"
[dependencies]

[dev-dependencies]
avalanche-installer = "0.0.12"
avalanche-installer = "0.0.41"
avalanche-network-runner-sdk = "0.3.0" # https://crates.io/crates/avalanche-network-runner-sdk
avalanche-types = { version = "0.0.228", features = ["jsonrpc_client", "subnet"] } # https://crates.io/crates/avalanche-types
avalanche-types = { version = "0.0.272", features = ["jsonrpc_client", "subnet"] } # https://crates.io/crates/avalanche-types
env_logger = "0.10.0"
log = "0.4.17"
random-manager = "0.0.2"
serde_json = "1.0.89" # https://github.com/serde-rs/json/releases
tempfile = "3.3.0"
random-manager = "0.0.5"
serde_json = "1.0.93" # https://github.com/serde-rs/json/releases
tempfile = "3.4.0"
timestampvm = { path = "../../timestampvm" }
tokio = { version = "1.23.0", features = [] } # https://github.com/tokio-rs/tokio/releases
tokio = { version = "1.25.0", features = [] } # https://github.com/tokio-rs/tokio/releases
10 changes: 5 additions & 5 deletions tests/e2e/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
use avalanche_network_runner_sdk::{BlockchainSpec, Client, GlobalConfig, StartRequest};
use avalanche_types::{ids, jsonrpc::client::info as avalanche_sdk_info, subnet};

const AVALANCHEGO_VERSION: &str = "v1.9.7";
const AVALANCHEGO_VERSION: &str = "v1.9.9";

#[tokio::test]
async fn e2e() {
Expand Down Expand Up @@ -52,15 +52,15 @@ async fn e2e() {
.unwrap()
.to_string()
} else {
let (exec_path, plugins_dir) = avalanche_installer::avalanchego::download(
let exec_path = avalanche_installer::avalanchego::github::download(
None,
None,
Some(AVALANCHEGO_VERSION.to_string()),
)
.await
.unwrap();
avalanchego_exec_path = exec_path;
plugins_dir
avalanche_installer::avalanchego::get_plugin_dir(&avalanchego_exec_path)
};

log::info!(
Expand All @@ -79,15 +79,15 @@ async fn e2e() {

// write some random genesis file
let genesis = timestampvm::genesis::Genesis {
data: random_manager::string(10),
data: random_manager::secure_string(10),
};
let genesis_file_path = random_manager::tmp_path(10, None).unwrap();
genesis.sync(&genesis_file_path).unwrap();

log::info!(
"starting {} with avalanchego {}, genesis file path {}",
vm_id,
avalanchego_exec_path,
&avalanchego_exec_path,
genesis_file_path,
);
let resp = cli
Expand Down
20 changes: 10 additions & 10 deletions timestampvm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "timestampvm"
version = "0.0.8" # https://crates.io/crates/timestampvm
version = "0.0.10" # https://crates.io/crates/timestampvm
edition = "2021"
rust-version = "1.65"
publish = true
Expand All @@ -11,23 +11,23 @@ repository = "https://github.com/ava-labs/timestampvm-rs"
readme = "../README.md"

[dependencies]
avalanche-types = { version = "0.0.228", features = ["subnet", "codec_base64"] } # https://crates.io/crates/avalanche-types
avalanche-types = { version = "0.0.272", features = ["subnet", "codec_base64"] } # https://crates.io/crates/avalanche-types
base64 = { version = "0.21.0" }
chrono = "0.4.23"
clap = { version = "4.0.29", features = ["cargo", "derive"] } # https://github.com/clap-rs/clap/releases
clap = { version = "4.1.8", features = ["cargo", "derive"] } # https://github.com/clap-rs/clap/releases
derivative = "2.2.0"
env_logger = "0.10.0"
http-manager = { version = "0.0.8" }
http-manager = { version = "0.0.14" }
jsonrpc-core = "18.0.0"
jsonrpc-core-client = { version = "18.0.0" }
jsonrpc-derive = "18.0.0"
log = "0.4.17"
semver = "1.0.14"
serde = { version = "1.0.148", features = ["derive"] }
serde_json = "1.0.89" # https://github.com/serde-rs/json/releases
serde_with = { version = "2.1.0", features = ["hex"] }
tokio = { version = "1.23.0", features = ["fs", "rt-multi-thread"] }
semver = "1.0.16"
serde = { version = "1.0.152", features = ["derive"] }
serde_json = "1.0.93" # https://github.com/serde-rs/json/releases
serde_with = { version = "2.2.0", features = ["hex"] }
tokio = { version = "1.25.0", features = ["fs", "rt-multi-thread"] }
tonic = { version = "0.8.3", features = ["gzip"] }

[dev-dependencies]
random-manager = "0.0.2"
random-manager = "0.0.5"
2 changes: 1 addition & 1 deletion timestampvm/src/bin/timestampvm/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async fn main() -> io::Result<()> {

let (stop_ch_tx, stop_ch_rx): (Sender<()>, Receiver<()>) = broadcast::channel(1);
let vm_server = subnet::rpc::vm::server::Server::new(vm::Vm::new(), stop_ch_tx);
subnet::rpc::plugin::serve(vm_server, stop_ch_rx).await
subnet::rpc::vm::serve(vm_server, stop_ch_rx).await
}
}
}
10 changes: 5 additions & 5 deletions timestampvm/src/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ async fn test_block() {
ids::Id::empty(),
0,
Utc::now().timestamp() as u64,
random_manager::bytes(10).unwrap(),
random_manager::secure_bytes(10).unwrap(),
choices::status::Status::default(),
)
.unwrap();
Expand Down Expand Up @@ -311,7 +311,7 @@ async fn test_block() {
genesis_blk.id,
genesis_blk.height + 1,
genesis_blk.timestamp + 1,
random_manager::bytes(10).unwrap(),
random_manager::secure_bytes(10).unwrap(),
choices::status::Status::default(),
)
.unwrap();
Expand All @@ -335,7 +335,7 @@ async fn test_block() {
blk1.id,
blk1.height + 1,
blk1.timestamp + 1,
random_manager::bytes(10).unwrap(),
random_manager::secure_bytes(10).unwrap(),
choices::status::Status::default(),
)
.unwrap();
Expand All @@ -360,7 +360,7 @@ async fn test_block() {
blk2.id,
blk2.height - 1,
blk2.timestamp + 1,
random_manager::bytes(10).unwrap(),
random_manager::secure_bytes(10).unwrap(),
choices::status::Status::default(),
)
.unwrap();
Expand All @@ -376,7 +376,7 @@ async fn test_block() {
blk2.id,
blk2.height + 1,
(Utc::now() + Duration::hours(2)).timestamp() as u64,
random_manager::bytes(10).unwrap(),
random_manager::secure_bytes(10).unwrap(),
choices::status::Status::default(),
)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion timestampvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! async fn main() -> std::io::Result<()> {
//! let (stop_ch_tx, stop_ch_rx): (Sender<()>, Receiver<()>) = broadcast::channel(1);
//! let vm_server = subnet::rpc::vm::server::Server::new(vm::Vm::new(), stop_ch_tx);
//! subnet::rpc::plugin::serve(vm_server, stop_ch_rx).await
//! subnet::rpc::vm::serve(vm_server, stop_ch_rx).await
//! }
//! ```
Expand Down
4 changes: 2 additions & 2 deletions timestampvm/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async fn test_state() {
ids::Id::empty(),
0,
random_manager::u64(),
random_manager::bytes(10).unwrap(),
random_manager::secure_bytes(10).unwrap(),
choices::status::Status::Accepted,
)
.unwrap();
Expand All @@ -196,7 +196,7 @@ async fn test_state() {
genesis_blk.id(),
1,
genesis_blk.timestamp() + 1,
random_manager::bytes(10).unwrap(),
random_manager::secure_bytes(10).unwrap(),
choices::status::Status::Accepted,
)
.unwrap();
Expand Down

0 comments on commit 5d4a3ba

Please sign in to comment.