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

Document gas measuring for releasing #508

Merged
merged 1 commit into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include Changelog.md
include requirements.txt
include raiden_contracts/constants.py
include raiden_contracts/data/contracts.json
include raiden_contracts/data/deployment_kovan.json
include raiden_contracts/data/deployment_rinkeby.json
Expand Down
21 changes: 21 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Package Deliverables
- smart contracts source code from ``raiden_contracts/contracts``
- compiled contracts data from ``raiden_contracts/data/contracts.json``
- deployment information from ``raiden_contracts/data/deployment_*.json``, with Ethereum addresses, transaction data (transaction hash, block number, constructor arguments, gas cost)
- gas costs information from ``raiden_contracts/constants.py``
- scripts for deployment & contract verification on Etherscan from ``raiden_contracts/deploy``
- source code tests from ``raiden_contracts/tests``

Expand All @@ -21,6 +22,7 @@ When we want to release another version of the ``raiden-contracts`` package, we
#. `Bump the version on the smart contracts <bump-contracts>`_
#. `Deploy smart contracts <_deploy-contracts>`_ on all the supported chains and overwrite ``deployment_*,json`` files with the new deployment data.
#. `Verify the deployed smart contracts on Etherscan <verify-contracts>`_
#. `Measure Gas Costs <measure-gas>`_ and update ``constants.py``

#. `Bump the package version <bump-package>`_
#. `Release the new package version <_release-package>`_
Expand Down Expand Up @@ -106,6 +108,25 @@ Etherscan verification is documented here: https://github.com/raiden-network/rai
Note that we currently have some issues with the script: https://github.com/raiden-network/raiden-contracts/issues/349.


.. _measure-gas:

Measure Gas Costs
-----------------

``raiden_contracts`` package provides `some constants <https://github.com/raiden-network/raiden-contracts/blob/de13cf9aa7ad7ed230ff204e47103def6a14b0be/raiden_contracts/constants.py#L35>`__ showing the amount of gas that each operation requires. This information is manually updated. The amounts can be measured with a script

::

pytest -s raiden_contracts/tests/test_print_gas.py

The script prints many numbers like
Copy link
Contributor

Choose a reason for hiding this comment

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

@pirapira Wouldn't it make more sense to remake the script into measure_gas.py and have it auto-generate the constants.py for you instead of you manually creating by copying the output of the script?

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 #16.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah good then!


::
----------------------------------
GAS USED TokenNetwork.unlock 6 locks 66019
----------------------------------


.. _bump-package:

Bump Package Version
Expand Down