-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix ViemClient to support concurrent transactions #1266
Comments
Nonce Issue For context my team runs searchers across various evm chains. Gas Issue Your gas pricing is likely occurring due to two reasons:
My team has largely solved this with custom node implementations. |
Curious why this requires a custom node implementation. Is this a forked L2 EL that provides RPC methods for accurate gas estimation? |
Nonce/state Gas issue You can tell if there estimation issues if you estimate gas or generate an access list, then define your gasLimit as a fixed ratio of estimate gas usage (e.g. gasUsed/0.9). Your total gas used should be 90% in that case and if it differs, something is wrong esp for something simple like transfers. This presumes you can consistently hit next block. Why does next block matter? Because that’s the most relevant state you’re working with - your gas params should in theory be deterministic. An experiment to run would be attempt to land transactions on specific blocks. You’ll find that you can’t do it consistently with node providers even if you bid crazy gas - it’s due to latency and/or bad l1 few estimates. The latency issue exacerbates everything. In summary, what you’re getting is potentially incorrect but also behind out the gate and may be even further behind due to bad infra. First step run your own nodes. Then either a custom rpc endpoint (heavy on infra costs though to scale) or the way we do it which is directly accessing state from the backend db the node writes to and load it into an evm implementation. You can achieve scale with the latter solution if architected correctly, as you won’t bog down your node. |
Summary
Under load / many people trying to sign up or transact simultaneously, there's contention for the next nonce.
This has resulted in production downtime.
Proposed fix
Two options, not mutually exclusive:
In either case (= even with multiple EOAs each submitting at most one tx per block, no pending stacked nonces), we will sometimes have transactions fail without reverting during gas price spikes and sequencer issues.
In that case, we must retry the same nonce.
Open question: what is the exact condition where the sequencer returns
replacement transaction underpriced
?The text was updated successfully, but these errors were encountered: