Skip to content

Commit

Permalink
cancelations/replacementUuid/revertMode for sbundles update
Browse files Browse the repository at this point in the history
  • Loading branch information
TymKh committed Aug 12, 2024
1 parent ba98fd9 commit 40e0e3d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
26 changes: 26 additions & 0 deletions docs/flashbots-mev-share/searchers/cancelling-bundles.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: Cancelling Bundles
---

import CancelBundleRpc from '@site/docs/specs/mev-share/_mev_cancelBundle.mdx'


In case original bundle contained `replacementUuid` you can cancel it using this endpoint.
Note, cancelling a bundle via replacing it with incorrect bundle with the same `replacementUuid` is not guaranteeing that
the original bundle will be cancelled.

## Cancel bundle endpoint

<CancelBundleRpc />

### Example body

```json
{"id":1,"jsonrpc":"2.0","method":"mev_cancelBundle","params":[{"replacementUuid":"123"},["beaverbuild.org","titan","rsync"]]}
```


## Builders
It is encouraged to use the same set of builders as the original bundle. This is to ensure that the bundle is cancelled correctly.
In case you omitted second argument, bundle will still be cancelled but underlying operation will be less performant.
List of builders that support bundle cancellation can be found [here](https://github.com/flashbots/dowg/blob/main/builder-registrations.json)
4 changes: 4 additions & 0 deletions docs/flashbots-mev-share/searchers/understanding-bundles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ MEV-Share bundles can share hints with searchers, which can be used to backrun t

Searchers can share hints to give other searchers information about their bundle that would allow them to be backrun. If your bundle gets backrun by another searcher, you get paid a cut of the MEV they extract!

## Revert mode
Revert mode field is optional, if set - it is preferred over `canRevert` field. Revert mode `allow` corresponds to `canRevert: true`, `fail` corresponds to `canRevert: false`.
Revert mode `drop` is preferred in most scenarios, since it allows for your tx to be dropped if it can't be included in the block, which is used to merge multiple backruns for the same bundle.

## Builders
MEV-Share bundles can be sent to multiple builders at once. This is done by setting the `builders` field in the `privacy` parameter of `mev_sendBundle`.

Expand Down
1 change: 1 addition & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ module.exports = {
'flashbots-mev-share/searchers/event-stream',
'flashbots-mev-share/searchers/understanding-bundles',
'flashbots-mev-share/searchers/sending-bundles',
'flashbots-mev-share/searchers/cancelling-bundles',
'flashbots-mev-share/searchers/debugging',
{
'Tutorials': [
Expand Down
13 changes: 13 additions & 0 deletions docs/specs/mev-share/_mev_cancelBundle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```typescript
{
jsonrpc: "2.0",
id: string | number,
method: "mev_cancelBundle",
params: [
{
replacemendUuid: string,
},
Array<string>, /* Array of builders, optional argument */
]
}
```
3 changes: 2 additions & 1 deletion docs/specs/mev-share/_mev_sendBundle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
method: "mev_sendBundle",
params: [{ /* MevSendBundleParams */
version: "v0.1",
replacementUuid?: string,
inclusion: {
block: string, // hex-encoded number
maxBlock?: string, // hex-encoded number
},
body: Array<
{ hash: string } |
{ tx: string, canRevert: boolean } |
{ tx: string, canRevert: boolean, revertMode?: "allow" | "drop" | "fail" } |
{ bundle: MevSendBundleParams }
>,
validity?: {
Expand Down

0 comments on commit 40e0e3d

Please sign in to comment.