-
Notifications
You must be signed in to change notification settings - Fork 637
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
test: add extra stats to cross_shard_tx #3057
Conversation
9c90f67
to
d9bd7e6
Compare
Codecov Report
@@ Coverage Diff @@
## master #3057 +/- ##
==========================================
- Coverage 87.39% 87.26% -0.14%
==========================================
Files 212 212
Lines 41322 41377 +55
==========================================
- Hits 36115 36108 -7
- Misses 5207 5269 +62
Continue to review full report at Codecov.
|
chain/client/src/test_utils.rs
Outdated
impl BlockStats { | ||
fn new() -> BlockStats { | ||
BlockStats { | ||
hash2height: HashMap::new(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename it to hash2depth
or hash2length
(and then consistently use length
or depth
throughout to refer to the number of blocks on the chain), to avoid the confusion with the actual block heights.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was marked as resolved, but the name is still hash2height
. Not sure if there's a change that wasn't pushed yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. One small issue I see is that orphans are not handled in add_block
. I am not sure whether that is a possibility.
I was thinking about adding code to handle this case. I would add a panic in case we see a situation like this. However I decided to keep the code simple. In case there is an orphan, we will see a panic due to unwrap. I could replace .unwrap() with expect("....") if you think this code will be more clear. |
Are you sure? I only see this
which doesn't panic. |
23ec71f
to
cb38ce3
Compare
@bowenwang1996 we never have the same block producer twice in a row, and thus a block cannot be created unless its parent was sent over the network. Given the code you are commenting is the callback that is triggered for each network message, it is impossible for a block to be handled before it's parent was handled. |
d3866f4
to
4408395
Compare
9868e81
to
1aefeca
Compare
The usefulness and flakiness of
cross_shard_tx
depends heavily on the block production time.This change adds printing block stats every minute, we will print the following:
In addition we will fail
cross_shard_tx
test if the ratio is too high or to low, depending on test parameters.#3014