The function verify_batch_update takes a list of leaf mutations, which specify the leaf index, the new leaf value, and an authentication path for the mutated leaf. It also takes a list of new leaves that are appended to the MMR. Currently the bounds-check for the mutation data happens before the new leaves are added to the MMR. If this were to happen after the addition, leaves could be added and then mutated in the same function call.
This change could make the function harder to understand, as it's not completely clear from the interface what state the MMR ends up in. Let's only do this if a concrete need arises.
The function
verify_batch_update
takes a list of leaf mutations, which specify the leaf index, the new leaf value, and an authentication path for the mutated leaf. It also takes a list of new leaves that are appended to the MMR. Currently the bounds-check for the mutation data happens before the new leaves are added to the MMR. If this were to happen after the addition, leaves could be added and then mutated in the same function call.I think that's preferable.