0

Background

Transaction Mortality is described on the Polkadot Wiki as:

Extrinsics can be mortal or immortal... If the extrinsic is not included in a block within this validity window, it will be discarded from the transaction queue.

The chain only stores a limited number of prior block hashes as reference. You can query this parameter, called BlockHashCount, from the chain state or metadata. This parameter is set to 2400 blocks on Polkadot (about four hours) at genesis...

Setting the block checkpoint to zero, using the genesis hash, and a validity period of zero will make the transaction "immortal".

Motivation

I would like to change (increase or decrease) the maximal lifetime of a transaction in on my network.

I see I can set the BlockHashCount on my chain in the node template runtime but the wiki implies that it cannot be changed from genesis. It also implies that this parameter affects much more than the behavior of the "cached" hashes on the node from the description above, so it's unclear why this may be unsafe to modify, or if there is another means to only change the behavior of what is the maximal validity period for a transaction to be included, at the runtime level, and (separately) at the transaction pool level.

Question

Is it safe to perform a runtime upgrade to update BlockHashCount, and if so, what side effects will this have?

1 Answer 1

3

How does the Wiki imply that changing it is unsafe?

Changing it will just affect the size of the storage trie under FRAME System. Since Substrate uses a base 16 trie, you'd have to go to a really high count to affect trie depth.

In fact, Kusama has already upgraded its BlockHashCount. At genesis, it was 250.

The change: https://github.com/paritytech/polkadot/pull/1086

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.