Skip to content

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

Open
PatStiles wants to merge 8 commits intoralexstokes:mainfrom
PatStiles:feat/add_cancellations
Open

feat(rpc): add cancellations param to submit_block rpc#131
PatStiles wants to merge 8 commits intoralexstokes:mainfrom
PatStiles:feat/add_cancellations

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


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!

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