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

[bug][rpc] querying unconfirmed transactions fails #930

Open
0xBigBoss opened this issue Jul 23, 2023 · 3 comments
Open

[bug][rpc] querying unconfirmed transactions fails #930

0xBigBoss opened this issue Jul 23, 2023 · 3 comments
Assignees
Labels
bug Something isn't working - expected behaviour is incorrect client work needed to interface with the node (rpc, cli, etc..)

Comments

@0xBigBoss
Copy link
Member

Querying unconfirmed transactions fail currently due to sharing logic with the indexed transaction. The RPC fails with 500 server code anytime a transaction is in the mempool and you attempt to query it.

The error it fails with is the transaction is not committed

if errors.Is(err, badger.ErrKeyNotFound) {
return nil, coreTypes.ErrTransactionNotCommitted()
}

See https://github.com/pokt-network/pocket/compare/0xbigboss/bug/query-mempool-error for it failing with the e2e tests.

root@dev-cli-client-565546545b-kjbkg:~# p1 query unconfirmedtxs
{"level":"debug","time":"2023-07-23T19:17:54Z","message":"Debug keybase initializing... Restoring from the embedded backup file..."}
❌ RPC reporting unhealthy status HTTP 500 @ http://pocket-validators:50832

CODE: 135, ERROR: the transaction is not committedError: RPC reporting unhealthy status HTTP 500 @ http://pocket-validators:50832
@0xBigBoss 0xBigBoss added bug Something isn't working - expected behaviour is incorrect client work needed to interface with the node (rpc, cli, etc..) labels Jul 23, 2023
@Olshansk
Copy link
Member

@0xBigBoss We'll take a look if someone can pick this up in the next iteration.

CC @dylanlott for context

@h5law
Copy link
Contributor

h5law commented Jul 25, 2023

@0xBigBoss I think this was introduced in #771 https://github.com/pokt-network/pocket/pull/771/files#diff-659e102b74cf8cae4db311100e475bee88ba1be6dd7b450c1e060dfee2fb3761R371

What is going on is that the unconfirmed transactions by nature are not indexed but we are now looking for them in the TxIndexer which only hold the txs that have already left the mempool.

My best guess would be to revert these changes if possible.

@dylanlott dylanlott self-assigned this Jul 25, 2023
@Olshansk
Copy link
Member

My best guess would be to revert these changes if possible.

Let's leave the change as is (it's old and the coebase has evolved a lot since then).

@dylanlott will look into this and would be a good opportunity to add a test for it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working - expected behaviour is incorrect client work needed to interface with the node (rpc, cli, etc..)
Projects
Status: Up Next
Development

No branches or pull requests

4 participants