onflow / contract-updater

Enabling delayed contract updates to a wrapped account at or beyond a specified block height
The Unlicense
4 stars 9 forks source link

Recover gracefully from unsuccessful deployments #3

Open sisyphusSmiling opened 1 year ago

sisyphusSmiling commented 1 year ago

The original idea was to iterate over DelegatedUpdater Capabilities, calling update() on each. However, update_experimental() appears to panic on unsuccessful deployment which would prevent successive updates.

Some workarounds here are:

The latter is a significantly larger lift, but resolution here will need to balance the number of transactions that need to be submitted to satisfy all updates in a timely manner so contracts are available post-spork and updates do not significantly delay network availability beyond the spork height.

sisyphusSmiling commented 1 year ago

Opened issue covering this open question.

Alternatives to this addition to the AuthAccount.Contracts API include submitting a single transaction for each update.

sisyphusSmiling commented 11 months ago

The tryUpdate() method was implemented and merged to Cadence 1.0 but waiting on merge to master (https://github.com/onflow/cadence/issues/2963). Awaiting on inclusion of the feature to Cadence test suite before implementing in ContractUpdater.