From b0aaff971d9b5019183bd924967df3806ce5edbf Mon Sep 17 00:00:00 2001 From: Samuel Dare Date: Wed, 10 Jan 2024 14:29:50 +0000 Subject: [PATCH 1/5] fix: peer id generation encoding --- core/cli/src/args/generate_keypair.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/cli/src/args/generate_keypair.rs b/core/cli/src/args/generate_keypair.rs index b2384a73b..28ba87cbd 100644 --- a/core/cli/src/args/generate_keypair.rs +++ b/core/cli/src/args/generate_keypair.rs @@ -64,7 +64,7 @@ pub struct Keypair { pub net_private_key: Hex, pub public_key: Hex, pub address: Address, - pub peer_id: Hex, + pub peer_id: String, pub bls_private_key: Hex, pub bls_public_key: Hex, } @@ -94,7 +94,7 @@ impl Keypair { net_private_key: Hex::encode(&net_seckey), public_key: Hex::encode(&pubkey), address: Address::from_pubkey_bytes(pubkey).map_err(Error::Running)?, - peer_id: Hex::encode(secio_keypair.public_key().peer_id().to_base58()), + peer_id: secio_keypair.public_key().peer_id().to_base58(), bls_private_key: Hex::encode(&bls_seckey), bls_public_key: Hex::encode(bls_pub_key.to_bytes()), }) From e3c687e0418f3c7f6ae02ddac54e0b64c6b1258b Mon Sep 17 00:00:00 2001 From: Samuel Dare Date: Wed, 10 Jan 2024 23:20:39 +0000 Subject: [PATCH 2/5] fix: push keys to key_pair vector --- core/cli/src/args/generate_keypair.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/cli/src/args/generate_keypair.rs b/core/cli/src/args/generate_keypair.rs index 28ba87cbd..12b009c2e 100644 --- a/core/cli/src/args/generate_keypair.rs +++ b/core/cli/src/args/generate_keypair.rs @@ -21,7 +21,7 @@ pub struct GenerateKeypairArgs { help = "The number of keypairs to generate.", default_value = "1" )] - pub num: usize, + pub num: usize, #[arg( short = 'p', long = "path", @@ -46,7 +46,7 @@ impl GenerateKeypairArgs { key_pair.bls_private_key.as_bytes(), i, )?; - keypairs.push(Keypair::generate(i)?); + keypairs.push(key_pair); } println!( @@ -60,13 +60,13 @@ impl GenerateKeypairArgs { #[derive(Serialize, Clone, Debug)] pub struct Keypair { - pub index: usize, + pub index: usize, pub net_private_key: Hex, - pub public_key: Hex, - pub address: Address, - pub peer_id: String, + pub public_key: Hex, + pub address: Address, + pub peer_id: String, pub bls_private_key: Hex, - pub bls_public_key: Hex, + pub bls_public_key: Hex, } impl Keypair { @@ -90,13 +90,13 @@ impl Keypair { let bls_pub_key = bls_priv_key.pub_key(&String::new()); Ok(Keypair { - index: i, + index: i, net_private_key: Hex::encode(&net_seckey), - public_key: Hex::encode(&pubkey), - address: Address::from_pubkey_bytes(pubkey).map_err(Error::Running)?, - peer_id: secio_keypair.public_key().peer_id().to_base58(), + public_key: Hex::encode(&pubkey), + address: Address::from_pubkey_bytes(pubkey).map_err(Error::Running)?, + peer_id: secio_keypair.public_key().peer_id().to_base58(), bls_private_key: Hex::encode(&bls_seckey), - bls_public_key: Hex::encode(bls_pub_key.to_bytes()), + bls_public_key: Hex::encode(bls_pub_key.to_bytes()), }) } From b074120afe99cce2a6b1142bec7fd5dd8c230538 Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Thu, 11 Jan 2024 02:39:14 +0000 Subject: [PATCH 3/5] chore(fmt): cargo +nightly fmt --all --- core/cli/src/args/generate_keypair.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/cli/src/args/generate_keypair.rs b/core/cli/src/args/generate_keypair.rs index 12b009c2e..09cd71ec2 100644 --- a/core/cli/src/args/generate_keypair.rs +++ b/core/cli/src/args/generate_keypair.rs @@ -21,7 +21,7 @@ pub struct GenerateKeypairArgs { help = "The number of keypairs to generate.", default_value = "1" )] - pub num: usize, + pub num: usize, #[arg( short = 'p', long = "path", @@ -60,13 +60,13 @@ impl GenerateKeypairArgs { #[derive(Serialize, Clone, Debug)] pub struct Keypair { - pub index: usize, + pub index: usize, pub net_private_key: Hex, - pub public_key: Hex, - pub address: Address, - pub peer_id: String, + pub public_key: Hex, + pub address: Address, + pub peer_id: String, pub bls_private_key: Hex, - pub bls_public_key: Hex, + pub bls_public_key: Hex, } impl Keypair { @@ -90,13 +90,13 @@ impl Keypair { let bls_pub_key = bls_priv_key.pub_key(&String::new()); Ok(Keypair { - index: i, + index: i, net_private_key: Hex::encode(&net_seckey), - public_key: Hex::encode(&pubkey), - address: Address::from_pubkey_bytes(pubkey).map_err(Error::Running)?, - peer_id: secio_keypair.public_key().peer_id().to_base58(), + public_key: Hex::encode(&pubkey), + address: Address::from_pubkey_bytes(pubkey).map_err(Error::Running)?, + peer_id: secio_keypair.public_key().peer_id().to_base58(), bls_private_key: Hex::encode(&bls_seckey), - bls_public_key: Hex::encode(bls_pub_key.to_bytes()), + bls_public_key: Hex::encode(bls_pub_key.to_bytes()), }) } From 843950ad934da709287ddccf37f1279a2908aa7d Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Thu, 11 Jan 2024 08:53:44 +0000 Subject: [PATCH 4/5] chore: bump Axon version to 0.3.1-beta --- CHANGELOG.md | 6 ++++++ Cargo.lock | 4 ++-- Cargo.toml | 2 +- core/cli/Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa01f3aa6..26a8adbf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## v0.3.1-beta + +### BUG FIXES +* fix(cli): Fix peer id generation by @samtvlabs in https://github.com/axonweb3/axon/pull/1656 + + ## v0.3.0-beta ### BREAKING CHANGES diff --git a/Cargo.lock b/Cargo.lock index 362acc072..4691fbf60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -263,7 +263,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axon" -version = "0.3.0-beta" +version = "0.3.1-beta" dependencies = [ "axon-protocol", "clap 4.4.6", @@ -1784,7 +1784,7 @@ dependencies = [ [[package]] name = "core-cli" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "axon-protocol", diff --git a/Cargo.toml b/Cargo.toml index d91998186..7fcc30204 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axon" -version = "0.3.0-beta" +version = "0.3.1-beta" authors = ["Nervos Dev "] edition = "2021" repository = "https://github.com/axonweb3/axon" diff --git a/core/cli/Cargo.toml b/core/cli/Cargo.toml index 1fa8b9d18..33efc431f 100644 --- a/core/cli/Cargo.toml +++ b/core/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "core-cli" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 579a2a4d43b18432c0226807d773033bbdc0fec7 Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Thu, 11 Jan 2024 09:12:30 +0000 Subject: [PATCH 5/5] docs: add [Unreleased] in CHANGELOG.md --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26a8adbf8..66ce3b03d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,19 @@ # CHANGELOG + + +## [Unreleased] +* refactor!: change some precompile input and output to tuple by @KaoImin in https://github.com/axonweb3/axon/pull/1642 +* refactor: omit `address` field in chain spec parsing by @KaoImin in https://github.com/axonweb3/axon/pull/1641 +* feat: rlp encode for VerifyProofPayload by @wenyuanhust in https://github.com/axonweb3/axon/pull/1637 +* feat: enable get header precompile by @blckngm in https://github.com/axonweb3/axon/pull/1649 +* feat: cli for metadata cell data by @blckngm in https://github.com/axonweb3/axon/pull/1640 +* feat: metadata cli parse data by @blckngm in https://github.com/axonweb3/axon/pull/1644 +* chore(CI): add axon sync workflow by @Simon-Tl in https://github.com/axonweb3/axon/pull/1636 + ## v0.3.1-beta