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

Update to 0.9.42 #382

Merged
merged 104 commits into from
Mar 20, 2024
Merged

Update to 0.9.42 #382

merged 104 commits into from
Mar 20, 2024

Conversation

gianfra-t
Copy link
Contributor

@gianfra-t gianfra-t commented Dec 14, 2023

Note: I will leave this as draft until merged with the fix code for try-runtime.

@pendulum-chain/product: This PR adds changes to the node client code that require a redeployment of the collator nodes to take effect.

Closes tasks/#158
Closes #222.
Closes https://github.com/pendulum-chain/tasks/issues/64.

Updates to dependencies

Spacewalk -> branch upgrade-v0.9.42
Substrate-stellar-sdk -> branch polkadot-v0.9.42
Dia-Oracle (oracle-pallet) -> branch polkadot-v0.9.42
Pendulum/Bifrost -> branch upgrade-v0.9.42.

Updates of the Storage Version

Following what was defined in this issue and in this notion page, we define in this PR the manual set of the storage version for all pallets which are behind the current version.

The code is added to the Executive type and will be used only for the purpose of this update.

For pallets vesting and transaction-payment we need to make custom migrations that make use of private definitions of the StorageVersion type and the Releases enum. This temporary substrate fork contains these migration types. here and here.

Changes in runtime

General

New TokenError variants were added to ChainExtensionTokenError enum and From<> functions.

Pallet Balances

In all configs we must add the following new types (FreezeIdentifier, MaxFreezes, MaxHolds and HoldIdentifier). Since we currently do not use any of these functionalities, we can pass the default configuration. We need to adjust if we require more than one freeze or hold.

type FreezeIdentifier = ();
 type MaxFreezes = ();
 type MaxHolds = ConstU32<1>;
 type HoldIdentifier = RuntimeHoldReason;

Also in pallet_balances the DustRemoval trait bound has changed. Before it was required:
type DustRemoval: OnUnbalanced<NegativeImbalance<Self, I>>;
Which pallet Treasury implemented.

Passing type Treasure is not supported anymore since the bound is now:
type DustRemoval: OnUnbalanced<CreditOf<Self, I>>; which is not implemented by the Treasury pallet, so we must define a new implementation. This is adopted from ComposableFi yet the functionality is the same which will transfer to the Treasury's account the unbalanced currency.

Pallet Contracts

  • Removed DeletionWeightLimit, DeletionQueueDepth since are not required anymore.
  • Adds DefaultDepositLimit, which is the fallback value to limit the storage deposit if it's not being set by the caller. Defined this value as in substrate contracts node

Pallet Collective

  • Must add MaxProposalWeight. We use 50 percent of the max block weight as it is defined in Frontier.

Pallet XCM

  • Adds AdminOrigin type, which is set to root. This is only used for privileged function about xcm version management.

Farming Pallet

Because we update our bifrost fork to 0.9.42, the farming pallet now allows for a "boost reward" functionality, which can also be managed in conjunction with the pallet ve-minting. This is refelected into 4 new config types for farming pallet: FarmingBoost, VeMinting, BlockNumberToBalance, WhitelistMaximumLimit. We do not use VeMinting in this case, as in bifrost kusama

Changes in Node

Partly adopted changes from equilibrium's node service. Changes are minor and mostly involve modifications in methods calls.

@gianfra-t gianfra-t marked this pull request as draft January 3, 2024 14:22
@gianfra-t gianfra-t force-pushed the update-to-0.9.42 branch 2 times, most recently from a057555 to 26d2316 Compare January 5, 2024 21:37
@gianfra-t gianfra-t marked this pull request as ready for review January 10, 2024 22:14
@ebma
Copy link
Member

ebma commented Feb 26, 2024

@gianfra-t can you please resolve the conflicts of this PR? We need to prepare it for merging again

@gianfra-t
Copy link
Contributor Author

The new fee per second implementation was merged into this branch, which removes the need for a temporary workaround used before.

@prayagd
Copy link
Collaborator

prayagd commented Mar 1, 2024

@ebma @gianfra-t would this update break the ledger app?

@gianfra-t
Copy link
Contributor Author

I don't think so, because the extrinsics are not changing by the update (the transaction version should stay the same).

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Looks good to me but should probably only be merged once pendulum-chain/spacewalk#491 and #410 are merged. The rev commits for the Spacewalk dependencies should then point to the merge commit of the PR on Spacewalk main.

pallets/parachain-staking/src/lib.rs Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
runtime/pendulum/src/lib.rs Outdated Show resolved Hide resolved
gianfra-t and others added 2 commits March 1, 2024 13:49
Copy link
Contributor

@bogdanS98 bogdanS98 left a comment

Choose a reason for hiding this comment

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

Looks good 👍🏼

@gianfra-t
Copy link
Contributor Author

Regarding merging this after #410, do we plan to have both changes on the same runtime upgrade? I particularly have no strong opinion against doing both at the same time, and it could save some time. Also regarding this slack discussion.

@ebma
Copy link
Member

ebma commented Mar 18, 2024

Let's see if we can merge this and then this tomorrow so that we can link to a commit that is contained on the main branch of Spacewalk.

Copy link
Member

@TorstenStueber TorstenStueber left a comment

Choose a reason for hiding this comment

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

Let's go ahead with this. Thanks for all the testing work!

@ebma
Copy link
Member

ebma commented Mar 20, 2024

Oh just one more thing. I noticed that the PR includes the changes of #432 which we rolled back in order not to mess with the XCM configuration until https://github.com/pendulum-chain/tasks/issues/202 is fully ready and implemented. I propose we roll those changes back here as well. I assume this is quite simple and can be done with a simple revert of the specific commit like was done in #431.

@gianfra-t
Copy link
Contributor Author

Oh, good that you remembered that @ebma, I completely forgot. Sadly I don't know if it will be that simple, mostly because there were some changes required for the old trader given the new version. So it will probably not look exactly like before.

@gianfra-t
Copy link
Contributor Author

gianfra-t commented Mar 20, 2024

@ebma I reverted the merge with fee per second, which re-introduces this workaround for the TakeFirstAssetTrader. When using 0.9.42, simply using Tokens pallet instead of this ConcreteAsset struct defined in the workaround wont work, since it does not implement (anymore) the necessary traits.
That I know, we only use the method minimum_balance from the inspect trait in TakeFirstAssetTrader. I removed the todo()! macro just to be safe so many implementations won't make sense.

Let me know what you think. I am testing with chopsticks right now.

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for reverting the changes 👍
Let's finally get this merged

@ebma ebma merged commit 27950be into main Mar 20, 2024
2 checks passed
@ebma ebma deleted the update-to-0.9.42 branch March 20, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants