Feature Request: http_request_composite

Can we get an upgrade to the http_request handling so that we can upgrade a request to a composite query? This already exists for update calls where returning a header of upgrade=true causes the request to be resubmitted as an update call to http_request_update.

Proposal: Send a header of composite=true; and the the function is called again as at http_request_composite.

Use Case: I’d like to keep most of my data in an archive canister, including a witness that I can use to certify the data, and I expect high throughput on my gateway, so I don’t want to gum it up with processing Merkle changes all the way down the chain. I want my gateway canister to be able to query these archive nodes without an update call.

Example: I want to serve the rosetta API for a token from a canister on the IC but need to support millions of transaction entries and their witnesses.

1 Like

As an alternative to your suggestion, you can consider exposing http_request as a composite query method directly: the only drawback I can think of is that this method can’t be executed as an update call, but for that you have exported the method http_request_update anyway.

3 Likes

Ahh…this is good to know. I didn’t know that the clients saw query and composite query as interchangeable.

Aren’t composite queries a bit more expensive because they run against multiple nodes? If that is the case then I’d suggest that this still be put on the back log so that developers have the ability to reduce their cost and only invoke the more expensive composite query if necessay.

Ahh…this is good to know. I didn’t know that the clients saw query and composite query as interchangeable.

They’re interchangeable as far as the HTTP requests to the query endpoint is concerned, e.g., using IC agents. They aren’t interchangeable as far as update calls are concerned (HTTP requests to the call endpoint or inter-canister update calls).

Aren’t composite queries a bit more expensive because they run against multiple nodes?

No, composite queries are evaluated on a single node just like queries and thus nested calls must target canisters on the same subnet so that their state is available to the single node executing a composite query.

1 Like