-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make inspector work parallel #248
Conversation
fn inspect_data_raw<Data: AsRef<[u8]>>(&self, key: Vec<u8>, value: Data) -> Result<()>; | ||
} | ||
|
||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eq
, Ord
, PartialOrd
, and even PartialEq
instances are unnecessary.
} | ||
|
||
pub mod memorizer { | ||
pub trait TrieDataInsectorRaw { | ||
fn inspect_data_raw<Data: AsRef<[u8]>>(&self, key: Vec<u8>, value: Data) -> Result<()>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably key should be also typed as AsRef<[u8]>
|
||
for (key, _data) in db.iterator(rocksdb::IteratorMode::Start) { | ||
let bytes = <&[u8; 32]>::try_from(key.as_ref())?; | ||
let key = H256::from(bytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
H256::try_from_slice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no try_from_slice in H256 afaik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already implemented. In this PR.
=)
impl TryFromSlice for H256 { |
ledger-tool/src/evm_state.rs
Outdated
{ | ||
storages_walker.traverse(*storage_root)?; | ||
} | ||
info!("Total trie nodes info:"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Header should be part of summarize()
call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TrieCollector
is generic enough, and don't have info about type of trie that it collect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This info line doesn't contains any type specific info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But previous contain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn summarize(&self) where K: Debug
or something like this.
b0ab845
to
2c18bc0
Compare
No description provided.