Closed DrW3RK closed 3 months ago
This is the current code that calculates the "reserve deposit":
const reservedDeposit = useMemo(
() => (api.consts.registrar.paraDeposit as BalanceOf)
.add((api.consts.registrar.dataDepositPerByte as BalanceOf).muln(wasm ? wasm.length : 0))
.iadd((api.consts.registrar.dataDepositPerByte as BalanceOf).muln(genesisState ? genesisState.length : 0)),
[api, wasm, genesisState]
);
Also can be seen here. So If I am understand this correctly, we can replace all this logic with just MAX_CODE_SIZE?
That is correct.
Okay, cool thanks for the input, will get this adjusted!
On a closer look, the MAX_CODE_SIZE applies only to wasm. The genesis state length can vary. https://github.com/paritytech/polkadot-sdk/blob/ae0b3bf6733e7b9e18badb16128a6b25bef1923b/polkadot/runtime/common/src/paras_registrar/mod.rs#L682
Ahh okay so we're just replacing the wasm.length! Thanks
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
Due to the issue discussed here https://github.com/paritytech/polkadot-sdk/pull/2372 the deposit needed defaults to MAX_CODE_SIZE https://github.com/paritytech/polkadot-sdk/pull/3020
The fee for this transaction is hefty, with around 5 KSM and 40 DOT simply lost because the UI shows a lower value. More info here https://substrate.stackexchange.com/questions/11588/how-to-calculate-required-reserved-deposit-to-register-a-parachain-on-kusama-w