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

Merk hash scheme migration #338

Open
wants to merge 120 commits into
base: main
Choose a base branch
from

Conversation

MavenRain
Copy link
Contributor

The ultimate goal of this PR will be to rectify #308

@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2023

Codecov Report

Merging #338 (cf3d3c2) into main (4984260) will decrease coverage by 1.96%.
The diff coverage is 49.07%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #338      +/-   ##
==========================================
- Coverage   82.95%   81.00%   -1.96%     
==========================================
  Files         130      131       +1     
  Lines       15139    15664     +525     
==========================================
+ Hits        12558    12688     +130     
- Misses       2581     2976     +395     
Impacted Files Coverage Δ
src/many-kvstore/src/storage/account.rs 98.21% <ø> (ø)
src/many-ledger/src/migration/hash.rs 0.00% <0.00%> (ø)
...c/many-ledger/src/migration/legacy_remove_roles.rs 0.00% <ø> (ø)
src/many-ledger/src/migration/tokens.rs 0.00% <0.00%> (ø)
src/many-ledger/src/storage/ledger.rs 52.22% <20.87%> (-22.54%) ⬇️
src/many-ledger/test-utils/src/lib.rs 94.78% <37.50%> (-0.61%) ⬇️
src/many-ledger/src/migration/data.rs 65.71% <42.62%> (-32.70%) ⬇️
src/many-ledger/src/storage/data.rs 76.53% <46.51%> (-23.47%) ⬇️
src/many-ledger/src/storage.rs 73.61% <47.95%> (-20.83%) ⬇️
src/many-ledger/src/storage/iterator.rs 62.50% <49.29%> (-34.33%) ⬇️
... and 15 more

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

Let's discuss the PathBuf additional fields. I'm not convinced we absolutely need them.

Also, I don't know how your IDE is configured but it's the first time I see an IDE rewrite the use at the top to this. It might just be a setting.

use merk::tree::Tree;
use std::collections::BTreeMap;
use std::path::PathBuf;
use {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how you got this refactor... We don't use a use { /* all imports */ } pattern anywhere else, so if you could revert this that would be great.

use merk::rocksdb::{IteratorMode, ReadOptions};
use merk::tree::Tree;
use std::path::PathBuf;
use {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, I'd like to keep it to one use per import module.

use tendermint_abci::Application;
use tendermint_proto::abci::*;
use tracing::{debug, error};
use {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same.

use linkme::distributed_slice;
use many_error::ManyError;
use many_migration::{InnerMigration, MigrationSet};
use {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here too.

&mut self,
storage: &mut T,
block_height: u64,
path: P,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should discuss this, I'd like to know what other ways we have. It adds a lot of complexity at the call sites. Best case, we don't need to change this method's signature, but in case we have to, this should probably be Option<P> considering how it's used with hardcoded "" sometimes.

edition = "2021"
readme = "README.md"
Copy link
Contributor

Choose a reason for hiding this comment

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

Bad merge. Revert this change to the [package] (here and other Cargo.toml).

Copy link
Contributor

@fmorency fmorency left a comment

Choose a reason for hiding this comment

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

I just glanced at the code; I didn't do an in-depth review.

Thanks!

Ok((retain_height, hash.into()))
})()
.unwrap_or_else(|error| {
println!("AbciCommitInfo erorr: {error:?}");
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove?

@@ -91,4 +99,4 @@ vergen = { version = "8.1.0", features = ["git", "git2"] }
balance_testing=[] # Enable balance initialization from the CLI
migration_testing=[] # Enable Dummy migration
webauthn_testing=[] # Disable WebAuthn token validation from the CLI
disable_token_sender_check=[] # Disable token endpoint sender validation
disable_token_sender_check=[] # Disable token endpoint sender validation
Copy link
Contributor

Choose a reason for hiding this comment

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

EOF EOL

minicbor = { version = "0.19.1", features = ["derive", "std"] }
once_cell = "1.12"
proptest = "1"
serde_json = "1.0.72"
tempfile = "3.3.0"
tracing = "0.1.28"
tracing = "0.1.28"
Copy link
Contributor

Choose a reason for hiding this comment

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

EOF EOL

check_consistency --pem=1 --balance=999000 --id="$(identity 1)" 8000 8001 8002
check_consistency --pem=2 --balance=1000 --id="$(identity 2)" 8000 8001 8002

}
Copy link
Contributor

Choose a reason for hiding this comment

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

EOF EOL

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.

4 participants