aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Feature Request] Allow transaction simulation for transaction with higher nonce

Open JackyWYX opened this issue 3 years ago • 2 comments

🚀 Feature Request

Currently, simulating a transaction with high nonce will return a vm_status:

vm_status: 'Transaction Executed and Committed with Error SEQUENCE_NUMBER_TOO_NEW',

We would request to allow simulation result to be displayed for higher sequence number.

Motivation

There is some uses cases that will need to simulate a transaction with a higher nonce, For example, for multi-sig wallet. It is expected that there are multiple pending transactions in the transaction queue. Without simulation for transaction for higher nonce, the max gas is not able to be obtained for future transactions.

Pitch

Allow simulation for transaction nonce is higher. Increase the sequence number with test only native function in MOVE virtual machine.

JackyWYX avatar Oct 15 '22 12:10 JackyWYX

This gets tricky... because what you want is fine grained simulation support. Specifically in this case, we have a move prologue that validates gas and sequence number and an epilogue that bumps sequence number and gas. We cannot skip these without devaluing the process. It is also not particularly cost effective for transactions to split these for fine grained simulation.

Might I ask why you want this feature outside of ... the error sucks?

davidiw avatar Oct 15 '22 18:10 davidiw

What we want is just gasUsed in simulation so that we may better estimate the max gas. We understand that execution of lower sn transaction will impact higher sn transactions. But is there a work around?

JackyWYX avatar Oct 15 '22 19:10 JackyWYX

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

github-actions[bot] avatar Dec 23 '22 01:12 github-actions[bot]

Let me merge this into another issue on improving simulation. https://github.com/aptos-labs/aptos-core/issues/5928

davidiw avatar Dec 24 '22 05:12 davidiw