Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 19 additions & 2 deletions rust/lit-node/lit-node-testnet/src/testnet/datil/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ use ethers::prelude::*;
use ethers::providers::Provider;
use ethers::signers::Wallet;
use lit_blockchain_lite::contracts::{
contract_resolver::ContractResolver, pkp_helper::pkp_helper::PKPHelper,
pkp_permissions::PKPPermissions, pkpnft::PKPNFT, pubkey_router::PubkeyRouter, staking::Staking,
backup_recovery::BackupRecovery, contract_resolver::ContractResolver,
pkp_helper::pkp_helper::PKPHelper, pkp_permissions::PKPPermissions, pkpnft::PKPNFT,
pubkey_router::PubkeyRouter, staking::Staking,
};
use std::sync::Arc;

Expand All @@ -19,6 +20,7 @@ pub struct DatilContracts {
pub pkp_helper: PKPHelper<SignerMiddleware<Arc<Provider<Http>>, Wallet<SigningKey>>>,
pub contract_resolver:
ContractResolver<SignerMiddleware<Arc<Provider<Http>>, Wallet<SigningKey>>>,
pub backup_recovery: BackupRecovery<SignerMiddleware<Arc<Provider<Http>>, Wallet<SigningKey>>>,
}

impl DatilContracts {
Expand Down Expand Up @@ -94,6 +96,20 @@ impl DatilContracts {
.unwrap();
let pkp_helper = PKPHelper::new(pkp_helper_address, deployer_signing_provider.clone());

let backup_recovery_address = contract_resolver
.get_contract(
contract_resolver
.backup_recovery_contract()
.call()
.await
.unwrap(),
env,
)
.call()
.await
.unwrap();
let backup_recovery =
BackupRecovery::new(backup_recovery_address, deployer_signing_provider.clone());
Self {
deployer_provider: deployer_signing_provider.clone(),
staking,
Expand All @@ -102,6 +118,7 @@ impl DatilContracts {
pkp_permissions,
pkp_helper,
contract_resolver,
backup_recovery,
}
}
}
1 change: 1 addition & 0 deletions rust/lit-node/lit-node/.lit-recovery/config_naga_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"resolver_address":"0xCf908e1E4Ee79fb540e144C3EDB2796E8D413548","rpc_url":"https://yellowstone-rpc.litprotocol.com/","chain_id":175188,"enviorment":0}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions rust/lit-node/lit-node/src/endpoints/admin/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ pub async fn admin_set_blinders(
return unexpected_err("Blinders are invalid. One or more are zero", None).handle();
}

info!("Setting blinders for node");
restore_state.set_blinders(*blinders);

status::Custom(Status::Ok, json!({ "success": true }))
Expand Down
2 changes: 1 addition & 1 deletion rust/lit-node/lit-node/src/endpoints/admin/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ where
// DATIL_BACKUP: Remove this loop once old Datil backup is obsolete.
for share in encrypted_key_shares.iter_mut() {
if let Some(pk) = C::parse_old_backup_public_key(&share.public_key) {
info!("Old {} backup share is found", curve_type);
info!("{} backup share is received for public key: {:?}", curve_type, pk.to_compressed_hex());
share.public_key = pk.to_compressed_hex();
}
}
Expand Down
1 change: 1 addition & 0 deletions rust/lit-node/lit-node/src/tasks/fsm/epoch_change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ pub(crate) async fn perform_epoch_change(
let mut epoch_change_status = None;

if !restore_key_sets.is_empty() {
info!("Processing epoch change for restored key sets: {:?}", restore_key_sets);
epoch_change_status = match process_epoch_for_key_set(
dkg_manager,
fsm_worker_metadata.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ where
}
// If this key does not have enough decryption shares, don't attempt.
if self.decryption_shares.len() < params.threshold {
// debug!("Only {} of a minimum of {} decryption shares available for key: {:?}", self.decryption_shares.len(), params.threshold, self.encrypted_key_share.public_key);
return None;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ impl RestoreStateLog {
}
}

#[derive(Debug)]
#[derive(Debug, Clone)]
pub enum NodeRecoveryStatus {
Null,
StartedInRestoreState,
Expand All @@ -933,12 +933,12 @@ pub async fn report_progress(cfg: &LitConfig, status: NodeRecoveryStatus) {
};

match recovery_contract
.set_node_recovery_status(status as u8)
.set_node_recovery_status(status.clone() as u8)
.send()
.await
{
Ok(tx) => {
info!("RestoreState: reported progress to recovery contract");
info!("RestoreState: reported progress to recovery contract : {:?}", status);
match tx.confirmations(1).await {
Ok(s) => match s {
None => {
Expand Down
2 changes: 1 addition & 1 deletion rust/lit-node/lit-node/src/tss/common/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ pub async fn delete_key_share_commitments(
/**************** RESTORATION DATA ****************/

#[doc = "Reads encrypted keys from disk"]
pub(crate) async fn read_recovery_data_from_disk<T>(
pub async fn read_recovery_data_from_disk<T>(
path: &PathBuf,
pubkey: &str,
storage_type: StorageType,
Expand Down
2 changes: 2 additions & 0 deletions rust/lit-node/lit-node/src/tss/dkg/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,8 @@ impl DkgEngine {
}
};


info!("Id : {} / Old share : {:?} / Old ids: {:?}", id, old_share, old_ids);
Ok(Box::new(
SecretParticipant::<G>::with_secret(id, &old_share, &parameters, &old_ids)
.map_err(|e| {
Expand Down
Loading
Loading