-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
eth_getBlockByNumber should return error for null round #12633
Comments
Thanks to @eshon to alerting me to graphprotocol/graph-node#4729 (comment) It turns out that the So we just need to make sure we don't mess with that, and it also might be worth putting a note in there for that error |
I'm only realising that this comes from the fix in #10909, and before that we returned an error and I'm now advocating that we return an error. Sorry @virajbhartiya and @aarshkshah1992 I know you've been all over that issue and its fix @ #12529 but I think we need to revisit that because |
I think reverting that change is the right answer here. @virajbhartiya -> Let's just ensure that we return While it is unfortunate -> looks like this Filecoin specific behaviour wrt null rounds(ETH does not have null rounds) has now been OSSified and ETH tooling has come to depend on it. |
I'm assuming #12641 will make it in, so my updated proposal for this issue is as follows:
How does that sound? |
I think also we'll put a note in #10909 after this all done to summarise all of this and that it's a WONTFIX and instead we're returning a consistent error as the best way we can deal with this discrepancy. To date it's proven to be good enough for people to work around and we're just affirming that this is the standard that we're adopting. |
Copying in text I wrote in Slack about the true/false strictness check: I would say this: if the API is specifically about a tipset, then it should be strict; but if the API just happens to need a tipset for some other primary operation then it should be non-strict.
So, for those that aren’t strict, I think you should adjust your tests to show that they don’t error. |
eth_getBlockByNumber
uniquely handles null rounds by returning anil
response (null
via RPC), whereas all the othereth_
APIs that take a block number will return an error.go-ethereum's behaviour seems to be that
null
indicates that the number isn't available, or at least can't be found in the number<>block mapping, which sounds like it'd be the right thing for us to do for null rounds, but users take this to mean that the block isn't yet available but will become at some point if they keep on polling for it because they just got ahead of the chain.From @ilyalukyanov:
We have special handling for null rounds in this API that returns
nil
:lotus/node/impl/full/eth.go
Lines 346 to 354 in 02a8b97
We should return a consistent error for all of these cases, currently we don't. All cases of
getTipsetByBlockNumber
:EthGetBlockByNumber
: returnnil
EthFeeHistory
: return error:bad block parameter X: requested epoch was a null round
FilecoinAddressToEthAddress
:failed to get tipset for block X: requested epoch was a null round
EthTraceBlock
:failed to get tipset: requested epoch was a null round
EthTraceReplayBlockTransactions
:failed to get tipset: requested epoch was a null round
We should make these consistent.
ErrNullRound
dynamic and let it include the requested block number/string:"block number 0x1234 was a null round"
errors.Is
forErrNullRound
and return theerr
directly (orerrors.As
and return the instance?)ErrNullRound
return a nested error description, but let's make it consistent eh?The text was updated successfully, but these errors were encountered: