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

Add channel openWithDeposit wrapper #1486

Merged
merged 3 commits into from
Jul 1, 2021

Conversation

palango
Copy link
Contributor

@palango palango commented Jul 1, 2021

What this PR does

Fixes #1436

Add a wrapper that opens a channel and deposits.

Why I'm making this PR

What's tricky about this PR (if any)


Any reviewer can check these:

  • If the PR is fixing a bug or adding a feature, add an entry to CHANGELOG.md.
  • If the PR changed a Solidity source, run make compile_contracts and add the resulting raiden_contracts/data/contracts.json in the PR.
  • If the PR is changing documentation only, add [skip ci] in the commit message so Travis does not waste time.
    • But, if the PR changes comments in a Solidity source, do not add [skip ci] and let Travis check the hash of the source.
  • In Python, use keyword arguments
  • Squash unnecessary commits
  • Comment commits
  • Follow naming conventions
    • solidityFunction
    • _solidity_argument
    • solidity_variable
    • python_variable
    • PYTHON_CONSTANT
  • Follow the Signature Convention in CONTRIBUTING.md
  • For each new contract
    • The deployment script deploys the new contract.
    • etherscan_verify.py runs on the new contract.
  • Bookkeep
    • The gas cost of new functions are stored in gas.json.
  • Solidity specific conventions
    • Document arguments of functions in natspec
    • Care reentrancy problems
    • if the PR adds or removes require() or assert()
      • add an entry in Changelog
      • open an issue in the client, light client, service repos so the change is reflected there
      • Just adding a message in require() doesn't require these steps.
  • When you catch a require() failure in Solidity, look for a specific error message like pytest.raises(TransactionFailed, match="error message"):

And before "merge" all checkboxes have to be checked. If you find redundant points, remove them.

@palango palango requested a review from karlb July 1, 2021 12:40
@palango palango changed the title Channel open deposit Add channel openWithDeposit wrapper Jul 1, 2021
@codecov
Copy link

codecov bot commented Jul 1, 2021

Codecov Report

Merging #1486 (67c992f) into master (ae9e621) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1486   +/-   ##
=======================================
  Coverage   80.66%   80.66%           
=======================================
  Files          22       22           
  Lines        1562     1562           
  Branches      190      190           
=======================================
  Hits         1260     1260           
  Misses        255      255           
  Partials       47       47           

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 ae9e621...67c992f. Read the comment docs.

raiden_contracts/data/source/raiden/TokenNetwork.sol Outdated Show resolved Hide resolved
"TokenNetwork DEPLOYMENT": 3735537,
"TokenNetwork.closeChannel": 122819,
"TokenNetwork.openChannel": 115056,
"TokenNetwork.openChannelWithDeposit": 153255,
Copy link
Contributor

Choose a reason for hiding this comment

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

153255 < (115056 + 58468 = 173524)

That's 12% less. A nice gas reduction in addition to being twice as fast as doing two transactions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's 20.269, so nearly the cost of a transaction.

@palango palango merged commit 2bfc938 into raiden-network:master Jul 1, 2021
@palango palango deleted the channel-open-deposit branch July 1, 2021 15:12
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.

Add function to combine open and deposit
2 participants