velas / velas-chain

Other
70 stars 35 forks source link

Simulation from future should work #227

Open vldm opened 2 years ago

vldm commented 2 years ago

Currently if you try to make a pipeline like, when you simulate a lot of transaction, sign them, and then process. You will fail at first step, because current simulation and estimateGas is checking nonce, and will return error:

Error in evm processing layer: Transaction nonce 2206 differs from nonce in state 2205 
vldm commented 2 years ago

Real estimate gas is implemented in https://github.com/velas/velas-chain/blob/develop/core/src/evm_rpc_impl/mod.rs#L613 It uses RPCTransaction - json structure from client. It should persist the same.

Regular ethereum client uses evm-bridge proxy as web3 provider. So my proposition is to add new flag pipeline-nonce in Args https://github.com/velas/velas-chain/blob/develop/evm-utils/evm-bridge/src/main.rs#L835 And if this flag set modify transaction (set nonce to None) in https://github.com/velas/velas-chain/blob/develop/evm-utils/evm-bridge/src/main.rs#L709