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

protect: Add "Nonce Management" page to document eth_getTransactionCount behavior. #573

Merged
merged 5 commits into from
Sep 13, 2024

Conversation

ryanschneider
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flashbots-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 4:43pm

@ryanschneider ryanschneider changed the title protect: Add documentation on eth_getTransactionCount behavior. protect: Add "Nonce Management" page to document eth_getTransactionCount behavior. Sep 13, 2024
### Authentication

To authenticate your request, Flashbots endpoints require you to sign the payload and include the signed payload in the `X-Flashbots-Signature` header of your request.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We might want to (instead, or in addition) link directly to the authentication section in our API docs https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint#authentication.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that, but that section is relay-specific so includes some wording such as:

Any valid ECDSA-secp256k1 key, like an arbitrary Ethereum key, can be used to sign the payload. The address associated with this key will be used by Flashbots to keep track of your reputation over time and provide user statistics. You can change the key you use at any time.

That conflicts with the usage here.

Normally, a wallet can call `eth_getTransactionCount` to get the next nonce to use for a transaction.
However, since transactions sent to Flashbots Protect are potentially sensitive, even exposing the incremented nonce can leak information about the user's activity.

As such, Flashbots Protect requires that all requests to `eth_getTransactionCount` be signed by the user when querying the `"pending"` nonce.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I might specify that if the request is signed, the response will include pending private transactions in the tx count. If the request is unsigned, the response will only include pending public transactions. (Falls back to the default behavior).

Right now it sounds like you can't even get a response if you don't sign the request which isn't 100% true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup good call, will update!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated! I'll re-read it again for clarity tomorrow morning then merge.

Copy link
Collaborator

@sketsdever sketsdever left a comment

Choose a reason for hiding this comment

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

Two small comments, otherwise lgtm!

@ryanschneider ryanschneider marked this pull request as ready for review September 13, 2024 16:02
@ryanschneider ryanschneider force-pushed the protect-eth_getTransactionCount branch from ad09730 to e99813f Compare September 13, 2024 16:14
@ryanschneider ryanschneider merged commit 18fabdd into main Sep 13, 2024
3 checks passed
@ryanschneider ryanschneider deleted the protect-eth_getTransactionCount branch September 13, 2024 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants