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

Block miner hash value always 0x0 in eth_getBlockBy* jsonrpc response #112

Closed
dankostiuk opened this issue Aug 4, 2021 · 1 comment
Closed
Assignees

Comments

@dankostiuk
Copy link
Contributor

Block miner hash value always 0x0 in eth_getBlockBy* jsonrpc response

Description

According to https://eth.wiki/json-rpc/API#eth_getBlockByHash, the miner hash should be "the address of the beneficiary to whom the mining rewards were given" (or the address of the block's validator).

Using either the dev or server command - and tested on both eth_getBlockByNumber and eth_getBlockByHash, I always see the miner value being:

0x0000000000000000000000000000000000000000

I expect the miner value to be one of the validator's addresses.

Your environment

  • OS and version OSX 11.4
  • version of the Polygon SDK ad7b97e
  • branch that causes this issue develop

Steps to reproduce

  1. Set up 4 nodes, each running ./main server... and ensure all 4 nodes have visibility of eachother:
2021-08-03T23:54:36.390Z [INFO]  polygon.consensus.ibft.acceptState: Accept state: sequence=25530
2021-08-03T23:54:36.390Z [INFO]  polygon.consensus.ibft: current snapshot: validators=4 votes=0
2021-08-03T23:54:36.390Z [INFO]  polygon.consensus.ibft: proposer calculated: proposer=0x40dd53141a759efd606a13d3e8a7c0aa005faf35 block=25530
  1. Send HTTP request {"id":1,"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", true]}
  2. Observe that the miner of the JSON-RPC response object is always:
"miner":"0x0000000000000000000000000000000000000000"

Expected behaviour

I expect the miner value to be one of the validator's addresses. In my example above running 4 validators, I expect the miner hash to be the address of one of those 4 validators.

Actual behaviour

I always see the HTTP response containing:

"miner":"0x0000000000000000000000000000000000000000"

which makes it difficult to determine who mined the block.

@lazartravica lazartravica self-assigned this Aug 6, 2021
@lazartravica
Copy link
Contributor

lazartravica commented Aug 13, 2021

@dankostiuk The consensus used currently in polygon-sdk is IBFT, which is implemented according to ethereum/EIPs#650 which in turn builds upon the voting mechanism explained in Clique PoA: ethereum/EIPs#225

Looking at the EIP-225 (Clique PoA), this is the relevant part that explains what the miner (aka beneficiary) is used for:

We repurpose the ethash header fields as follows:

    beneficiary: Address to propose modifying the list of authorized signers with.
        Should be filled with zeroes normally, modified only while voting.
        Arbitrary values are permitted nonetheless (even meaningless ones such as voting out non signers) to avoid extra complexity in implementations around voting mechanics.
        Must be filled with zeroes on checkpoint (i.e. epoch transition) blocks.

thus, you can see that the miner field is used for proposing a vote for a certain address, not to show the proposer of the block.

The information about the proposer of the block can be found by recovering the pubkey from the Seal field of the RLP encoded Istanbul extra data field in the block headers.

goran-ethernal pushed a commit that referenced this issue Apr 11, 2024
…ng logic (#112)

* Introduce ECDSAKey and decouple from ethgo transactions signing logic

* Fix panic in e2e test(s)

* Fix checkpoint manager unit tests

* Try to fix extract signature failure

* Change signature of sign callback function

* Use the latest signer in the tx relayer

* Minor fixes

* Fix panic when unsigned transaction is sent to txrelayer

* Instantiate LondonOrBerlin signer in the TestCluster.SendTxn

* Minor change

* Lint fix

* Build fixes

* Add log to tx pool

* Typo fix and small simplification

* Build fix

* callback function fix

* rebase fixes

* lint fix

* fixes for e2e

* migration test fix

* transactionWithHeaderInstructions fix

* Fix linters

* Fix linter (uncapitalize param name)

* Remove debug log

* Adapt the unit test

* Merge fix

* Fix TestE2E_JsonRPC_NewEthClient

* Lint fix

* comment fix

* lint fix

* test fix

* one more transaction contructor

---------

Co-authored-by: Dusan Nosovic <[email protected]>
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

2 participants