nucypher / nucypher-porter

Gateway to TACo nodes of the threshold network
GNU Affero General Public License v3.0
2 stars 8 forks source link

Pagination of Porter responses #3

Open derekpierre opened 3 years ago

derekpierre commented 3 years ago

Related to https://github.com/nucypher/nucypher/issues/2703.

If the responses for Alice endpoints /get_ursulas and potentially /revoke can be too large, we can think about paginating the response. See https://github.com/nucypher/nucypher/issues/2666#issuecomment-845195014 for some context.

cygnusv commented 3 years ago

@derekpierre is this done in https://github.com/nucypher/nucypher/pull/2664/commits/f384c7e87accff77cf144fba0d10d8504b959997?

derekpierre commented 3 years ago

@derekpierre is this done in f384c7e?

This issue is still outstanding. The referenced commit is related to pagination of the list of stakers obtained from the smart contract i.e. the back end call. However, this issue is specific to the front end side (endpoint response to the request) i.e. if the user's request asks for something like 500 ursulas, do we return all 500 in a single large response result (as we do now), or do we limit the number that can be returned in a single response and allow for follow-on requests to obtain the remainder of ursulas. One of the concerns here is having to cache sampling results for a period of time as opposed to being totally stateless - see https://github.com/nucypher/nucypher/issues/2666#issuecomment-845241669.

derekpierre commented 3 years ago

To clarify, this didn't seem absolutely necessary for an MVP. Do you feel differently?

cygnusv commented 2 years ago

@derekpierre is this done?

derekpierre commented 2 years ago

No.

This issue is around the question of what if someone wants to sample for a large quantity of nodes - do we return all the information in one response (which is what we do now), or split the response into paginated responses.

For example, if someone called getI_ursulas and wanted 200 ursulas, does the response contain all information for the 200 ursulas, or do we paginate the response in batches of 50. Note Porter would still have to sample for the full 200 nodes , and then save state, to respond to requests for subsequent response pages by the user. The issue here being that Porter has to save some state for subsequent responses to the original request.