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

Nonce management #1771

Merged
merged 13 commits into from
Dec 11, 2024
Merged

Nonce management #1771

merged 13 commits into from
Dec 11, 2024

Conversation

jinchung
Copy link
Member

@jinchung jinchung commented Nov 22, 2024

Fixes BX-1724
Fixes BX-1720

Related to: https://github.com/rainbow-me/rainbow/pull/6277/files

What changed (plus any additional context for devs)

  • Add a placeholder in networks config for per-network configuration for private mempool timeout (default is 2 mins)
  • Populate timestamp param on new txns to keep it up to date when a txn is submitted or re-submitted (speed up/ cancel)
  • Update the nonce management logic as per specification (link in Linear ticket)
  • Add support for a batchedProvider from ethers v5 to submit the pending and latest txCount requests together

Screen recordings / screenshots

TODO

What to test

Mix of private mempool and public mempool transactions

@jinchung jinchung requested review from derHowie and BrodyHughes and removed request for BrodyHughes December 3, 2024 04:37
Copy link

linear bot commented Dec 3, 2024

@jinchung jinchung marked this pull request as ready for review December 3, 2024 04:38
Copy link

linear bot commented Dec 9, 2024

Copy link
Member

@derHowie derHowie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.

I fired off several transactions. Some initiated in bx, some via dapp requests, and purposely sent transactions in bx while local nonce was out of sync with public nonce. Nice work!

@jinchung jinchung requested a review from BrodyHughes December 10, 2024 17:47
Copy link
Member

@BrodyHughes BrodyHughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA DONE!

Swaps:

  • mainnet: ✅
    • ERC20 > Eth: ✅
    • Wrap: ✅

Modifying Txns:

  • Speed up a txn: ✅
  • Cancel a txn: ✅

Sends:

  • mainnet: ✅

Edge cases:

  • Swaps in quick succession that both need approves: (had insufficient gas to test this flow. Will try to catch it on release regression. Jin said she is comfortable merging.)
  • Approve + Swap: ✅
  • Send + Swap alternating: ✅

@jinchung jinchung merged commit e92bf2a into master Dec 11, 2024
14 checks passed
@jinchung jinchung deleted the @jin/nonce-mgmt branch December 11, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants