-
Notifications
You must be signed in to change notification settings - Fork 21
feat: adds execution enforcement to preconfirmations #161
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
Conversation
|
Relates to the Bid Expression discussion occurring here. |
9000c96 to
1ad9a07
Compare
| type EthClient interface { | ||
| BlockNumber(ctx context.Context) (uint64, error) | ||
| HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) | ||
| BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required? This interface is a subset of the methods of the EthClient. We dont use the BlockByNumber in this pkg. You can still pass your retry client to this pkg even after removing this.
aloknerurkar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the nitpicks, things LGTM! Before checking in just fix the 2 comments.
- Remove the additional method from the EthClient interface
- Add check for errorCode == 429 everywhere in the retry logic.
fb1c4ae to
30b909c
Compare
011fb9d to
a220daa
Compare
Motivation
Preconfirmations can trivially be satisfied by most block builders by placing the transactions at the bottom of the block. This is known as an inclusion preconfirmation. However, most preconfirmations are meant for contested state, like doing cex-dex arbitrage to bring the price an on-chain DEX or AMM into parity with the external world. In such cases, it's important to ensure the provider doesn't simply include the preconfirmation, but also ensures its successful execution.
Implementation Details
We alter the data stored in our LRU cache to also keep track of the status of the transaction (success v.s failure). We subsequently continue our preconfirmation validation as normal, with the additional check of successful execution before the disbursement of rewards.
Roadmap and relevance
This is not a required check, as builders generally provide revert protection. This one of two PRs in this theme, that will introduce a bid expression where parties to can dictate which transactions are required to succeed and which ones can revert. The subsequent PR will deal with adding support for bid expressions, along with the first bid expression being the ability to specify which transactions in a bundle are ok to revert.