Closed startgeek closed 2 years ago
Hey @startgeek,
Thank you for opening up an issue 🙏
I'm pretty sure you're not doing anything wrong, it's just that Edge does some additional steps apart from the ones you've mentioned, which is very misleading.
Please check out these methods that we use for creating committed seals and proposer seals (and for recovering them!): https://github.com/0xPolygon/polygon-edge/blob/850212504d9ec2282ab65ed38f27071d33d25121/consensus/ibft/sign.go#L15-L89
I'll move this issue to a discussion since it's only Edge related in terms of an implementation that we sadly, cannot change at this point.
extra_field parameters are unknown and I cant ecrecover
Description
so this is my assumption: there is a block generated with all of its header's ready to signed and sealed and included in chain I believe there are manipulations to extra_field data before signing and sealing and after this stage a keccake256 of this half-block is used as MESSAGE for signing and verification (BTW I've done this before with BSC which is also is a POA and it worked smoothly. I don't know what I'm missing here) these are steps I took. 1.get a block (remove zeros and RLP.decode the extra_field so you get these 3 parts screenshot 1)
fields of extradata:
2.arrange fields in order shown in picture 2 (also for zero values use "0x" and convert of the decimal values to hex);
Your environment
OS and version ubuntu 20
version of the Polygon Edge tag:0.4.1
branch that causes this issue tag:0.4.1
Steps to reproduce
just run a POA polygon edge and try to recover address of sealer or signers.
Tell us how to reproduce this issue <br it's fairly generic in my case there is 9 validators which makes it 6 signers and 1 sealer and I cant recover any public address from their signatures/>
Where the issue is, if you know <br I believe its either is 1.padding 0 's or 2.maybe some fields such as blooms should be "0x" instead of real value or 3.the way extra_data field gets nested (BTW I tested all of these) />
Which commands triggered the issue, if any its not depend on any command
Expected behaviour
Actual behaviour
Logs
Proposed solution
A sudo-code or a web3.js (since its heavy standard in industry)example starting from a raw block header to signer and/or sealer public address would be awesome and worth million lines of documents