Hey all, Currently the NNS API has a manage neuron command, it’s type in Motoko looks like so:
manage_neuron : shared ManageNeuronRequest -> async ManageNeuronResponse;
With the manage neuron request looking like:
public type ManageNeuronRequest = {
id : ?NeuronId;
command : ?ManageNeuronCommandRequest;
neuron_id_or_subaccount : ?NeuronIdOrSubaccount;
};
The feature request is to add a new endpoint (or adapt the current endpoint - up to the team) so that it takes in an array of requests and returns an array of results like so:
batch_manage_neuron : shared [ManageNeuronRequest] -> async [ManageNeuronResponse];
This would allow users and canisters to batch manage neuron requests in a single call, in our systems we allow something like this for our vectors, and I thought something like this would be incredibly useful on the NNS level.
From looking at the NNS code, all the manage neuron commands are sync and return appropriate errors, It should not be all or nothing, it should just return what failed and what was a success as it works in the current system.
There are lot of benefits if this was added. You can start providing pro-user type of UI’s and update all your neurons in one go (Instead of manually updating your neurons one by one). Also canisters providing neuron management services with many neurons and liquid staking protocols with buckets of neurons can operate far more efficiently - updating all of their neurons in one call - when operating in an async environment batch calls are very useful, it also frees up network load on both canisters.
Open to thoughts and feedback.