delvtech / hyperdrive-rs

Rust SDK for the Hyperdrive AMM.
https://docs.rs/crate/hyperdrive-math/latest
Apache License 2.0
2 stars 0 forks source link

Updated nonce management #110

Closed jalextowle closed 5 months ago

jalextowle commented 5 months ago

Resolved Issues

Fixes: #3.

Description

This PR changes the order of the middleware stack (nonce management needs to be the outermost layer), and vendors the NonceManagerMiddleware so that some convenience functions can be added like reset_nonce and address(). The code was initially copied from ethers-rs, but I ultimately had to improve the retry logic to get the nonce manager to reliably succeed with large numbers of fuzz runs and fast fuzz runs.

Review Checklists

Please check each item before approving the pull request. While going through the checklist, it is recommended to leave comments on items that are referenced in the checklist to make sure that they are reviewed.