From 148805c432b0d47c565dc805568dc01d4a45f805 Mon Sep 17 00:00:00 2001 From: tomos <55086152+86667@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:03:57 +0000 Subject: [PATCH] fix: hex encode deposit auth sig (#2046) * fix hex encode deposit auth sig * fix: z2 deployer tx signer address must be signed over in deposit auth sig * fix replace staking-address with signing-address * fix: update signer address in get_node_deposit_commands * chore: clippy --- z2/src/deployer.rs | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/z2/src/deployer.rs b/z2/src/deployer.rs index d0ad72624..4d1bb322e 100644 --- a/z2/src/deployer.rs +++ b/z2/src/deployer.rs @@ -6,6 +6,7 @@ use cliclack::MultiProgress; use colored::Colorize; use strum::Display; use tokio::{fs, sync::Semaphore, task}; +use zilliqa::crypto::SecretKey; use crate::{ address::EthereumAddress, @@ -237,14 +238,20 @@ pub async fn get_node_deposit_commands(genesis_private_key: &str, node: &ChainNo println!("\t--public-key {} \\", node_ethereum_address.bls_public_key); println!( "\t--deposit-auth-signature {} \\", - node_ethereum_address.secret_key.deposit_auth_signature( - node.chain_id(), - node_ethereum_address.secret_key.to_evm_address() + hex::encode( + node_ethereum_address + .secret_key + .deposit_auth_signature( + node.chain_id(), + SecretKey::from_hex(genesis_private_key)?.to_evm_address() + ) + .as_raw_value() + .to_compressed() ) ); println!("\t--private-key {} \\", genesis_private_key); println!("\t--reward-address {} \\", ZERO_ACCOUNT); - println!("\t--staking-address {} \\", ZERO_ACCOUNT); + println!("\t--signing-address {} \\", ZERO_ACCOUNT); println!("\t--amount {VALIDATOR_DEPOSIT_IN_MILLIONS}\n"); Ok(()) @@ -293,13 +300,16 @@ pub async fn run_deposit(config_file: &str, node_selection: bool) -> Result<()> let validator = validators::Validator::new( &node_ethereum_address.peer_id, &node_ethereum_address.bls_public_key, - &node_ethereum_address - .secret_key - .deposit_auth_signature( - node.chain_id(), - node_ethereum_address.secret_key.to_evm_address(), - ) - .to_string(), + &hex::encode( + node_ethereum_address + .secret_key + .deposit_auth_signature( + node.chain_id(), + SecretKey::from_hex(&genesis_private_key)?.to_evm_address(), + ) + .as_raw_value() + .to_compressed(), + ), )?; let stake = validators::StakeDeposit::new( validator,