Skip to content

[TM-344] Simplify user-defined upgrades

Kirill Kuvshinov requested to merge kkirka/tm344-simplify-user-upgradeable into master

Description

Problem:

Currently, user-defined upgrades contain various workarounds to solve issues that do not exist anymore in Tezos mainnet, namely:

  1. It used to be impossible to call some contract without knowing its full parameter type, hence:
  • The documentation proposes two fairly complicated ways to call V2 from V1 (lambdas and a proxy contract)
  • The implementation uses the lambda approach instead of addressing V2 via entrypoints
  1. It used to be non-trivial to place big map arbitrarily in storage, thus he implementation used a Map instead of a BigMap to store balances.

Since it is no longer required to know the full parameter type to call an entrypoint, and the placement restrictions on big maps have been lifted, it is natural to simplify both the spec and the implementation of user-defined upgrades.

Solution:

  1. Use explicit entrypoints instead of workarounds both in the docs and in the implementation.
  2. Replace a Map with a BigMap

Related issue(s)

Resolves https://issues.serokell.io/issue/TM-344

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated the changelog if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Kirill Kuvshinov

Merge request reports