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

Remove (almost all) panickers from trie module #1776

Merged
merged 30 commits into from Aug 3, 2016
Merged

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Jul 30, 2016

Those in the trie iterator still remain. Not sure if it's worth removing them since it would mean making the iterator item a Result<TrieItem>.

Trie errors will still immediately panic (probably better to fail fast than limp along in a broken state), but the infrastructure is in place to catch them and ask for trie nodes from the network.

@rphmeier rphmeier added the A0-pleasereview 🤓 Pull request needs code review. label Jul 30, 2016
@coveralls
Copy link

coveralls commented Jul 30, 2016

Coverage Status

Coverage decreased (-0.4%) to 86.433% when pulling b560a2e on trie_errors into 53f1d7b on master.

@gavofyork
Copy link
Contributor

tests failing...

@rphmeier
Copy link
Contributor Author

appveyor failure is spurious

@coveralls
Copy link

coveralls commented Jul 31, 2016

Coverage Status

Coverage decreased (-0.4%) to 86.406% when pulling ffffa2a on trie_errors into 53f1d7b on master.

@@ -136,7 +138,11 @@ impl Account {
SecTrieDBMut would not set it to an invalid state root. Therefore the root is valid and DB creation \
using it will not fail.");

(Filth::Clean, H256::from(db.get(key).map_or(U256::zero(), |v| -> U256 {decode(v)})))
let item: U256 = match db.get(key){
Ok(x) => x.map_or_else(|| U256::zero(), decode),
Copy link
Contributor

Choose a reason for hiding this comment

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

x.map_or_else(U256::zero, decode)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

or x.map_or_else(U256::default, decode) to avoid importing Uint trait :)

[ci:skip]
@coveralls
Copy link

coveralls commented Aug 1, 2016

Coverage Status

Coverage decreased (-0.3%) to 86.507% when pulling 65c20ef on trie_errors into 53f1d7b on master.

@coveralls
Copy link

coveralls commented Aug 1, 2016

Coverage Status

Coverage decreased (-0.4%) to 86.499% when pulling 65c20ef on trie_errors into 53f1d7b on master.

db: &mut HashDB,
root: &mut H256,
accounts: &mut HashMap<Address,
Option<Account>>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could stay on the same line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it could, but the line stands at something like 130 characters plus a tab. it seems cleaner to indent it in some way.

@coveralls
Copy link

coveralls commented Aug 2, 2016

Coverage Status

Coverage decreased (-0.4%) to 86.406% when pulling 99e2011 on trie_errors into 53f1d7b on master.

@gavofyork
Copy link
Contributor

gavofyork commented Aug 2, 2016

looks generally good.

would be nice to re-review against the current master - there are a lot of unrelated merges in the diff here making it difficult to see the forest for the trees sometimes.

@gavofyork gavofyork added A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 2, 2016
@coveralls
Copy link

coveralls commented Aug 2, 2016

Coverage Status

Coverage decreased (-0.6%) to 86.402% when pulling f412fd2 on trie_errors into 21c65a9 on master.

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. and removed A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. labels Aug 2, 2016
@rphmeier
Copy link
Contributor Author

rphmeier commented Aug 2, 2016

@gavofyork it is merged with the latest master -- i hadn't realized it was messing up the diff.

@gavofyork gavofyork added A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 2, 2016
@coveralls
Copy link

coveralls commented Aug 3, 2016

Coverage Status

Coverage decreased (-0.5%) to 86.498% when pulling e0ac2ff on trie_errors into 9fb5623 on master.

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. and removed A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. labels Aug 3, 2016
@gavofyork
Copy link
Contributor

travis failing?

@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 3, 2016
@rphmeier
Copy link
Contributor Author

rphmeier commented Aug 3, 2016

seems like it, not sure why -- all the tests are passing on my machine ;)
I wonder if it's spurious, since the test failure here is miner::should_get_price_info. completely unrelated to trie.

@gavofyork
Copy link
Contributor

yeah - that one requires network access.

@coveralls
Copy link

coveralls commented Aug 3, 2016

Coverage Status

Coverage decreased (-0.4%) to 86.561% when pulling 771fb50 on trie_errors into 8c88e2a on master.

@gavofyork gavofyork merged commit 11b65ce into master Aug 3, 2016
@gavofyork gavofyork deleted the trie_errors branch August 3, 2016 16:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants