Skip to content
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

Merged
merged 3 commits into from
Dec 9, 2021
Merged

Conversation

vldm
Copy link
Collaborator

@vldm vldm commented Nov 29, 2021

No description provided.

fn inspect_data_raw<Data: AsRef<[u8]>>(&self, key: Vec<u8>, value: Data) -> Result<()>;
}

#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
Copy link
Contributor

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<()>;
Copy link
Contributor

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]>

evm-utils/evm-state/src/storage/inspectors.rs Outdated Show resolved Hide resolved
evm-utils/evm-state/src/storage/inspectors.rs Outdated Show resolved Hide resolved
evm-utils/evm-state/src/storage/inspectors.rs Outdated Show resolved Hide resolved

for (key, _data) in db.iterator(rocksdb::IteratorMode::Start) {
let bytes = <&[u8; 32]>::try_from(key.as_ref())?;
let key = H256::from(bytes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

H256::try_from_slice

Copy link
Collaborator Author

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

Copy link
Contributor

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 {

evm-utils/evm-state/src/storage/walker.rs Outdated Show resolved Hide resolved
evm-utils/evm-state/src/storage/walker.rs Show resolved Hide resolved
evm-utils/evm-state/src/storage/walker.rs Outdated Show resolved Hide resolved
{
storages_walker.traverse(*storage_root)?;
}
info!("Total trie nodes info:");
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But previous contain.

Copy link
Contributor

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.

@vldm vldm merged commit 8c578f1 into velas:develop Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants