Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Bloom upgrade in master#2624

Closed
NikVolf wants to merge 1 commit into
masterfrom
bloom-upgrade-master
Closed

Bloom upgrade in master#2624
NikVolf wants to merge 1 commit into
masterfrom
bloom-upgrade-master

Conversation

@NikVolf
Copy link
Copy Markdown
Contributor

@NikVolf NikVolf commented Oct 14, 2016

had to move the same in-place upgrade logic that we had in beta

@NikVolf NikVolf added the A0-pleasereview 🤓 Pull request needs code review. label Oct 14, 2016
@NikVolf NikVolf force-pushed the bloom-upgrade-master branch from d4f9674 to dff803d Compare October 14, 2016 10:46
@NikVolf NikVolf force-pushed the bloom-upgrade-master branch from dff803d to 1d3934b Compare October 14, 2016 10:51
@NikVolf NikVolf added the M4-core ⛓ Core client code / Rust. label Oct 14, 2016
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.05%) to 86.456% when pulling 1d3934b on bloom-upgrade-master into 4581469 on master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 86.502% when pulling 1d3934b on bloom-upgrade-master into 4581469 on master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 86.512% when pulling 1d3934b on bloom-upgrade-master into 4581469 on master.

@rphmeier
Copy link
Copy Markdown
Contributor

rphmeier commented Oct 14, 2016

should add a comment warning about the dangers of adding future migrations which affect the bloom without adjusting the inplace migrations. See https://github.com/ethcore/parity/pull/2411#issuecomment-251810990 -- adding this mechanism to master is just technical debt we'll have to clean up later.

@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Oct 14, 2016
}
}

println!("Adding/expanding accounts bloom (one-time upgrade)");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same println! issue as the beta PR.

let bloom_journal = {
let mut bloom = Bloom::new(ACCOUNT_BLOOM_SPACE, DEFAULT_ACCOUNT_PRESET);
// no difference what algorithm is passed, since there will be no writes
let state_db = journaldb::new(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this comment is actually wrong -- OverlayRecent will work with Archive, but not vice-versa, as Archive wouldn't be able to read the latest state from the journal overlay.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's also probably best to just take the pruning argument as a parameter -- we have it in the migration phase, so there's no point firing shots in the dark. I don't see why refcounted and light pruning wouldn't be supported with this migration.

Copy link
Copy Markdown
Contributor Author

@NikVolf NikVolf Oct 14, 2016

Choose a reason for hiding this comment

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

@rphmeier
nobody had issues running migration, this code is already used for several beta versions
where do you think will be fail there?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@NikVolf well, really it's because nobody uses light or refcounted but it's probably better to say "migration unsupported for pruning algorithm {}" than to fail unexpectedly with TrieError::NonexistantStateRoot. Although that's not really correct either, because there's no reason that the migration would be unsupported for that pruning algorithm because it will work for an arbitrary pruning algorithm.

Copy link
Copy Markdown
Contributor Author

@NikVolf NikVolf Oct 14, 2016

Choose a reason for hiding this comment

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

why it will fail with this error?
there is only one state root used there, which is for the best block, no?

@rphmeier rphmeier added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A8-looksgood 🦄 Pull request is reviewed well. labels Oct 14, 2016
@NikVolf
Copy link
Copy Markdown
Contributor Author

NikVolf commented Oct 14, 2016

@rphmeier i don't see where exactly this warning will have any use

@rphmeier
Copy link
Copy Markdown
Contributor

rphmeier commented Oct 14, 2016

@NikVolf If you imagine a migration 10 -> 11 which assumes the bloom is adjusted to a larger size, it'll fail for every 9 -> 11 migration if the inplace migration isn't adjusted accordingly. The warning will help the developer write the code correctly and also signal that the inplace migrations as a temporary mechanism have outstayed their welcome.

I'm not saying that it has to be fixed right away, but when we introduce solutions which won't function correctly for some edge cases, they're usually marked with a TODO.

@NikVolf
Copy link
Copy Markdown
Contributor Author

NikVolf commented Oct 14, 2016

@rphmeier
no, if we alter bloom size sometimes, such in-place upgrades are not temporary mechanism
i can't see how 9->11 migration will fail here
bloom will just be generated with the most recent options after 9->11 migration finishes

@rphmeier
Copy link
Copy Markdown
Contributor

rphmeier commented Oct 14, 2016

Ok, maybe you can explain the flaw in the reasoning here, but the way I see it is:

  1. 9 -> 10 migration applied, creating a bloom with the initial size.
  2. 10 -> 11 migration applied, which expects a bloom with the new size and fails, because inplace migrations are applied at the end.

To avoid this, you'd have to write your 10 -> 11 migration in such a way that it can handle blooms which have and have not been in-place upgraded without a version bump.

@NikVolf
Copy link
Copy Markdown
Contributor Author

NikVolf commented Oct 14, 2016

@rphmeier
9 -> 10 migration will create bloom with the most actual size right away, so this is not the case

@NikVolf NikVolf added A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. labels Oct 15, 2016
@NikVolf
Copy link
Copy Markdown
Contributor Author

NikVolf commented Oct 15, 2016

Looks like trie iterations take too long on many machines for 10M+ accounts

@gavofyork
Copy link
Copy Markdown
Contributor

closing for now; probably worth keeping the code in general since we'll want to rebuild after we've done the pruning and after a sufficiently high number of suicides have happened.

@gavofyork gavofyork closed this Oct 16, 2016
@gavofyork gavofyork deleted the bloom-upgrade-master branch November 3, 2016 11:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. M4-core ⛓ Core client code / Rust.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants