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

feat(rpc): add cancellations param to submit_block rpc #131

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

PatStiles
Copy link

@PatStiles PatStiles commented Sep 13, 2023

Closes #114

Copy link
Owner

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

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

not sure why we went w/ String for type of cancellation signal

Copy link
Owner

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

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

moving in the right direction!

let path = format!("/relay/v1/builder/blocks");
let target = self.api.endpoint.join(&path).map_err(ApiError::from)?;
let mut request = self.api.http.post(target).json(signed_submission);
if with_cancellations { request = request.query(&[("cancellations", with_cancellations)]) };
Copy link
Owner

Choose a reason for hiding this comment

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

see above comment

@@ -24,10 +24,11 @@ async fn handle_get_proposal_schedule<R: BlindedBlockRelayer>(

async fn handle_submit_bid<R: BlindedBlockRelayer>(
State(relayer): State<R>,
Query(with_cancellations): Query<bool>,
Copy link
Owner

Choose a reason for hiding this comment

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

following the spec, this will fail

I think you can try Query<usize> but could also just do Query<String> and something like

let with_cancellations = if with_cancellations == "1" { true } else { false };

@ralexstokes
Copy link
Owner

@PatStiles can you address the linter failures?

@PatStiles
Copy link
Author

@PatStiles can you address the linter failures?

Done!

@@ -28,7 +28,7 @@ impl BlindedBlockRelayer for Client {
signed_submission: &SignedBidSubmission,
with_cancellations: bool,
) -> Result<(), Error> {
let path = format!("/relay/v1/builder/blocks");
let path = "/relay/v1/builder/blocks".to_string();
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
let path = "/relay/v1/builder/blocks".to_string();
let path = "/relay/v1/builder/blocks";

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.

Support cancellation ability in the BlindedBlockRelayer trait
2 participants