From 40e0e3d0b78cc01725c26e47881a80e55bbb05c1 Mon Sep 17 00:00:00 2001 From: Tymur Khrushchov Date: Mon, 12 Aug 2024 14:54:45 +0200 Subject: [PATCH 1/4] cancelations/replacementUuid/revertMode for sbundles update --- .../searchers/cancelling-bundles.mdx | 26 +++++++++++++++++++ .../searchers/understanding-bundles.mdx | 4 +++ docs/sidebars.js | 1 + docs/specs/mev-share/_mev_cancelBundle.mdx | 13 ++++++++++ docs/specs/mev-share/_mev_sendBundle.mdx | 3 ++- 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 docs/flashbots-mev-share/searchers/cancelling-bundles.mdx create mode 100644 docs/specs/mev-share/_mev_cancelBundle.mdx diff --git a/docs/flashbots-mev-share/searchers/cancelling-bundles.mdx b/docs/flashbots-mev-share/searchers/cancelling-bundles.mdx new file mode 100644 index 000000000..577d8f486 --- /dev/null +++ b/docs/flashbots-mev-share/searchers/cancelling-bundles.mdx @@ -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 + + + +### 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) diff --git a/docs/flashbots-mev-share/searchers/understanding-bundles.mdx b/docs/flashbots-mev-share/searchers/understanding-bundles.mdx index 74469ab88..54b527420 100644 --- a/docs/flashbots-mev-share/searchers/understanding-bundles.mdx +++ b/docs/flashbots-mev-share/searchers/understanding-bundles.mdx @@ -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`. diff --git a/docs/sidebars.js b/docs/sidebars.js index 274c93e95..c4f4cca94 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -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': [ diff --git a/docs/specs/mev-share/_mev_cancelBundle.mdx b/docs/specs/mev-share/_mev_cancelBundle.mdx new file mode 100644 index 000000000..cfccd2cbb --- /dev/null +++ b/docs/specs/mev-share/_mev_cancelBundle.mdx @@ -0,0 +1,13 @@ +```typescript +{ + jsonrpc: "2.0", + id: string | number, + method: "mev_cancelBundle", + params: [ + { + replacemendUuid: string, + }, + Array, /* Array of builders, optional argument */ + ] +} +``` diff --git a/docs/specs/mev-share/_mev_sendBundle.mdx b/docs/specs/mev-share/_mev_sendBundle.mdx index 335f599fd..59384490d 100644 --- a/docs/specs/mev-share/_mev_sendBundle.mdx +++ b/docs/specs/mev-share/_mev_sendBundle.mdx @@ -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?: { From 95efc749ba86f8a8eb7b4f3b0c5c2ec1a5c2b89b Mon Sep 17 00:00:00 2001 From: Tymur Khrushchov Date: Mon, 12 Aug 2024 16:50:50 +0200 Subject: [PATCH 2/4] update info on replacement uuid --- docs/flashbots-mev-share/searchers/understanding-bundles.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/flashbots-mev-share/searchers/understanding-bundles.mdx b/docs/flashbots-mev-share/searchers/understanding-bundles.mdx index 54b527420..59e2db54f 100644 --- a/docs/flashbots-mev-share/searchers/understanding-bundles.mdx +++ b/docs/flashbots-mev-share/searchers/understanding-bundles.mdx @@ -44,6 +44,9 @@ Revert mode `drop` is preferred in most scenarios, since it allows for your tx t ## 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`. +### Replacement uuid +If `replacementUuid` is set, only builders that support cancellations will be processed. You can check list of builders [here](https://github.com/flashbots/dowg/blob/main/builder-registrations.json) + ## Bundle composition (backrunning other bundles) With the `privacy` parameter in `mev_sendBundle` you can share select information about your bundle with other searchers, who can then use that to try to extract MEV. Should they succeed, you get paid some of the MEV they extracted! From 4a24d80f553198c70f1b57116fc9542f720527fa Mon Sep 17 00:00:00 2001 From: Tymur Khrushchov Date: Fri, 6 Sep 2024 16:55:13 +0200 Subject: [PATCH 3/4] update cancellation info --- .../advanced/bundle-cancellations.mdx | 3 +++ .../searchers/cancelling-bundles.mdx | 26 ------------------- 2 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 docs/flashbots-mev-share/searchers/cancelling-bundles.mdx diff --git a/docs/flashbots-auction/advanced/bundle-cancellations.mdx b/docs/flashbots-auction/advanced/bundle-cancellations.mdx index 2345706b3..23716e653 100644 --- a/docs/flashbots-auction/advanced/bundle-cancellations.mdx +++ b/docs/flashbots-auction/advanced/bundle-cancellations.mdx @@ -24,6 +24,7 @@ Bundles can be replaced and canceled using a unique identifier (`replacementUuid maxTimestamp, revertingTxHashes, replacementUuid, // UUIDv4 to uniquely identify submission + builders, } ] } @@ -36,6 +37,7 @@ To replace a bundle, send the new bundle via `eth_sendBundle` with the same `rep ### Canceling bundles Canceling a bundle will prevent Flashbots builders from including it on-chain. To cancel a bundle, call the [`eth_cancelBundle`](/flashbots-auction/advanced/rpc-endpoint#eth_cancelbundle) endpoint, or use the `cancelBundle` function in your preferred [Flashbots library](/flashbots-auction/libraries/bundle-relay). +It is important to use the same set of builders as the original bundle submission to achieve a successful cancellation. ```json { @@ -45,6 +47,7 @@ Canceling a bundle will prevent Flashbots builders from including it on-chain. T "params": [ { replacementUuid, // UUIDv4 to uniquely identify submission + builders, } ] } diff --git a/docs/flashbots-mev-share/searchers/cancelling-bundles.mdx b/docs/flashbots-mev-share/searchers/cancelling-bundles.mdx deleted file mode 100644 index 577d8f486..000000000 --- a/docs/flashbots-mev-share/searchers/cancelling-bundles.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -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 - - - -### 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) From ef0eab1cca00dc07400dccb9609a687660313fd5 Mon Sep 17 00:00:00 2001 From: Tymur Khrushchov Date: Fri, 6 Sep 2024 16:57:08 +0200 Subject: [PATCH 4/4] clean up --- docs/sidebars.js | 1 - docs/specs/mev-share/_mev_cancelBundle.mdx | 13 ------------- 2 files changed, 14 deletions(-) delete mode 100644 docs/specs/mev-share/_mev_cancelBundle.mdx diff --git a/docs/sidebars.js b/docs/sidebars.js index c4f4cca94..274c93e95 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -128,7 +128,6 @@ 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': [ diff --git a/docs/specs/mev-share/_mev_cancelBundle.mdx b/docs/specs/mev-share/_mev_cancelBundle.mdx deleted file mode 100644 index cfccd2cbb..000000000 --- a/docs/specs/mev-share/_mev_cancelBundle.mdx +++ /dev/null @@ -1,13 +0,0 @@ -```typescript -{ - jsonrpc: "2.0", - id: string | number, - method: "mev_cancelBundle", - params: [ - { - replacemendUuid: string, - }, - Array, /* Array of builders, optional argument */ - ] -} -```