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

ethclient: missing mixHash in JSON block header #17994

Closed
lucasvo opened this issue Oct 28, 2018 · 7 comments
Closed

ethclient: missing mixHash in JSON block header #17994

lucasvo opened this issue Oct 28, 2018 · 7 comments

Comments

@lucasvo
Copy link

lucasvo commented Oct 28, 2018

Geth returns 0x0 in the mixHash field when running against Rinkeby (also POA). Parity connected to Kovan doesn't return the field at all. While you could argue that parity Kovan should be fixed, I think doing such a fix on the server is more involved than doing it on the client side. However this is a discussion that should be had.

It would be great if the go-ethereum ethclient would gracefully ignore the field not being present (i.e. treat it as a null value). I don't know if there's an easy way to distinguish between POA/POW chains and only error out when interacting with a POW chain and the field is missing.

Please also refer to the parity-ethereum issue where this is discussed: openethereum/parity-ethereum#8841

System information

Geth version: 1.8.15
OS & Version: Linux

Expected behaviour

I should be able to use ethclient to communicate with a parity node connected to the kovan POA testnet.

Actual behaviour

Geth returns 0x0 in the mixHash field when running against Rinkeby (also POA). It would be great if the go-ethereum ethclient would gracefully ignore the field not being present (i.e. treat it as a null value). I don't know if there's an easy way to distinguish between POA/POW chains and only error out when interacting with a POW chain and the field is missing.

Steps to reproduce the behaviour

Submit a transaction to a parity node connected to kovan. The implications of this bug are identical to #3230 but #3230 was due to an incompatibility of the parity client in general when this field was added to the endpoint in the first place.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 2.0 ETH (426.37 USD @ $213.18/ETH) attached to it as part of the Centrifuge fund.

@SomniaStellarum
Copy link

SomniaStellarum commented Nov 24, 2018

I have an initial commit to demonstrate this fix. It has a bug right now but it shows what the idea is at least. Here is ethclient after the changes. https://github.com/SomniaStellarum/go-ethereum/tree/ethclientFixForParity/ethclient

And here is the commit:
SomniaStellarum@88da98d

@lucasvo
Copy link
Author

lucasvo commented Nov 24, 2018

@SomniaStellarum Sounds like a good idea. Most devs are on Discord, you could try asking there: https://discord.gg/xQHFXr or look for whoever touched this code last in git-blame and get their input? I'm also asking @vedhavyas to take a look at it

@holiman
Copy link
Contributor

holiman commented Nov 26, 2018

There is already a PR which fixes this differently #18166. Please give your input if that one is sufficient to solve the problem.
Also, it's no good to make changes directly to the files called gen_xxx_json.go, because those are generated by go generate based on formatting instructions in the json definitions.

@TwinbrotherPro
Copy link

Yap this is fixing the issue. I am using the fix for my own Parity PoA and it is working fine :)

@SomniaStellarum
Copy link

I was going to reach out on discord today, but looks like Martin replied here first (thanks Martin). It looks like this issue already has a fix completed in another PR. I'll stop my work on Gitcoin for it and you can likely cancel it to recover your funds.

Also, it's good to know about the gen_xxx_json.go files. I had actually generated it directly with gencodec, but I can see now how to add the go:generate comment and how that should work. I'll know for next time.

@lucasvo lucasvo closed this as completed Nov 28, 2018
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Cancelled


The funding of 2.0 ETH (230.97 USD @ $115.48/ETH) attached to this issue has been cancelled by the bounty submitter

alexaltair added a commit to reserve-protocol/solstice that referenced this issue Dec 11, 2018
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

No branches or pull requests

5 participants