-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Start counting expected_at
from the inclusion
#4601
Comments
What is the upgrade enactment? Or better, what do you mean by this? |
Sorry, it is indeed confusing. I meant there, that we should count the delay not from the relay-parent but rather from the block number when the candidate that signalled the upgrade was enacted. |
Ahh okay. So this should also solve this problem: #4248? |
Not quite! The main target of this issue is to fix the violation of the guarantee, that at the first usage of the new PVF, the chain can revert for Footnotes
|
Can you again describe the problem? I don't really understand it 🙈 |
Ok, let's try with an example of how it works now: Let's assume that The purpose of This can be fixed if we started counting down the |
Why will we dispute this one? If the relay chain reverted 600 blocks, anything on the old chain can be discarded? We don't even need to validate it? And is |
That's correct. However, IIUC, we want to punish each time, otherwise it's a free try.
Yeah, theoretically reverts can go past that. The idea of |
That means by "invalid" you mean that someone from the primary backers issued an incorrect attestation?
Okay, so after this issue you will have the full Nevertheless, counting from inclusion sounds more reasonable. |
Yeah,
Yeah exactly! It's not a big issue. |
Right now, the first relay-chain block at which parachain can upgrade its code (dubbed
expected_at
) is counted from the relay-parent 1. The delay is specified by thevalidation_upgrade_delay
. This delay acts as a safeguard: the relay-chain can be reverted up to this number of blocks after the upgrade, and still the upgraded code can be found in the relay-chain and can be retrieved via thevalidation_code_by_hash
runtime API.However, right now, this property is broken by a couple of blocks: the problem is that if the relay-chain is reverted by
validation_upgrade_delay
we will return to the relay-parent, and the validation code will be only stored at the time the candidate is enacted. More specifically, there are two factors at play:chain_availability_period
orthread_availability_period
which is also a couple of blocks.The solution to this problem would be to start counting the delay from the enacting the candidate that scheduled the upgrade and not from the relay-parent of that candidate.
This should be changed/enabled only when every parachain follows the go-ahead signal, i.e. has this paritytech/cumulus#517 on board. This was released as part of Cumulus polkadot-v0.9.122.
Footnotes
Historically, I think we started counting from the relay-parent because otherwise the parachain does not know at which relay-chain block
expected_at
will be. This was important when the upgrades were coordinated based on block numbers. With https://github.com/paritytech/polkadot/pull/3371 this is no longer important since the relay-chain in control when the upgrade should happen. ↩In fact, https://github.com/paritytech/polkadot/pull/4457 initially came with this fix. However, it was then dropped since we discovered that there are parachains that do not support go-ahead signal and thus will be broken by this change. ↩
The text was updated successfully, but these errors were encountered: