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

Proper fix for verification::Deployments panic #443

Open
svyatonik opened this issue Aug 22, 2017 · 1 comment
Open

Proper fix for verification::Deployments panic #443

svyatonik opened this issue Aug 22, 2017 · 1 comment
Labels
F6-refactor Code needs refactoring. M4-core Core client code / Rust.

Comments

@svyatonik
Copy link
Contributor

Originally code in support_segwit branch had a panic here:
https://github.com/paritytech/parity-bitcoin/blob/2cacae099ead6b8240a570e4b9226e4007843be5/verification/src/deployments.rs#

This was fixed (temporarily?) by this commit:
9e58d50#diff-39fbf28d89d87ddaff46695c971ec50fR142

But:

  1. looks like it is fix of side-effects, not the original reason. Probably we're checking bits for wrong period at all.
  2. by @debris : this condition could possibly lead to panic in case of reorgs:
    Entry::Occupied(ref entry) if entry.get().block_number == number && entry.get().block_hash == hash => {
  3. the code will currently work only if called with always-increasing block height only (previous value from cache is always used, ignoring height of block, for which it was calculated). Need to add assert over there, or change cache logic
  4. if cache is empty && database (BlockHeaderProvider) contains blocks, in which some Deployment has activated/failed, this state will be returned for all previous blocks because of this:
    if deployment_state.state.is_final() {
  5. since we create separate ChainVerifier for each block AND it takes a lot of time to calculate deployment state, it would be great to use shared cache for ChainVerifier instances. Now cache only works for single block verification.
@svyatonik svyatonik added the M4-core Core client code / Rust. label Aug 22, 2017
@5chdn 5chdn added the F1-panic The client panics and exits without proper error handling. label Aug 22, 2017
@svyatonik
Copy link
Contributor Author

(1) && (5) are fixed in #451 && #452

@svyatonik svyatonik added F6-refactor Code needs refactoring. and removed F1-panic The client panics and exits without proper error handling. labels Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F6-refactor Code needs refactoring. M4-core Core client code / Rust.
Projects
None yet
Development

No branches or pull requests

2 participants