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

[Feature] Add nonce filler layer #275

Closed
onbjerg opened this issue Mar 11, 2024 · 0 comments · Fixed by #276
Closed

[Feature] Add nonce filler layer #275

onbjerg opened this issue Mar 11, 2024 · 0 comments · Fixed by #276
Assignees
Labels
enhancement New feature or request

Comments

@onbjerg
Copy link
Member

onbjerg commented Mar 11, 2024

Component

providers, pubsub

Describe the feature you would like

Add a NonceLayer (need a better name) like SignerLayer that queries, using the provider, the latest appropriate nonce for a N::TransactionRequest and fills it if it is missing.

Some notes:

  1. This layer would need to be layered on before the SignerLayer (i.e. the request goes through NonceLayer -> SignerLayer -> RootProvider)
  2. Take note that transactions might be sent concurrently on the same provider, so this needs to be taken into account (see e.g. the atomics usage in ethers: https://docs.rs/ethers-middleware/2.0.14/src/ethers_middleware/nonce_manager.rs.html#10-16)
  3. Ideally the layer would work for multiple addresses (i.e. no need to specify an address in NonceLayer like we did for NonceManagerMiddleware in ethers)

Additional context

No response

@onbjerg onbjerg added the enhancement New feature or request label Mar 11, 2024
@onbjerg onbjerg self-assigned this Mar 12, 2024
@onbjerg onbjerg mentioned this issue Mar 12, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant