You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Geth
Version: 1.10.2-unstable
Git Commit: 91726e8aadeebc4bda8f136aebf4b5c7da8b9d74
Git Commit Date: 20210316
Architecture: amd64
Go Version: go1.16
Operating System: linux
GOPATH=/home/ia/go
GOROOT=/home/ia/go1.16.linux-amd64
Expected behaviour
ethclient.Client#HeaderByNumber(-1) returns a pending block header equivalent to the value returned by an external RPC call, eg. eth_getBlockByNumber("pending", false).
Actual behaviour
This method returns an error and an almost-empty header.
Error returned is: missing required field 'miner' for Header", want %!q(<nil>), though this will not be the only issue since the types.Header JSON unmarshaling methods are not able to handle consensus-invalid headers.
Below, a JSON-encoded example of the response.
meowsbits
changed the title
ethclient.Client#HeaderByNumber returns invalid header for pending block
ethclient.Client#HeaderByNumber fails for pending block
Mar 17, 2021
System information
Geth version:
Expected behaviour
ethclient.Client#HeaderByNumber(-1)
returns apending
block header equivalent to the value returned by an external RPC call, eg.eth_getBlockByNumber("pending", false)
.Actual behaviour
This method returns an error and an almost-empty header.
Error returned is:
missing required field 'miner' for Header", want %!q(<nil>)
, though this will not be the only issue since thetypes.Header
JSON unmarshaling methods are not able to handle consensus-invalid headers.Below, a JSON-encoded example of the response.
Steps to reproduce the behaviour
I've created a branch (and an adhoc PR) with additional
ethclient
tests demonstrating the issue here: #22515.The text was updated successfully, but these errors were encountered: