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

Cronos Chain disallows to replace transaction #423

Open
ghost opened this issue Apr 8, 2022 · 5 comments
Open

Cronos Chain disallows to replace transaction #423

ghost opened this issue Apr 8, 2022 · 5 comments
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Apr 8, 2022

Describe the bug
Cronos chain disallows to replace transaction

To Reproduce
Steps to reproduce the behavior:

  1. Send transaction with low gas price (simulate stuck)
  2. Try to send a transaction with the same nonce and higher gas price (speed up)

Expected behavior
A transaction must be accepted

Additional context
Error message from node ran with --trace flag:

{"jsonrpc":"2.0","id":1222,"error":{"code":-32000,"message":" --- at /go/pkg/mod/github.com/crypto-org-chain/[email protected]/app/ante/eth.go:222 (EthNonceVerificationDecorator.AnteHandle) ---\\nCaused by: invalid nonce; got 1688, expected 1689: invalid sequence"}}
@JayT106 JayT106 added the enhancement New feature or request label Apr 8, 2022
@JayT106
Copy link
Collaborator

JayT106 commented Apr 8, 2022

The current dependency - Cosmos SDK v0.44.x is using Tendermint v0.34.14 doesn't support the priority mempool yet, the current mempool is FIFO. Therefore, require the upstream project to release v0.46.x for supporting this feature.

@JayT106 JayT106 added the dependencies Pull requests that update a dependency file label Apr 8, 2022
@yihuang
Copy link
Collaborator

yihuang commented May 19, 2022

The current dependency - Cosmos SDK v0.44.x is using Tendermint v0.34.14 doesn't support the priority mempool yet, the current mempool is FIFO. Therefore, require the upstream project to release v0.46.x for supporting this feature.

I think even with tendermint 0.35, we still don't have the replace feature, right?
In ethereum one can replace a tx in the mempool with the same nonce, to update the gas price for example.

@JayT106
Copy link
Collaborator

JayT106 commented May 19, 2022

If we update the gas price in the transaction, It will affect the txhash, right? So I guess what happens is the updated transaction will be executed first (if the App applied higher tx priority), and the original transaction should be rejected later (from the app).
In tendermint's mempool design, it doesn't care about the gas price and nonce. So the logic should be handled on the App side.

But I need to check what happens if two txs have been proposed in the same block.

@JayT106
Copy link
Collaborator

JayT106 commented May 19, 2022

So, for the replace transaction, it requires ABCI++ PrepareProposal to support it. So the App can drop the original transaction when the block has 2 transactions everything is the same except the gas price.

In TM 0.35, the best tx processing will be if 2 transactions are proposed in the same block, the one that has a higher priority will succeed and the other one will be failed. And if one transaction has been executed first, so the App can drop another one in the mempool when calling reCheckTx (this mempool config need to be setup true)

@yihuang
Copy link
Collaborator

yihuang commented Sep 28, 2022

let's wait for the new mempool implementation in cosmos-sdk: cosmos/cosmos-sdk#13262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants