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

Cleanup after signing changed #4354

Merged
merged 2 commits into from
Jul 10, 2019
Merged

Cleanup after signing changed #4354

merged 2 commits into from
Jul 10, 2019

Conversation

karlb
Copy link
Contributor

@karlb karlb commented Jul 8, 2019

Some additional cleanup after the refactoring in #4284.

This changes the signatures of all EnvelopeMessages. So if that is a problem, block this PR!

karlb added 2 commits July 9, 2019 18:04
We don't want to add `cmdids` to these messages. For planned solutions
see
raiden-network/raiden-contracts#1110
and #4297.
In #4284 I tried to keep
all signatures identical. Now it's obvious that all `EnvelopeMessage`
subclasses have a signature that is based on a BP with all additional
fields put into the `additional_hash`. Due to this construction, the
`message_hash` which is used to calculate the `additional_hash` can be
reduced to all fields that are not already included in the BP.

The padding is also unnecessary and was only included to preserve the
old behaviour during the large refactoring PR mentioned above. It's
usually a good idea to separate refactoring and behavior changes.
@codecov
Copy link

codecov bot commented Jul 9, 2019

Codecov Report

❗ No coverage uploaded for pull request base (develop@f2638f8). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #4354   +/-   ##
==========================================
  Coverage           ?   80.21%           
==========================================
  Files              ?      102           
  Lines              ?    13813           
  Branches           ?     2148           
==========================================
  Hits               ?    11080           
  Misses             ?     2113           
  Partials           ?      620
Impacted Files Coverage Δ
raiden/messages.py 89.38% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2638f8...0c44ac1. Read the comment docs.

@karlb karlb marked this pull request as ready for review July 10, 2019 09:50
Copy link
Contributor

@hackaugusto hackaugusto left a comment

Choose a reason for hiding this comment

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

LGTM. This is hashing fields only once, whereas previously the fields of the balance proof were hashed twice, once for the balance proof itself and another time as part of the message_hash (which is saved in the balance proof additional_hash)

@hackaugusto hackaugusto merged commit e4bc9e7 into raiden-network:develop Jul 10, 2019
@karlb karlb deleted the cleanup-after-signing-changed branch July 11, 2019 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants