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

ci: generate diff between new and current runtime #549

Merged
merged 6 commits into from
Aug 10, 2023

Conversation

weichweich
Copy link
Contributor

@weichweich weichweich commented Aug 10, 2023

fixes https://github.com/KILTprotocol/ticket/issues/2419

Describes the changes between the currently deployed spiritnet and peregrine runtimes.
I'm afraid we will only test this when it's merged on develop.

Example output:

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 0: System -> 4 change(s)
  - constants changes:
    [≠] BlockWeights: [ 98, 79, 215, 90, 0, 7, 0, 136, 82, 106, 116, 2, 0, 64, 1, 2, 192, 205, 23, 0, 1, 7, 0, 2, 143, 165, 75, 2, 0, 208, 0, 1, ... ]
        [Value([Changed(0, U8Change(98, 2)), Changed(1, U8Change(79, 3)), Changed(2, U8Change(215, 129)), Changed(3, U8Change(90, 93)), Changed(15, U8Change(2, 194)), Changed(16, U8Change(192, 233)), Changed(17, U8Change(205, 23)), Changed(18, U8Change(23, 27)), Changed(22, U8Change(0, 144)), Changed(23, U8Change(2, 119)), Changed(24, U8Change(143, 188)), Changed(25, U8Change(165, 164)), Changed(45, U8Change(2, 194)), Changed(46, U8Change(192, 233)), Changed(47, U8Change(205, 23)), Changed(48, U8Change(23, 27)), Changed(52, U8Change(0, 144)), Changed(53, U8Change(164, 25)), Changed(54, U8Change(35, 81)), Changed(55, U8Change(192, 191)), Changed(83, U8Change(2, 194)), Changed(84, U8Change(192, 233)), Changed(85, U8Change(205, 23)), Changed(86, U8Change(23, 27))])]
    [≠] DbWeight: [64, 120, 125, 1, 0, 0, 0, 0, 0, 225, 245, 5, 0, 0, 0, 0]
        [Value([Changed(0, U8Change(64, 8)), Changed(1, U8Change(120, 157)), Changed(2, U8Change(125, 38)), Changed(3, U8Change(1, 2)), Changed(9, U8Change(225, 220)), Changed(10, U8Change(245, 231)), Changed(11, U8Change(5, 4))])]
    [≠] Version: [ 56, 107, 105, 108, 116, 45, 115, 112, 105, 114, 105, 116, 110, 101, 116, 56, 107, 105, 108, 116, 45, 115, 112, 105, 114, 105, 116, 110, 101, 116, 1, 0, ... ]
        [Value([Changed(34, U8Change(248, 192)), Changed(35, U8Change(42, 43)), Changed(63, U8Change(1, 2)), Changed(87, U8Change(3, 4))])]

  - storages changes:
    [≠] Default  Account: [0; 84]
        [DefaultValue([Changed(83, U8Change(0, 128))])]

[≠] pallet 6: Balances -> 25 change(s)
  - calls changes:
    [≠]  0: transfer ( dest: AccountIdLookupOf<T>, value: T::Balance, )  )
        [Name(StringChange("transfer", "transfer_allow_death"))]
    [≠]  1: set_balance ( who: AccountIdLookupOf<T>, new_free: T::Balance, new_reserved: T::Balance, )  )
        [Name(StringChange("set_balance", "set_balance_deprecated")), Signature(SignatureChange { args: [Changed(2, [Name(StringChange("new_reserved", "old_reserved"))])] })]
    [+] CallDesc { index: 6, name: "upgrade_accounts", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "Vec<T::AccountId>" }] } }
    [+] CallDesc { index: 7, name: "transfer", signature: SignatureDesc { args: [ArgDesc { name: "dest", ty: "AccountIdLookupOf<T>" }, ArgDesc { name: "value", ty: "T::Balance" }] } }
    [+] CallDesc { index: 8, name: "force_set_balance", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "AccountIdLookupOf<T>" }, ArgDesc { name: "new_free", ty: "T::Balance" }] } }

  - events changes:
    [≠]  3: BalanceSet ( who: T::AccountId, free: T::Balance, reserved: T::Balance, )  )
        [Signature(SignatureChange { args: [Removed(2, ArgDesc { name: "reserved", ty: "T::Balance" })] })]
    [+] EventDesc { index: 10, name: "Minted", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }, ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 11, name: "Burned", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }, ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 12, name: "Suspended", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }, ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 13, name: "Restored", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }, ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 14, name: "Upgraded", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }] } }
    [+] EventDesc { index: 15, name: "Issued", signature: SignatureDesc { args: [ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 16, name: "Rescinded", signature: SignatureDesc { args: [ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 17, name: "Locked", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }, ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 18, name: "Unlocked", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }, ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 19, name: "Frozen", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }, ArgDesc { name: "amount", ty: "T::Balance" }] } }
    [+] EventDesc { index: 20, name: "Thawed", signature: SignatureDesc { args: [ArgDesc { name: "who", ty: "T::AccountId" }, ArgDesc { name: "amount", ty: "T::Balance" }] } }

  - errors changes:
    [≠]  4: KeepAlive       
        [Name(StringChange("KeepAlive", "Expendability"))]
    [+] ErrorDesc { index: 8, name: "TooManyHolds" }
    [+] ErrorDesc { index: 9, name: "TooManyFreezes" }

  - constants changes:
    [+] ConstantDesc { name: "MaxFreezes", value: [50, 0, 0, 0] }
    [+] ConstantDesc { name: "MaxHolds", value: [50, 0, 0, 0] }

  - storages changes:
    [≠] Default  Account: [0; 64]
        [DefaultValue([Changed(63, U8Change(0, 128))])]
    [+] StorageDesc { name: "Freezes", modifier: "Default", default_value: [0] }
    [+] StorageDesc { name: "Holds", modifier: "Default", default_value: [0] }

[≠] pallet 30: Democracy -> 6 change(s)
  - calls changes:
    [+] CallDesc { index: 18, name: "set_metadata", signature: SignatureDesc { args: [ArgDesc { name: "owner", ty: "MetadataOwner" }, ArgDesc { name: "maybe_hash", ty: "Option<PreimageHash>" }] } }

  - events changes:
    [+] EventDesc { index: 14, name: "MetadataSet", signature: SignatureDesc { args: [ArgDesc { name: "owner", ty: "MetadataOwner" }, ArgDesc { name: "hash", ty: "PreimageHash" }] } }
    [+] EventDesc { index: 15, name: "MetadataCleared", signature: SignatureDesc { args: [ArgDesc { name: "owner", ty: "MetadataOwner" }, ArgDesc { name: "hash", ty: "PreimageHash" }] } }
    [+] EventDesc { index: 16, name: "MetadataTransferred", signature: SignatureDesc { args: [ArgDesc { name: "prev_owner", ty: "MetadataOwner" }, ArgDesc { name: "owner", ty: "MetadataOwner" }, ArgDesc { name: "hash", ty: "PreimageHash" }] } }

  - errors changes:
    [+] ErrorDesc { index: 23, name: "PreimageNotExist" }

  - storages changes:
    [+] StorageDesc { name: "MetadataOf", modifier: "Optional", default_value: [0] }

[≠] pallet 31: Council -> 2 change(s)
  - calls changes:
    [-] "close_old_weight"

  - constants changes:
    [+] ConstantDesc { name: "MaxProposalWeight", value: [7, 0, 68, 41, 53, 58, 2, 0, 160, 0] }

[≠] pallet 32: TechnicalCommittee -> 2 change(s)
  - calls changes:
    [-] "close_old_weight"

  - constants changes:
    [+] ConstantDesc { name: "MaxProposalWeight", value: [7, 0, 68, 41, 53, 58, 2, 0, 160, 0] }

[≠] pallet 46: Tips -> 1 change(s)
  - constants changes:
    [≠] TipFindersFee: [20] 
        [Value([Changed(0, U8Change(20, 0))])]

[+] id: 47 - new pallet: Multisig
[≠] pallet 64: Did -> 7 change(s)
  - calls changes:
    [≠]  0: create ( details: Box<DidCreationDetails<T>>, signature: DidSignature, )  )
        [Signature(SignatureChange { args: [Changed(0, [Ty(StringChange("Box<DidCreationDetails<T>>", "Box<DidCreationDetailsOf<T>>"))])] })]
    [≠] 12: submit_did_call ( did_call: Box<DidAuthorizedCallOperation<T>>, signature: DidSignature, )  )
        [Signature(SignatureChange { args: [Changed(0, [Ty(StringChange("Box<DidAuthorizedCallOperation<T>>", "Box<DidAuthorizedCallOperationOf<T>>"))])] })]

  - constants changes:
    [+] ConstantDesc { name: "BaseDeposit", value: [0, 0, 141, 73, 253, 26, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
    [+] ConstantDesc { name: "KeyDeposit", value: [0, 220, 32, 116, 151, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
    [≠] MaxNumberOfUrlsPerService: [1, 0, 0, 0]
        [Value([Changed(0, U8Change(1, 2))])]
    [+] ConstantDesc { name: "ServiceEndpointDeposit", value: [0, 176, 21, 106, 8, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
    [-] "Deposit"

[≠] pallet 67: DidLookup -> 2 change(s)
  - calls changes:
    [-] "migrate"

  - storages changes:
    [-] "MigrationStateStore"

[≠] pallet 80: ParachainSystem -> 1 change(s)
  - calls changes:
    [≠]  2: authorize_upgrade ( code_hash: T::Hash, )  )
        [Signature(SignatureChange { args: [Added(1, ArgDesc { name: "check_version", ty: "bool" })] })]

[≠] pallet 83: PolkadotXcm -> 1 change(s)
  - calls changes:
    [+] CallDesc { index: 10, name: "force_suspension", signature: SignatureDesc { args: [ArgDesc { name: "suspended", ty: "bool" }] } }

[≠] pallet 85: DmpQueue -> 1 change(s)
  - events changes:
    [+] EventDesc { index: 6, name: "MaxMessagesExhausted", signature: SignatureDesc { args: [ArgDesc { name: "message_id", ty: "MessageId" }] } }

[-] pallet 1: RandomnessCollectiveFlip
SUMMARY:
- Compatible.......................: false
- Require transaction_version bump.: true

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!

@weichweich weichweich requested a review from ntn-x2 August 10, 2023 08:55
@weichweich weichweich changed the title ci: generate diff of currently deployed runtime ci: generate diff between new and current runtime Aug 10, 2023
.gitlab-ci.yml Outdated
@@ -72,6 +72,8 @@ build-wasm-peregrine:
- cp -r * /build
- /srtool/build build
- subwasm meta --format=json+scale /out/peregrine_runtime.compact.wasm > /out/peregrine-metadata.json
- subwasm get -o peregrine-live.wasm wss://peregrine.kilt.io
- subwasm diff --no-color peregrine-live.wasm /out/peregrine_runtime.compact.wasm > /out/peregrine-diff.txt
Copy link
Member

Choose a reason for hiding this comment

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

So the output is redirected to a file, and we don't expose it as an artifact. How can we use the result of the diff in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch i thought everything in out/ is an artifact

Copy link
Member

Choose a reason for hiding this comment

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

If we're saving it to a file, would it make more sense to have it in JSON format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that as well. I think printing it to the output is not nice since it's harder to copy/past/store. During the release process you will download the artifacts anyways, so you will have this output there as well.

I personally can't process the JSON. I'm not sure if there are tools that use the JSON but I'm not aware of any. That's why I choose the text output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

might also make sense to use tee so that it's printed as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Next I was going to suggest to also print it. So maybe personally I would have printed the text version and stored the JSON version. But I am fine with having the text version stored as well.

Copy link
Member

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

We could print it as well. Otherwise looks good!

@weichweich weichweich enabled auto-merge (squash) August 10, 2023 12:18
@weichweich weichweich merged commit 649b8fc into develop Aug 10, 2023
@weichweich weichweich deleted the aw-subwasm-diff branch August 10, 2023 12:46
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