-
Notifications
You must be signed in to change notification settings - Fork 562
filter non eth txs in block rpc response #741
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good -- it may be worth checking other Web3 methods though.
e.g. eth_getBlockTransactionCountByNumber
is still returning an incorrect number of Ethereum txs (thanks @calvinaco for testing this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK. Pending @tomtau comments to be resolved
Took @thomas-nguy additions on crypto's branch to cover the remaining endpoitns. Should be good now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to define the assumptions for the index queries, are we assuming the index always corresponds to an ethereum tx? or does it include the other cosmos txs in the block and we should return an error if the tx is not an Ethereum one?
@@ -721,7 +714,8 @@ func (e *PublicAPI) GetTransactionByBlockNumberAndIndex(blockNum rpctypes.BlockN | |||
} | |||
|
|||
i := int(idx) | |||
if i >= len(resBlock.Block.Txs) { | |||
ethMsgs := e.getEthereumMsgFromTendermintBlock(resBlock) | |||
if i >= len(ethMsgs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L723 (txBz := resBlock.Block.Txs[i]
) is inconsistent with the L685. See comment about assuming the index corresponds to an ethereum tx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 723-730 needs to be removed @crypto-facs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! If we agree this #741 (comment) is the right approach to handle index across the endpoints I will add the filter here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see prev comments
Co-authored-by: Federico Kunze Küllmer <[email protected]>
…nto filter-block-txs
Hey guys so I am seeing another issue. At the moment the index returned by the It might be wise to work on the integratoin tests and have them check this scenarios before we move forward with this. Because there are many scenarios to cover. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks all right -- backend.go just needs to be formatted with gofumpt
I assume the solidity test failing is unrelated: https://github.com/tharsis/ethermint/runs/4219178563?check_suite_focus=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pending minor comments and lint fixes
Co-authored-by: Federico Kunze Küllmer <[email protected]>
…nto filter-block-txs
Co-authored-by: Federico Kunze Küllmer <[email protected]>
Closes: #705
Description
Right now there is an inconsistency between
eth_getBlockByNumber
and other RPC endpoints such useth_getTransactionReceipt
oreth_transactionByHashAndIndex
.Get block is returning non EVM txs that can not be found on other endpoints causing web3 tools to experience unexpected failures. This PR ensures there is consistency between the endpoints.
For contributor use:
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerFor admin use:
WIP
,R4R
,docs
, etc)