mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-09 11:25:55 +00:00
Implement tree states & hierarchical state DB
This commit is contained in:
@@ -42,7 +42,8 @@ pub fn run<T: EthSpec>(testnet_dir: PathBuf, matches: &ArgMatches) -> Result<(),
|
||||
|
||||
let mut deposit_tree = DepositDataTree::create(&[], 0, DEPOSIT_TREE_DEPTH);
|
||||
let mut deposit_root = Hash256::zero();
|
||||
for (index, validator) in state.validators_mut().iter_mut().enumerate() {
|
||||
let validators = state.validators_mut();
|
||||
for index in 0..validators.len() {
|
||||
let (secret, _) =
|
||||
recover_validator_secret_from_mnemonic(seed.as_bytes(), index as u32, KeyType::Voting)
|
||||
.map_err(|e| format!("Unable to generate validator key: {:?}", e))?;
|
||||
@@ -52,11 +53,14 @@ pub fn run<T: EthSpec>(testnet_dir: PathBuf, matches: &ArgMatches) -> Result<(),
|
||||
|
||||
eprintln!("{}: {}", index, keypair.pk);
|
||||
|
||||
validator.pubkey = keypair.pk.into();
|
||||
validators
|
||||
.get_mut(index)
|
||||
.unwrap()
|
||||
.replace_pubkey(keypair.pk.into());
|
||||
|
||||
// Update the deposit tree.
|
||||
let mut deposit_data = DepositData {
|
||||
pubkey: validator.pubkey,
|
||||
pubkey: *validators.get(index).unwrap().pubkey(),
|
||||
// Set this to a junk value since it's very time consuming to generate the withdrawal
|
||||
// keys and it's not useful for the time being.
|
||||
withdrawal_credentials: Hash256::zero(),
|
||||
|
||||
Reference in New Issue
Block a user