Skip to content

Contract versioning doc#229

Merged
nialexsan merged 3 commits into
mainfrom
nialexsan/contract-versioning
Mar 25, 2026
Merged

Contract versioning doc#229
nialexsan merged 3 commits into
mainfrom
nialexsan/contract-versioning

Conversation

@nialexsan
Copy link
Copy Markdown
Contributor

Closes: #???

Description

contract versioning strategy and some suggestions


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@nialexsan nialexsan requested a review from a team as a code owner March 25, 2026 01:05
Copy link
Copy Markdown
Member

@jordanschalm jordanschalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the writeup

Comment thread CONTRACT_VERSIONING.md Outdated

To reduce unnecessary version bumps, contracts should be designed with extensibility in mind.

### Extension State Pattern
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern adds globally mutable, non-type-safe state, which makes our code more difficult to understand and reason about, and increases the likelihood of bugs.

I would like to frame this pattern as a way to temporarily implement changes in a prior, deployed version in a upgrade-compatible way, only when strictly necessary. We should never use this pattern on the main branch, and should try to avoid it in general.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, this is a temporary measure to implement missing behavior in already deployed contracts, and with a newer version these changes should be implemented with proper typing.

I still think it's still useful to have this escape hatch in the main branch to keep the contracts extendable and don't forget to add this field just before the deployment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 agree, "never use" as in "the container is empty and not referenced", not "the container doesn't exist"

Comment thread CONTRACT_VERSIONING.md Outdated
All changes must be:

* Backward-compatible
* Deployable to the same contract address
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the same name

Comment thread CONTRACT_VERSIONING.md Outdated
| `v0` | Current deployed mainnet version |

* `main` is free to introduce breaking changes
* `v0` is stable and represents the exact deployed contract set
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to describe or indicate anything about contract naming on these branches? do we want to have any rulesets for that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a section regarding contract naming

@nialexsan nialexsan merged commit deea8cc into main Mar 25, 2026
7 checks passed
@nialexsan nialexsan deleted the nialexsan/contract-versioning branch March 25, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants