district0x / district-registry

A community-curated registry of marketplaces on the district0x Network.
Eclipse Public License 1.0
11 stars 9 forks source link

Support for resumable migrations #124

Closed ginesdt closed 3 years ago

ginesdt commented 3 years ago

Summary

Added support for resumable migrations. The migration scripts can now be written in "steps" such that if one of the steps fails (e.g., if a transaction fails), next execution of the script will be resumed from the step which failed, that is, skipping all the previous (already executed) steps. This way, gas is saved as it does not need to re-run all transactions from the beginning.

Impl details

Note each step returns the state variables which are required in subsequent steps, and they are persisted in a temp file. This has been applied to migration script 8.