Skip to content

Avoid adding a token at NULL_ADDRESS#4876

Merged
rakanalh merged 5 commits into
raiden-network:developfrom
pirapira:non-zero-token-address
Sep 23, 2019
Merged

Avoid adding a token at NULL_ADDRESS#4876
rakanalh merged 5 commits into
raiden-network:developfrom
pirapira:non-zero-token-address

Conversation

@pirapira
Copy link
Copy Markdown
Contributor

@pirapira pirapira commented Sep 13, 2019

because then the call to TokenNetworkRegistry will fail.

This fixes #4875.

Fixes: 4815

Description

Please, describe what this PR does in detail:

  • If it's a bug fix, detail the root cause of the bug and how this PR fixes it.

After this PR, TokenNetworkRegistry proxy refuses to register a token contract at address 0x00000000....00. The constructor of TokenNetwork contract checks against this case, so the contract proxy needs to check this condition.

I didn't add post-failure checks because the precondition checks will completely remove the possibility that the token address is 0x00000000..00.

PR review check list

Quality check list that cannot be automatically verified.

  • Safety
  • Code quality
    • Error conditions are handled
    • Exceptions are propagated to the correct parent greenlet
    • Exceptions are correctly classified as recoverable or unrecoverable
  • Compatibility
    • State changes are forward compatible
    • Transport messages are backwards and forward compatible
  • Commits
    • Have good messages
    • Squashed unecessary commits
  • If it's a bug fix:
    • Regression test for the bug
      • Properly covers the bug
      • If an integration test is used, it could not be written as a unit test
  • Documentation
    • A new CLI flag was introduced, is there documentation that explains usage?
  • Specs
    • If this is a protocol change, are the specs updated accordingly? If so, please link PR from the specs repo.
  • Is it a user facing feature/bug fix?
    • Changelog entry has been added

@pirapira

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 13, 2019

Codecov Report

Merging #4876 into develop will decrease coverage by 0.16%.
The diff coverage is 75%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4876      +/-   ##
===========================================
- Coverage    80.97%   80.81%   -0.17%     
===========================================
  Files          120      120              
  Lines        14510    14515       +5     
  Branches      2236     2238       +2     
===========================================
- Hits         11750    11730      -20     
- Misses        2112     2129      +17     
- Partials       648      656       +8
Impacted Files Coverage Δ
raiden/api/rest.py 73.26% <ø> (ø) ⬆️
raiden/exceptions.py 100% <100%> (ø) ⬆️
raiden/network/proxies/token_network_registry.py 77.14% <100%> (+0.44%) ⬆️
raiden/api/python.py 68.08% <50%> (-0.9%) ⬇️
raiden/storage/serialization/types.py 64.17% <0%> (-4.48%) ⬇️
raiden/tasks.py 67.64% <0%> (-2.95%) ⬇️
raiden/utils/echo_node.py 67.79% <0%> (-1.7%) ⬇️
raiden/network/transport/matrix/client.py 68.5% <0%> (-1.3%) ⬇️
raiden/network/proxies/token_network.py 50.06% <0%> (-0.74%) ⬇️
raiden/raiden_event_handler.py 91.84% <0%> (-0.63%) ⬇️
... and 3 more

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 269e665...0de4d4a. Read the comment docs.

Comment thread raiden/network/proxies/token_network_registry.py Outdated
@rakanalh rakanalh force-pushed the non-zero-token-address branch from 4b67094 to bd6dc0b Compare September 19, 2019 13:53
@rakanalh rakanalh dismissed their stale review September 19, 2019 13:53

Contributed to the PR

@rakanalh rakanalh force-pushed the non-zero-token-address branch from bd6dc0b to 2cdbb66 Compare September 19, 2019 13:54
@LefterisJP
Copy link
Copy Markdown
Contributor

Fixes: #4815

How does this relate to #4815?

Comment thread raiden/api/python.py Outdated
Comment thread raiden/api/python.py Outdated
Comment thread raiden/api/python.py Outdated
Comment thread raiden/api/rest.py Outdated
Comment thread raiden/network/proxies/token_network_registry.py Outdated
@rakanalh rakanalh requested a review from LefterisJP September 19, 2019 14:39
@rakanalh rakanalh mentioned this pull request Sep 20, 2019
13 tasks
@rakanalh rakanalh force-pushed the non-zero-token-address branch from 655fdea to 0de4d4a Compare September 23, 2019 07:57
@rakanalh rakanalh merged commit b17fabd into raiden-network:develop Sep 23, 2019
@pirapira pirapira deleted the non-zero-token-address branch September 23, 2019 12:13
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.

TokenNetworkRegistry proxy should check that token_address is nonzero

3 participants