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

Carrier-tx extension #47

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Carrier-tx extension #47

wants to merge 9 commits into from

Conversation

lmanini
Copy link

@lmanini lmanini commented Aug 20, 2021

Hey all, creating my first PR for the repo: finalized the first version of the carrier-tx extension for the provider.
With these changes, users will be able to use the publish method to submit a bundle through the public mempool, which can only be decrypted by a target validator, chosen by the user.

Please note that currently:

  1. publish() only returns a Promise<TransactionResponse> for the carrier transaction: I would like for this method to also return some details about the bundle, but I'm not sure how to implement this.
  2. publish() requires the user to pass it, among other things, a potentially empty TransactionRequest to use as the carrier transaction: this object will be populated with default values if any of the following fields ['to', 'value', 'gasLimit', 'gasPrice', 'nonce'] are missing (I would love to be able to calculate the exact gasLimit for the carrier transaction, but found discording resources online noting different gas costs for every non-zero byte in a transaction's data field, anyone know what we could use?)
  3. As per the spec, the carrier's data field begins with a MEV Prefix which I have set to 0x0123 as a placeholder, until a proper prefix is agreed upon.

This extension has also been tested with a small script and I'm able to fully recreate the FlashbotsBundle passed as an argument to the publish() method. Will not include it in this PR as I feel it doesn't regard this repo, will be happy to share the script if anyone wants to try for themselves.

I'm also attaching a small file to showcase how one would use the extension.
carrierTx-demo.txt

Please let me know if any aspect of this is not clear to you, any doubts you may have, or if you would like further explanation on any aspect of this extension.

PS: all names have been selected solely by me, will gladly change them if we find better alternatives!

Copy link

@kristofgazso kristofgazso left a comment

Choose a reason for hiding this comment

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

great work so far, some things to patch up, rewrite, but overall it looks great!

the comments are a bit too verbose

src/index.ts Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
@lmanini lmanini marked this pull request as draft August 25, 2021 15:57
@lmanini lmanini marked this pull request as ready for review September 4, 2021 17:35
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