You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent race condition in nonce synchronization
Implemented atomic Lua script for syncLatestNonceFromOnchain to prevent
race conditions when multiple concurrent calls attempt to sync the same
wallet's nonce.
The function had a TODO comment acknowledging the need for Redis locking.
This fix uses an atomic Lua script execution to ensure thread-safety.
Impact:
- Eliminates nonce corruption from concurrent syncs
- Prevents transaction failures due to incorrect nonce values
- Critical for high-throughput wallet operations
- Resolves long-standing TODO item
Technical Details:
- Uses Redis EVAL for atomic operation
- Ensures single nonce write per execution
- Safe for concurrent access patterns
0 commit comments