demergent-labs / multisig_vault

MIT License
8 stars 0 forks source link

Should we make it a best practice to always surround mutations in a try catch? We need to ensure we never get into an inconsistent state #42

Open lastmjs opened 2 years ago

lastmjs commented 2 years ago

Should we make it a best practice to always surround mutations in a try catch? We need to ensure we never get into an inconsistent state?

Canisters need to be very careful when trapping, and I believe when an error is thrown in Boa then the canister will panic thus causing a trap. This could lead to inconsistent behavior if there have a been any cross-canister calls, as the state before the call will have been committed but not the state after the call.

For now I am doing all mutations after any cross-canister calls, so any uncaught errors should wipe clean, but we should be aware of this and possibly come up with best practices.