cosmos / ethermint

Ethermint is a scalable and interoperable Ethereum, built on Proof-of-Stake with fast-finality using the Cosmos SDK.
https://ethermint.dev/
Apache License 2.0
412 stars 161 forks source link

The txhash published from PendingTransactionsSubscription websocket are all already committed in the block #833

Closed banishee closed 3 years ago

banishee commented 3 years ago

System info: [Include Ethermint commit, operating system name, and other relevant details] the development branch

Steps to reproduce:

  1. [First Step] start a websocket client, then send transcations on a local node
    
    $ wscat -c ws://127.0.0.1:8546
    > {"id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}
    < {"jsonrpc":"2.0","result":"0x9789a5feaffc47d2669be4b79fd03e21","id":1}

< {"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0x9789a5feaffc47d2669be4b79fd03e21","result":"0x492660be45ab6cbb88c416620b38b77c874a0321d5f7db8c035ee42179251d56"}}


2. [Second Step]
However, I noticed that every txhash that the ws-client received is already being committed in the block.

__Expected behavior:__ [What you expected to happen]
The `eth_subscribe` method with params `newPendingTransactions` should return the list of tx from mempool, not committed block.

__Actual behavior:__ [What actually happened]
 In `tendermint@v0.39.3` , https://github.com/tendermint/tendermint/blob/94ea3c83a8cfa63c8cd7502dd581b552e81dbf23/state/execution.go#L470
the `eventBus` only iterates the `block.Data.Txs`, then publishes them

__Additional info:__ [Include gist of relevant config, logs, etc.]
freddyli7 commented 3 years ago

can you please try to start a node with pending mode

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.