-
Notifications
You must be signed in to change notification settings - Fork 9
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
refactor(mainnet): assets config #465
base: al3mart/refactor-mainnet-config
Are you sure you want to change the base?
refactor(mainnet): assets config #465
Conversation
4327776
to
4be4a08
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## al3mart/refactor-mainnet-config #465 +/- ##
===================================================================
+ Coverage 75.78% 76.10% +0.31%
===================================================================
Files 83 86 +3
Lines 17127 17606 +479
Branches 17127 17606 +479
===================================================================
+ Hits 12980 13399 +419
- Misses 3884 3936 +52
- Partials 263 271 +8
|
c81b9d6
to
702b7f2
Compare
bb73e34
to
b7a3e9d
Compare
fmt refactor(collator): not necessary import
bdbe427
to
e614927
Compare
ProxyType::NonTransfer => | ||
!is_transfer_call(c) && | ||
// Wrapped transfer calls are filtered too. | ||
matches!( | ||
c, | ||
RuntimeCall::Utility(pallet_utility::Call::batch { calls }) | | ||
RuntimeCall::Utility(pallet_utility::Call::batch_all { calls }) | ||
if !calls.iter().any(|call| is_transfer_call(call)) | ||
) && matches!( | ||
c, | ||
RuntimeCall::Utility(pallet_utility::Call::as_derivative { call, .. }) | ||
if !is_transfer_call(call) | ||
), |
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.
NonTransfer
can't dispatch calls that transfer funds, nor wrap calls that transfer funds.
RuntimeCall::Balances { .. } | | ||
RuntimeCall::Assets { .. } | | ||
RuntimeCall::Nfts { .. } | | ||
RuntimeCall::Treasury { .. } |
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.
Though that Treasury calls should also be filtered.
let max_collection_size = pallet_nfts::Collection::<Runtime>::storage_info() | ||
.first() | ||
.and_then(|info| info.max_size) | ||
.unwrap_or_default(); | ||
|
||
// Left for the reviewer to verify discrepancy. | ||
// println!("STORAGE INFO MAX SIZE: {:?}", &max_collection_size); | ||
// let key = Blake2_128Concat::max_len::<CollectionId>(); | ||
// let value_size = AccountId::max_encoded_len() + Balance::max_encoded_len() + (8 * 4); | ||
// println!("MAX CALCULATED SIZE: {:?}", key + value_size); | ||
|
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.
Found a discrepancy between the result of storage_info().max_size and the result I obtained calculating the size as shown.
Curious to hear if I missed anything.
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.
You are missing the struct CollectionDetails
, you are only accounting for the generic types of this struct :)
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.
This line supposedly accounts for those 🤔
// let value_size = AccountId::max_encoded_len() + Balance::max_encoded_len() + (8 * 4);
pub struct CollectionDetails<AccountId, DepositBalance> {
/// Collection's owner.
pub owner: AccountId,
/// The total balance deposited by the owner for all the storage data associated with this
/// collection. Used by `destroy`.
pub owner_deposit: DepositBalance,
/// The total number of outstanding items of this collection.
pub items: u32,
/// The total number of outstanding item metadata of this collection.
pub item_metadatas: u32,
/// The total number of outstanding item configs of this collection.
pub item_configs: u32,
/// The total number of attributes for this collection.
pub attributes: u32,
}
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.
Apart from the internal conversation we had regarding this PR everything looks good to proceed to making this ready for a final review!
pop-runtime-devnet = { path = "runtime/devnet", default-features = true } # default-features=true required for `-p pop-node` builds | ||
pop-runtime-mainnet = { path = "runtime/mainnet", default-features = true } # default-features=true required for `-p pop-node` builds | ||
pop-runtime-testnet = { path = "runtime/testnet", default-features = true } # default-features=true required for `-p pop-node` builds | ||
pop-runtime-devnet = { path = "runtime/devnet", default-features = true } # default-features=true required for `-p pop-node` builds |
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.
unnecessary fmt changes
// Accounts for the key length + | ||
// Value max length without name and symbol, which are accounted per byte. |
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.
fmt
let max_collection_size = pallet_nfts::Collection::<Runtime>::storage_info() | ||
.first() | ||
.and_then(|info| info.max_size) | ||
.unwrap_or_default(); | ||
|
||
// Left for the reviewer to verify discrepancy. | ||
// println!("STORAGE INFO MAX SIZE: {:?}", &max_collection_size); | ||
// let key = Blake2_128Concat::max_len::<CollectionId>(); | ||
// let value_size = AccountId::max_encoded_len() + Balance::max_encoded_len() + (8 * 4); | ||
// println!("MAX CALCULATED SIZE: {:?}", key + value_size); | ||
|
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.
You are missing the struct CollectionDetails
, you are only accounting for the generic types of this struct :)
Adds assets into mainnet runtime:
Refactors
ProxyType
such that assets calls are taken into account.Relevant configuration:
pallet-assets
pallet-nfts
I'd like to bring the attention to the item
NftsItemDeposit
. The cost for this deposit is ~0.208
DOT. Considering that this is held by item. I'd suggest to lower this value to something more similar to0.01
DOT. Lowering the barrier to access to the assets created in these collections.I'm not that concerned about the rest of deposits myself, but happy to hear different opinions.
Relevant reference to tackle these numbers: RFC#45
[sc-2764]