Skip to content

Conversation

@arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Jan 25, 2025

PR-Codex overview

This PR introduces enhancements to nonce management in the wallet system, including the addition of a nonce history tracking feature and adjustments to the backend wallet nonce reset functionality.

Detailed summary

  • Added nonceHistoryKey function to track onchain vs sent nonces.
  • Updated deleteNoncesForBackendWallets to include nonce history key.
  • Modified resetBackendWalletNoncesRoute to include syncOnchainNonces parameter.
  • Changed variable name RESYNC_BATCH_SIZE to BATCH_SIZE.
  • Conditional resync of nonces based on syncOnchainNonces flag.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

/**
* Stores a list of onchain vs sent nonces to check if the nonce is stuck over time.
*/
export function nonceHistoryKey(chainId: number, walletAddress: Address) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just swapping the args to match the patterns of the others

lastUsedNonceKey(chainId, walletAddress),
recycledNoncesKey(chainId, walletAddress),
sentNoncesKey(chainId, walletAddress),
nonceHistoryKey(chainId, walletAddress),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also delete nonce history when we reset nonces.

@arcoraven arcoraven merged commit b468f5d into main Jan 25, 2025
6 checks passed
@arcoraven arcoraven deleted the ph/deleteNonceWithoutResync branch January 25, 2025 03:45
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.

2 participants