EspressoSystems / cape

Configurable Asset Privacy for Ethereum
https://cape.docs.espressosys.com/
GNU General Public License v3.0
93 stars 16 forks source link

Faucet: break records in parallel #1169

Closed sveitser closed 2 years ago

sveitser commented 2 years ago

This looks good to me. It should increase our number of large records so we are not susceptible to a single large record get lost/delayed.

I think to get some parallelism and speed up the record breaking process, we need to do something about the wallet.await_transaction(&receipt).await in break_up_records. We should be able to skip this most of the time, since we expect to have other large records that can be broken up while the previous one is in transit. However, we don't want to skip this all the time -- if we did, then we might go back into the wait loop without creating enough records, in the case where we started with only one big record to break up. Therefore, I think we need to so something like

if wallet has more records that can be broken up {
  continue;
} else if this transaction will give us enough records {
  break;
} else {
  wait for transaction
}

Not sure if we want to do this now or in a separate PR, because this is already beneficial as is

Originally posted by @jbearer in https://github.com/EspressoSystems/cape/pull/1167#pullrequestreview-1017397033