[go: up one dir, main page]

Dac: Optimize flooding implementation to only pick the first successful request

The following discussion from !8747 (merged) should be addressed:

  • @andrea.cerone started a discussion: (+3 comments)

    less nit: This will require all the concurrent promises to be evaluated, before the list of results can be returned. That is, the page is downloaded at the rate of the slowest committee member.

    You can have a look at Lwt.choose to return a result as soon as one is available. Have a look at the documentation, and in particular be careful that the function does not handle tzerror values for you.

An Observer node should send a request for a missing page to each Committee Member. On the first successful response, all other requests should be cancelled. We can do this by returning a list of promises for each RPC request that was sent then, unlike Lwt.pick, we should choose the first successful promises not simply the first resolved. That is, if a promise is resolved but rejected, we should continue waiting on a pending promise until we get a successful promise or there are no more pending promises

Edited by Ryan Tan