Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Functions] (test): Add unit tests for upgrade safety #8710

Merged
merged 4 commits into from
Mar 16, 2023

Conversation

justinkaseman
Copy link
Contributor

Description

Adds unit tests that check the latest versions of FunctionsBillingRegistry and FunctionsOracle for clean upgradeability.

Changes

Upgradeability is checked in 3 steps:

  1. In test setup, the "original" business logic implementation from when the proxies were first deployed is used.
  2. To prove upgradeability, a simple change of the business logic implementation is migrated to. Currently this is changing the fee amount.
  3. To check the safety of any new development, the business logic implementation from src/0.8/dev/functions is then migrated to.

If the latest business logic contains a change that would break the transparent proxy pattern it will be caught by step 3, for example renaming a storage variable:
image

@github-actions
Copy link
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@justinkaseman justinkaseman requested a review from KuphJr March 15, 2023 18:37
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@justinkaseman justinkaseman merged commit 950b8df into develop Mar 16, 2023
@justinkaseman justinkaseman deleted the jk/upgrade-test branch March 16, 2023 16:04
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.

2 participants