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

Handling Filecoin Network Nonce Error with Custom Middleware #1195

Closed
karlem opened this issue Nov 5, 2024 · 0 comments · Fixed by #1194
Closed

Handling Filecoin Network Nonce Error with Custom Middleware #1195

karlem opened this issue Nov 5, 2024 · 0 comments · Fixed by #1194
Assignees
Labels
bug Something isn't working

Comments

@karlem
Copy link
Contributor

karlem commented Nov 5, 2024

Issue:

When interacting with the Filecoin Calibration network using ipc-cli, transactions often fail with the error: message: minimum expected nonce is 63, got 62. This typically occurs when sending two consecutive transactions.

Cause:

The error is caused by Filecoin changing the behavior of the eth_getTransactionCount endpoint. To get the correct latest nonce, the "pending" block parameter must now be specified: Relevant Lotus PR.

Solution:

ethers-rs currently does not provide a built-in way to set the "pending" parameter for nonce fetching. The recommended workaround is to implement a custom middleware that explicitly sets the "pending" parameter when fetching the nonce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant