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

fix: use eth_getTransactionCount(pending) to get nonce #1194

Merged
merged 6 commits into from
Nov 7, 2024
Merged

Conversation

karlem
Copy link
Contributor

@karlem karlem commented Nov 5, 2024

Close #1195

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:

Fix by setting the transaction block to pending, which makes the get_transaction_count method use the pending parameter, aligning it with Filecoin's expectations.

@karlem karlem requested a review from a team as a code owner November 5, 2024 20:48
@karlem karlem changed the title Fix nonce issue fix: Handling Filecoin Network Nonce Error with Custom Middleware Nov 5, 2024
@karlem karlem changed the title fix: Handling Filecoin Network Nonce Error with Custom Middleware fix: Filecoin Network Nonce Error with Custom Middleware Nov 5, 2024
@karlem karlem added the bug Something isn't working label Nov 5, 2024
@karlem karlem changed the title fix: Filecoin Network Nonce Error with Custom Middleware fix: filecoin network nonce error Nov 5, 2024
@3benbox
Copy link

3benbox commented Nov 6, 2024

fwiw, this fix worked for both cross-msg fund-with-token and ipc-cli checkpoint relayer nonce issues we've been seeing on calibration. 🎉

@raulk raulk changed the title fix: filecoin network nonce error fix: use eth_getTransactionCount(pending) to get nonce Nov 7, 2024
Copy link
Contributor

@raulk raulk left a comment

Choose a reason for hiding this comment

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

Clippy fails, but we're fixing that elsewhere, so good with merging this.

@raulk raulk merged commit 1388cd2 into main Nov 7, 2024
15 of 16 checks passed
@raulk raulk deleted the fix-nonce-issue branch November 7, 2024 10:04
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 this pull request may close these issues.

Handling Filecoin Network Nonce Error with Custom Middleware
3 participants