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

compute the hash of the proposal iff the proposal hash is present #1365

Merged
merged 4 commits into from
Sep 8, 2021

Conversation

Stebalien
Copy link
Member

Previously, we'd always compute the hash but only compare it if it was specified. This simply increased the cost of messages that didn't specify the hash for no good reason.

fixes #1364

@Stebalien Stebalien requested a review from anorth January 24, 2021 00:57
@Stebalien
Copy link
Member Author

@anorth please check this thoroughly. I believe this is the correct thing to do, but I'm not familiar with why the code was written the way it was in the first place.

@codecov-io
Copy link

Codecov Report

Merging #1365 (0167588) into master (c7ea991) will not change coverage.
The diff coverage is 100.0%.

@@          Coverage Diff           @@
##           master   #1365   +/-   ##
======================================
  Coverage    69.5%   69.5%           
======================================
  Files          72      72           
  Lines        7638    7638           
======================================
  Hits         5310    5310           
  Misses       1437    1437           
  Partials      891     891           

@ZenGround0 ZenGround0 mentioned this pull request Apr 8, 2021
28 tasks
@Stebalien Stebalien added this to the v6 milestone Jun 18, 2021
@Stebalien Stebalien requested a review from a team as a code owner August 31, 2021 16:52
@ZenGround0
Copy link
Contributor

Looks good. Adding tests before merging.

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2021

Codecov Report

Merging #1365 (973af29) into master (3c34498) will not change coverage.
The diff coverage is 100.0%.

@@          Coverage Diff           @@
##           master   #1365   +/-   ##
======================================
  Coverage    71.1%   71.1%           
======================================
  Files          72      72           
  Lines        8395    8395           
======================================
  Hits         5975    5975           
  Misses       1574    1574           
  Partials      846     846           

@ZenGround0
Copy link
Contributor

@droark do you see any problems with this?

Stebalien and others added 4 commits September 7, 2021 10:14
Previously, we'd always compute the hash but only _compare_ it if it
was specified. This simply increased the cost of messages that didn't
specify the hash for no good reason.

fixes #1364
Copy link
Contributor

@droark droark left a comment

Choose a reason for hiding this comment

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

👍

I'd prefer that the PR not be pulled for another day, in case I think of some reason why this shouldn't be pulled, but I'm pretty sure this is safe. I can't think of any reasons why a hash should be mandatory in this situation. The modified logic seems safe too.

@ZenGround0 ZenGround0 merged commit fd2767a into master Sep 8, 2021
@ZenGround0 ZenGround0 removed their assignment Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

skip calculating hash if not check, or remove param
6 participants