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

Fix zeth helper #403

Merged
merged 3 commits into from
Aug 26, 2021
Merged

Fix zeth helper #403

merged 3 commits into from
Aug 26, 2021

Conversation

AntoineRondelet
Copy link
Contributor

  • Fixed missing conversion to checksum for flag value in zeth-helper eth-fund
  • The eth-fund command fails with the following error:
  File "<path-to-zeth>/zeth/client/env/lib/python3.7/site-packages/web3/middleware/validation.py", line 77, in check_extradata_length
    len(result), MAX_EXTRADATA_LENGTH, result
web3.exceptions.ExtraDataLengthError: The field extraData is 495 bytes, but should be 32. It is quite likely that you are connected to a POA chain. Refer to http://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority for more details. The full extraData is: HexBytes('0xf901ecf896d89411345428e41

@AntoineRondelet AntoineRondelet changed the base branch from master to develop August 26, 2021 11:15
@AntoineRondelet
Copy link
Contributor Author

AntoineRondelet commented Aug 26, 2021

* The `eth-fund` command fails with the following error:
  File "<path-to-zeth>/zeth/client/env/lib/python3.7/site-packages/web3/middleware/validation.py", line 77, in check_extradata_length
    len(result), MAX_EXTRADATA_LENGTH, result
web3.exceptions.ExtraDataLengthError: The field extraData is 495 bytes, but should be 32. It is quite likely that you are connected to a POA chain. Refer to http://web3py.readthedocs.io/en/stable/middleware.html#geth-style-proof-of-authority for more details. The full extraData is: HexBytes('0xf901ecf896d89411345428e41

@dtebbs AFAIK, the implementation of zeth-helper eth-fund must be extended. If I use zeth-helper eth-fund --source-addr <my-funded-address> on Barkerloo, then we don't enter this block https://github.com/clearmatics/zeth/blob/develop/client/zeth/helper/eth_fund.py#L39 and we don't set the Geth PoA middleware which triggers this error. So we probably want to extent this file to add a case for the bakerloo network name (which is the default name given by running zeth-helper eth-gen-network-config bakerloo).
Surely, if people decide to point to bakerloo with a different network name (or point to, say, Eth mainnet and name the network "bakerloo" for some reason), the right middleware won't be set anymore and the error will show up again, but at least, someone copying and pasting commands int he Bakerloo documentation would not have this error anymore. We can also add further documentation here to document this edge case.


[EDIT] Instead of bothering extending this command, which is only relevant when used in a test environment like Ganache or "autonity-helloworld", I simply extended the documentation of the command to clarify the intent and contexts in which it is relevant. Also, I switched to middleware_onion (see ethereum/web3.py#1210) since middleware_stack was still used and thus broke after the upgrade to web3 >5 in #389 (see: https://web3py.readthedocs.io/en/stable/releases.html#v5-0-0-alpha-4)

@AntoineRondelet AntoineRondelet changed the title Fix zeth helper [WIP] Fix zeth helper Aug 26, 2021
@AntoineRondelet AntoineRondelet changed the title [WIP] Fix zeth helper Fix zeth helper Aug 26, 2021
Copy link
Contributor

@dtebbs dtebbs left a comment

Choose a reason for hiding this comment

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

LGTM

@AntoineRondelet AntoineRondelet merged commit 9b193b4 into develop Aug 26, 2021
@AntoineRondelet AntoineRondelet deleted the fix-zeth-helper branch October 5, 2021 14:14
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