-
Notifications
You must be signed in to change notification settings - Fork 119
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
feat: upgrade asset manager #814
Conversation
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
…d invariants checkes, but works. Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'm through. see comments for requested changes.
Most importantly, remove evm_address
That's because I didn't add any logs, will do. And the migration is not part of the pallet code so that's probably the reason for |
…nfig impl and #[pallet::generate_store(pub(super) trait Store)] in pallet-asset-manager, remove unnecessary comments, use StandardAssetId in pallet-manta-pay benchmarking Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
: Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
Updated the try-runtime results with the logs now. |
Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* feat: add asset-manager changes Signed-off-by: Brandon H. Gomes <bhgomes@pm.me> * Compiles and tests pass, cleaned warnings Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Split Dolphin and Calamari AssetId types Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Migration code for asset-manager and assets pallets, needs cleanup and invariants checkes, but works. Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Add invariant checks Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Update Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Migrate Accounts storage double map with storage aliasing Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Add equivalence checks before and after migration Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Remove post-upgrade check that old storage is empty Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Clean up and formatting Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Revert default AssetRegistryMetadata. Fix benchmarks Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Clean up and docs Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Cleanup Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Fix clippy Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Address review comments. Incremenet storage version of both pallets and check for correctness Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Use MaybeSerializeDesirialize from sp-runtime Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Improve asset-manager benchmarking code Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Fix clippy, rmeove pallet-assets from pallet-asset-manager cargo.toml Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Use more explicitly named trait for asset metadata defaults for testing - TestingDefault Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Fix docs Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Migrate AssetRegistryMetadata Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Bump AssetManager StorageVersion in pallet Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Use AtLeast32BitUnsigned instead of local impl of CheckedIncrement Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * taplo fmt Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Use One trait Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Fix tests Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Rename try_ name to more explicit and clean up docs Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * clean up asset-manager benchmarking code, removed redundant GenesisConfig impl and #[pallet::generate_store(pub(super) trait Store)] in pallet-asset-manager, remove unnecessary comments, use StandardAssetId in pallet-manta-pay benchmarking Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Fix clippy and asset-manager benchamrking tests Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Add missing doccoment in old asset-manager migration code Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Refactor AssetIdMigration generics and get rid of magic numbers' * Missing doccoments related to xtokents and xcm Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * More missing dcocoments Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Add progress logs to AssetId migration Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Add #[compact] to all AssetId extrinsic params' : Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Remove evm_address field from metadata Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Fix clippy Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> * Fix pre-runtime hook storage version check for pallet-assets Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> Signed-off-by: Brandon H. Gomes <bhgomes@pm.me> Signed-off-by: Georgi Zlatarev <georgi.zlatarev@manta.network> Co-authored-by: Georgi Zlatarev <georgi.zlatarev@manta.network> Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
Signed-off-by: Brandon H. Gomes bhgomes@pm.me
Description
closes: #808
Switch to u128 for
AssetId
of Calamari asset-manager pallet and add migration code for asset-manager and pallet-assets storage items that useAssetId
. MantaPayAssetId
to follow in a different PR. Only switch Calamari not Dolphin, because we don't need the migration before we restart it.The invariants that are checked are that there is no data in the new keys prior to the migration and that the same data is successfully migrated to the new keys. We also check manually that the old keys no longer hold any data.
Turn
AssetId
andBalance
ofAssetConfig
into genericsRefactor some of the FungibleLedger functions to have try-versions. Rename some of the api functions.
General improvements of related code
Main files to review:
Related question to why we can't assert that the old asset-id storage keys are empty in the post-upgrade try-runtime hook - https://substrate.stackexchange.com/questions/5214/potential-storage-issue-with-try-runtime-tool
But this was manually checked on a local testnet that the old storage keys are indeed drained.
Result of try-runtime:
Before we can approve this PR for merge, please make sure that all the following items have been checked off:
L-
group to this PRA-
andC-
groups to this PRA-calamari
,A-dolphin
and/orA-manta
if your changes are meant for/impact either of these (CI depends on it)Files changed
in the Github PR explorer.Situational Notes:
BaseFilter
. Ensure every extrinsic works from front-end. If there's corresponding tool, ensure both work for each other.try-runtime
. This includes migrations inherited from upstream changes, and you can search the diffs for modifications of#[pallet::storage]
items to check for any.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. You can run themetadata_diff.yml
workflow for help. If this number is updated, then thespec_version
must also be updated