Cosmos-sdk: CheckTx: Support ReCheck

Created on 20 Aug 2019  ·  6Comments  ·  Source: cosmos/cosmos-sdk

Tendermint's ABCI CheckTx now supports an enum Type field. The SDK should support and utilize this Type field, namely when the type is CheckTx_Recheck. In such a case, we should avoid (re)verifying the signature. Maybe there are other branches of logic we can avoid too.

/cc @AdityaSripal @ValarDragon


For Admin Use

  • [x] Not duplicate issue
  • [x] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
baseapp

Most helpful comment

I think dynamic minimum fee changes based on market conditions should be anticipated. We don't see this because the chain has low tx volume.

All 6 comments

From what I understand, skipping signature verification already gives us most of the efficiency gains.

But other branches I think we can avoid:

  • Checking Sufficient Mempool fees
  • tx.ValidateBasic

I believe Antehandler helper functions also need to be refactored. Since params might change in between 2 CheckTx's of the same tx, we should check that a tx still has enough gas to pay for signature verification without verifying the signatures themselves.

Yeah, skipping ValidateBasic will offer some improvements, albeit small. But fee checking...what if the validator (somehow) changes their min fee between Commit and the next CheckTx for a given tx?

Is that possible without restarting the node?

I think dynamic minimum fee changes based on market conditions should be anticipated. We don't see this because the chain has low tx volume.

I believe I can get this done as part of #5006

Let's keep it as a separate PR @AdityaSripal for ease of review 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevlubkcm picture kevlubkcm  ·  3Comments

rigelrozanski picture rigelrozanski  ·  3Comments

ValarDragon picture ValarDragon  ·  3Comments

rigelrozanski picture rigelrozanski  ·  3Comments

faboweb picture faboweb  ·  3Comments