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

pink: Support for batch HTTP request #1280

Merged
merged 9 commits into from
May 31, 2023
Merged

pink: Support for batch HTTP request #1280

merged 9 commits into from
May 31, 2023

Conversation

kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented May 24, 2023

This PR adds a new extension function to send multiple HTTP requests simultaneously:

 #[ink(extension = 22, handle_status = true)]
 fn http_batch_request(
    requests: Vec<HttpRequest>,
    timeout_ms: u64,
 ) -> Vec<Result<HttpResponse, HttpRequestError>>;

The PR requires runtime upgrading for the already deployed cluster.

Usage:
https://github.com/Phala-Network/phala-blockchain/pull/1280/files#diff-ede8afeb0bf8928e02cd43f590808488c91465e013f2be7cc8adbf9b1715dad2R119-R140

@kvinwang kvinwang requested a review from h4x3rotab May 29, 2023 12:13
Base automatically changed from pink-runtime-1.1 to master May 30, 2023 11:20

/// Batch http request
#[ink(extension = 22, handle_status = true)]
fn batch_http_request(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we give out error on the ink side when there are too many requests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Given

@kvinwang kvinwang requested a review from h4x3rotab May 31, 2023 07:09
Copy link
Contributor

@h4x3rotab h4x3rotab left a comment

Choose a reason for hiding this comment

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

LGTM

@kvinwang kvinwang merged commit 5131efb into master May 31, 2023
@kvinwang kvinwang deleted the http-batch branch May 31, 2023 11:19
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.

2 participants