zeth icon indicating copy to clipboard operation
zeth copied to clipboard

Enable Zeth tx caching and GWEI target in Wallet CLI

Open AntoineRondelet opened this issue 4 years ago • 1 comments

It can be helpful for users to generate a Zeth transaction payload, cache it locally (can be persisted on file for ease at first), and fire the actual transaction later. In fact, this would allow to target specific gas price to fire the transaction on the network. As we know that the number of txs in the tx pool varies (demand for block space varies), the cost of transacting on the target system isn't always the same. Gas price fluctuates (even after EIP1559 on Eth. mainnet) and thus it may be helpful for users to generate the zeth tx payload (the commitments, zkp etc), cache it locally, and fire the tx when gas price drops. This can also be automated by adding some logic in the wallet, e.g. zeth mix --out <your-options> --gwei 120. Th tx payload can now be generated (without fireing the tx by using the --dry-run flag). We then need to persist this into a file (or cache it) and fire it again on the network either on user input (in which case we need to add a list of ready to be submitted transaction to the wallet state) or automatically when the gas price follows below a target threshold (i.e. see the --gwei flag above). This can be helpful for users who want to pay a target gas price while willing to minimize the time their transactions spend in the transaction pool, all without needing to monitor transaction pools and services like: https://www.gasnow.org/ (soon to be deprecated) or https://ethgasstation.info/.

AntoineRondelet avatar Oct 05 '21 14:10 AntoineRondelet

Th tx payload can now be generated (without fireing the tx by using the --dry-run flag). We then need to persist this into a file (or cache it).

I think this part is already available via the --dump-parameters flag (which is how we generate zeth transactions to later be passed to zecale). The deserialization of that data (the parameters to be passed to the contract) is also implemented, just not exposed via the CLI AFAICT.

dtebbs avatar Oct 07 '21 10:10 dtebbs