-
Notifications
You must be signed in to change notification settings - Fork 13
Modifiable property limits #1119
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
base: develop
Are you sure you want to change the base?
Conversation
@@ -34,13 +34,19 @@ const SEED: u32 = 1; | |||
fn create_max_item_data<T: Config>( | |||
users: impl IntoIterator<Item = (T::CrossAccountId, u128)>, | |||
) -> CreateItemData<T> { | |||
let properties = (0..MAX_PROPERTIES_PER_ITEM) | |||
.map(|property_id| max_property(property_id, MAX_PROPERTIES_PER_ITEM)) |
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.
.map(|property_id| max_property(property_id, MAX_PROPERTIES_PER_ITEM)) | |
.map(|property_id| max_property(property_id, MAX_DATA)) |
?..
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.
Не, там расчёт сколько можно в отдельный проперти воткнуть, чтобы забить мапу до предела по данным, учитывая общее количество пропертей.
Я не уверен что это хорошо сделано, можно переделать. Кроме того, оно щас оверэстимейтит, т.к. оно пытается забивать токены до предела как будто метаданные не учитываются (CompactLen), так что внутри токенов в бенчмарках пишутся больше данных, чем туда реально может попасть на проде.
@ALFecki в Не хватает сейчас таких же тестов для проверки того, что всё то же самое правильно работает из Эфира (то есть надо ту же логику происпользовать -- с коллбеком, который создаёт/модифицирует токены из-под Эфира). Ну и не хватает отдельного тупого теста, который проверяет что лимит пропертей можно выставить через Эфир, а не только через Субстрат |
consumed_space + key_size + value_size < limit
was checked without accounting for the old value size under the given key)