move hashing functionality to accounts_hash (#15353)

This commit is contained in:
Jeff Washington (jwash) 2021-02-16 18:29:50 -06:00 committed by GitHub
parent 8367740ff9
commit 7fee0bc69c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1579 additions and 1538 deletions

View File

@ -1,7 +1,7 @@
extern crate log;
use clap::{crate_description, crate_name, value_t, App, Arg};
use solana_measure::measure::Measure;
use solana_runtime::accounts_db::AccountsDB;
use solana_runtime::accounts_hash::AccountsHash;
use solana_sdk::{hash::Hash, pubkey::Pubkey};
fn main() {
@ -36,7 +36,7 @@ fn main() {
let hashes = hashes.clone(); // done outside timing
let mut time = Measure::start("compute_merkle_root");
let fanout = 16;
AccountsDB::compute_merkle_root(hashes, fanout);
AccountsHash::compute_merkle_root(hashes, fanout);
time.stop();
time.as_us()
})

File diff suppressed because it is too large Load Diff

1559
runtime/src/accounts_hash.rs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@ pub mod accounts;
pub mod accounts_background_service;
pub mod accounts_cache;
pub mod accounts_db;
pub mod accounts_hash;
pub mod accounts_index;
pub mod append_vec;
pub mod bank;