Skip to content

Commit a6c6e78

Browse files
authored
fix: set cancellations in optimstic v3 submissions (#777)
## πŸ“ Summary Cancellations are actually _not_ enabled by default in V3. ## βœ… I have completed the following steps: * [x] Run `make lint` * [x] Run `make test` * [ ] Added tests (if applicable)
1 parent df3bc69 commit a6c6e78

File tree

1 file changed

+6
-1
lines changed
  • crates/rbuilder/src/mev_boost

1 file changed

+6
-1
lines changed

β€Žcrates/rbuilder/src/mev_boost/mod.rsβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ impl MevBoostRelayBidSubmitter {
329329
data: HeaderSubmissionOptimisticV3,
330330
registration: ValidatorSlotData,
331331
) -> Result<(), SubmitBlockErr> {
332-
self.client.submit_optimistic_v3(&data, &registration).await
332+
self.client
333+
.submit_optimistic_v3(&data, &registration, self.cancellations)
334+
.await
333335
}
334336
}
335337

@@ -880,13 +882,16 @@ impl RelayClient {
880882
&self,
881883
request: &HeaderSubmissionOptimisticV3,
882884
registration: &ValidatorSlotData,
885+
cancellations: bool,
883886
) -> Result<(), SubmitBlockErr> {
884887
let mut headers = HeaderMap::new();
885888
self.add_auth_headers(&mut headers)
886889
.map_err(|_| SubmitBlockErr::InvalidHeader)?;
887890

888891
let mut url = self.get_base_submit_block_url(registration, &mut headers)?;
889892
url.set_path("/relay/v3/builder/headers");
893+
url.query_pairs_mut()
894+
.append_pair("cancellations", if cancellations { "1" } else { "0" });
890895

891896
let body = request.as_ssz_bytes();
892897
headers.insert(CONTENT_TYPE, HeaderValue::from_static(SSZ_CONTENT_TYPE));

0 commit comments

Comments
Β (0)