usecannon / cannon-legacy

Manage EVM protocol deployments. Inspired by Docker, Terraform, and npm.

Home Page:https://usecannon.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

implement upgrade catalyst functionality

dbeal-eth opened this issue · comments

commented

when a cannonfile is updated, all of its deployments are nuked and paved.

This is actually probably right functionality for local chains. but for live network deployments, some protocols may have special requirements. additionally, projects which have not used cannon in the past (that is, all of them right now) should have a way to link their own deployments to their cannonfile without actually having cannon deploy them.

Introducing upgrade catalysts

When invoking the ChainBuilder, it will take in an option, upgradeCatalyst, which is a function (label: string, config: Config) => InternalOutputs | null that gets executed before the actual steps are executed. If the step should be skipped with alternate inputs, the upgrade catalyst returns the internal outputs that should be returned. Otherwise, it returns null.

cannon will provide a default upgrade catalyst for packages that have used cannon for a previous deployment but do not need to be deployed again. this will allow for general-purpose, minimal system upgrades without needing to redeploy everything, if that is how your protocol works. Alternately if the protocol is a type which has major upgrades which do not depend on the previous, the upgrade can be implemented that way as well.