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

Workflow to check whether transaction_version should be bumped #475

Merged
merged 11 commits into from
Apr 22, 2022

Conversation

ghzlatarev
Copy link
Contributor

@ghzlatarev ghzlatarev commented Apr 7, 2022

Signed-off-by: ghzlatarev ghzlatarev@gmail.com

Description

closes: #243

  • Adds a manual workflow to check whether the code from a certain branch will require a transaction_version bump, if we were to upgrade the production Calamari with it.
  • A typical output if nothing has changed should be:
-------------------------------------------
              [Spec] name: calamari
                     spec_version: 3[14]1
                     transaction_version: 4
          [Metadata] version: 14
           [Modules] num: 28
                          [System] idx: 0 (calls: 9, storage: 17)
                 [ParachainSystem] idx: 1 (calls: 4, storage: 20)
                       [Timestamp] idx: 2 (calls: 1, storage: 3)
                [TransactionPause] idx: 9 (calls: 2, storage: 2)
                        [Balances] idx: 10 (calls: 6, storage: 6)
                       [Democracy] idx: 14 (calls: 25, storage: [15]
                         [Council] idx: 15 (calls: 6, storage: 7)
               [CouncilMembership] idx: [16] (calls: 7, storage: 3)
              [TechnicalCommittee] idx: [17] (calls: 6, storage: 7)
             [TechnicalMembership] idx: [18](calls: 7, storage: 3)
                      [Authorship] idx: [20] (calls: 1, storage: 4)
               [CollatorSelection] idx: [21](calls: 7, storage: 6)
                         [Session] idx: [22] (calls: 2, storage: 8)
                        [Treasury] idx: [26] (calls: 3, storage: 4)
                        [Preimage] idx: [28] (calls: 4, storage: 3)
                       [Scheduler] idx: [29] (calls: 6, storage: 3)
                       [XcmpQueue] idx: [30] (calls: 1, storage: 9)
                     [PolkadotXcm] idx: [31] (calls: 10, storage: 10)
                        [DmpQueue] idx: [33] (calls: 1, storage: 5)
                        [Multisig] idx: 41 (calls: 4, storage: 3)
                            [Sudo] idx: 42 (calls: 4, storage: 2)
                 [CalamariVesting] idx: 50 (calls: 3, storage: 3)
  • Otherwise you could see a more verbose output with a summary like so
echo "\n------------------------------ SUMMARY -------------------------------"
echo "\n⚠️ This filter is here to help spotting changes that should be reviewed carefully."
echo "\n⚠️ It catches only index changes, deletions and value decreases".

Deletions
14: [-] modules: Sudo, ParachainsConfiguration, ParasInclusion, ParasInherent, ParasScheduler

Index changes
27: [Identity] idx: 17 -> 25 (calls: 15, storage: 4)
28: [Recovery] idx: 18 -> 27 (calls: 9, storage: 3)
29: [Vesting] idx: 19 -> 28 (calls: 4, storage: 1)
30: [Scheduler] idx: 20 -> 29 (calls: 6, storage: 3)
31: [Proxy] idx: 22 -> 30 (calls: 10, storage: 2)
32: [Multisig] idx: 23 -> 31 (calls: 4, storage: 2)
33: [ElectionProviderMultiPhase] idx: 24 -> 37 (calls: 4, storage: 10)
36: [Paras] idx: 47 -> 56 (calls: 5, storage: 13 -> 17)
38: [Registrar] idx: 60 -> 70 (calls: 6, storage: 3)
39: [Slots] idx: 61 -> 71 (calls: 3, storage: 1)
40: [Auctions] idx: 63 -> 72 (calls: 3, storage: 4)
41: [Crowdloan] idx: 64 -> 73 (calls: 8, storage: 4)

Decreases

echo "\n----------------------------------------------------------------------\n"

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests.
  • Updated relevant documentation in the code.
  • Added one line describing your change in <branch>/CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer.
  • If runtime changes, need to update the version numbers properly:
    • authoring_version: The version of the authorship interface. An authoring node will not attempt to author blocks unless this is equal to its native runtime.
    • spec_version: The version of the runtime specification. A full node will not attempt to use its native runtime in substitute for the on-chain Wasm runtime unless all of spec_name, spec_version, and authoring_version are the same between Wasm and native.
    • impl_version: The version of the implementation of the specification. Nodes are free to ignore this; it serves only as an indication that the code is different; as long as the other two versions are the same then while the actual code may be different, it is nonetheless required to do the same thing. Non-consensus-breaking optimizations are about the only changes that could be made which would result in only the impl_version changing.
    • transaction_version: The version of the extrinsics interface. This number must be updated in the following circumstances: extrinsic parameters (number, order, or types) have been changed; extrinsics or pallets have been removed; or the pallet order in the construct_runtime! macro or extrinsic order in a pallet has been changed. If this number is updated, then the spec_version must also be updated
  • Verify benchmarks & weights have been updated for any modified runtime logics
  • If import a new pallet, choose a proper module index for it, and allow it in BaseFilter. Ensure every extrinsic works from front-end. If there's corresponding tool, ensure both work for each other.
  • If needed, update our Javascript/Typescript APIs. These APIs are offcially used by exchanges or community developers.
  • If modifying existing runtime storage items, make sure to implement storage migrations for the runtime and test them with try-runtime. This includes migrations inhreited from upstream changes, and you can search the diffs for modifications of #[pallet::storage] items to check for any.

Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
@ghzlatarev ghzlatarev self-assigned this Apr 7, 2022
@ghzlatarev ghzlatarev marked this pull request as ready for review April 7, 2022 14:20
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
@ghzlatarev ghzlatarev requested a review from Dengjianping April 10, 2022 19:46
@ghzlatarev ghzlatarev added A-ci Area: Continuous Integration A-runtime Area: Issues and PRs related to Runtimes labels Apr 11, 2022
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
Signed-off-by: ghzlatarev <ghzlatarev@gmail.com>
@ghzlatarev ghzlatarev requested review from Garandor and stechu April 22, 2022 13:54
Copy link
Contributor

@Dengjianping Dengjianping left a comment

Choose a reason for hiding this comment

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

LGTM!

@Dengjianping Dengjianping merged commit 548cfb5 into manta Apr 22, 2022
@Dengjianping Dengjianping deleted the ghzlatarev/metadata-diff branch April 22, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ci Area: Continuous Integration A-runtime Area: Issues and PRs related to Runtimes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GHA for detecting whether transaction version bump is required
4 participants