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

[Feature]: Make simulate not require sequence number correctness #23484

Open
ValarDragon opened this issue Jan 23, 2025 · 1 comment
Open

[Feature]: Make simulate not require sequence number correctness #23484

ValarDragon opened this issue Jan 23, 2025 · 1 comment

Comments

@ValarDragon
Copy link
Contributor

Summary

Right now the simulate endpoint for determining gas amounts requires the sequence number to be correct. This is actually quite hard to use in practice, and often necessitates extra RPC calls. This is also not how the flow works in EVM for instance.

We have found this to be meaningful client overhead in RPC calls + integration pains.

We should brainstorm a way to make the simulate endpoint response return the required sequence number, and adjust the ante handler so that on simulate the sequence number is not checked.

Problem Definition

Right now integrators cannot get gas estimates without first querying for the sequence number. This has two pain points right now.

One is that submitting a tx requires 3 interactive steps.

  • Fetch sequence number
  • Simulate to get gas
  • Sign & broadcast tx

But another problem thats particularly painful is when the simulate endpoint fails due to the wrong sequence. Then you have to re-simulate to get the gas amount. Ideally we would just get the sequence number from the simulation, and use that in the final signing. This is particularly helpful. It reduces the number of error states and interactive steps needed.

Proposed Feature

Remove sequence number correctness from being needed in RunTxMode==simulate.

I haven't looked into the simulate endpoints response type yet to have an informed opinion on how easy it is to add sequence number into the response type. But that would be ideal, and could then be a minor release change?

@tac0turtle
Copy link
Member

in 52 we fixed this by allowing sequence numbers to be greater than current, i.e. simple check but then when it comes to execution you need to set the correct one. It seems this fixes the issue you have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants