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

[ECR-1627] TODO cleanup pt.4 #869

Merged
merged 26 commits into from
Aug 20, 2018
Merged

[ECR-1627] TODO cleanup pt.4 #869

merged 26 commits into from
Aug 20, 2018

Conversation

ponimas
Copy link
Contributor

@ponimas ponimas commented Aug 13, 2018

Dead code removed from the sandbox.
Implemented proposed test scenarios.
Outdated TODOs were removed.

ponimas and others added 18 commits August 8, 2018 20:22
* Update rand to 0.5.4

- Bump version in all dependent crates
- Replace removed next_u32() with gen::<u32>() (ditto for u64)
- Seed of XorShiftRng is now [u8; 16] instead of [u32; 4], fix the
  types and generate some new seed values
- Rng trait got split into Rng and RngCore, add latter where
  necessary to get access to methods like fill_bytes()
- Replace deprecated gen_ascii_chars() with recommended usage of
  Alphanumeric distribution with sample_iter()
- Replace deprecated gen_iter() usage with fill_bytes() and
  sample_iter() as approriate
- Replace deprecated Rand usage with Standard distribution
- Replace initialization on XorShiftRng from implicitly converted
  rand::random() into an explicit initialization from seed as
  From/Into conversion has been removed

* Update snow to 0.3.1

- Resolvers are not reexported now, import them explicitly
- NoiseBuilder is now called just Builder
- Some functions now return SnowError instead of failure::Error,
  implement a conversion to NoiseError for this type
- CryptoResolver now does not have Send requirement for returned types
- Dh trait now expects a Result to be returned
  - Fix the implementation to return Ok or Err as appropriate,
    this allows us to get rid of a TODO
  - Update the tests as well to unwrap the result, this is needed
    to avoid compiler warnings about unused Results
  - Returning an Err from Dh::dh() produces a different error
    so update test expectations to match that

* Update proptest to 0.8.4

- Strategy::Value has been changed in 0.8.0 to contain the actual
  value produced by the strategy instead of strategy value tree
  (which is now stored in Stragery::Tree). Fix the associate type
  usage and drop now unnecessary import of U8BinarySearch.

* Update tokio-io to 0.1.7

- tokio_io::AsyncRead::framed is deprecated since 0.1.7, use Decoder
  from tokio_codec instead

* Update tokio-retry to 0.2.0

- Retry::spawn() no longer needs event loop handle

* Update cspell to 3.1.3

- Use "npm install" to install dependencies from package.json file
  instead of specifying version in two places

* Mention updates in CHANGELOG
@ponimas ponimas added the work in progress 🚧 Incoming changes expected: pull request isn't ready for the final review. label Aug 13, 2018
@ponimas ponimas force-pushed the 1627.3 branch 2 times, most recently from 2664441 to 3eb2407 Compare August 14, 2018 14:16
@ponimas ponimas removed the work in progress 🚧 Incoming changes expected: pull request isn't ready for the final review. label Aug 14, 2018
@vldm
Copy link
Contributor

vldm commented Aug 15, 2018

Can you append a brief summary of this pull request, and update title.
It's a bit weird when git history contains many entries that don't describe changes.

@ponimas
Copy link
Contributor Author

ponimas commented Aug 15, 2018

@vldm But... The title is the brief summary of this pull request already.

ilammy
ilammy previously approved these changes Aug 15, 2018
Copy link
Contributor

@ilammy ilammy left a comment

Choose a reason for hiding this comment

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

The changes look technically okay to me.

But I agree with @vldm that the pull request title could get some more love. For example, it's way more common to put [ECR-1234] references at the end of the title (119 vs 4 in git history). It also could be a bit more imperative and detailed like Cleanup outdated TODOs. But I'd keep it as is this time because there are three already merged PRs with the same title pattern.

@@ -86,8 +86,10 @@ postvote
precheck
precommit
precommits
precommiters
Copy link
Contributor

Choose a reason for hiding this comment

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

<span class="grammarnazi">It is precommitters, with double t.</span>

@@ -76,8 +75,7 @@ fn ignore_propose_from_non_leader() {

let propose = ProposeBuilder::new(&sandbox)
.with_validator(ValidatorId(3)) //without this line Prevote would have been broadcast
.with_duration_since_sandbox_time(PROPOSE_TIMEOUT)
.build();
.build();
Copy link
Contributor

Choose a reason for hiding this comment

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

There's some weird extra indentation here and there. Shouldn't rustfmt complain about this?..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like bug in rustfmt

@@ -1230,8 +1197,7 @@ fn handle_full_propose_wrong_state_hash() {

sandbox.assert_state(Height(1), Round(1));
// let tmp_propose = ProposeBuilder::new(&sandbox)
// .with_duration_since_sandbox_time(PROPOSE_TIMEOUT)
// .build();
// // .build();
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate // here looks weird.

And... do we need this code? Keeping commented out code is not a good practice.

@@ -1561,8 +1516,7 @@ fn commit_as_leader_send_propose_round_timeout() {
sandbox.check_broadcast_status(new_height, &block.hash());

let propose = ProposeBuilder::new(&sandbox)
.with_duration_since_sandbox_time(PROPOSE_TIMEOUT)
// .with_tx_hashes(&[tx.hash()]) //ordinary propose, but with this unreceived tx
// .with_tx_hashes(&[tx.hash()]) //ordinary propose, but with this unreceived tx
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd remove this commented out line entirely then.

) -> Self {
self.duration_since_sandbox_time = Some(duration_since_sandbox_time);
self
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Was with_duration_since_sandbox_time() removed because this field was set but never actually used or verified anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

commit message for 7ba7306 will explain this

@ponimas
Copy link
Contributor Author

ponimas commented Aug 15, 2018

@ilammy

For example, it's way more common to put [ECR-1234] references at the end of the title (119 vs 4 in git history).

Are there any rules? Cause arguments like "it's way more common..." are not arguments at all.

ilammy
ilammy previously approved these changes Aug 16, 2018
aleksuss
aleksuss previously approved these changes Aug 16, 2018
@aleksuss
Copy link
Contributor

@ponimas fix typo pls ./exonum/src/sandbox/consensus/invalid_message.rs:103:24 - Unknown word (commited)

@ponimas ponimas dismissed stale reviews from aleksuss and ilammy via 67fb44d August 16, 2018 07:08
@aleksuss aleksuss merged commit c4624cc into exonum:master Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants