-
Notifications
You must be signed in to change notification settings - Fork 790
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
Get parachain runtime/code upgrades off chain #971
Comments
"I have code" is not enough, although it's maybe a valid optimization. A malicious chain can upgrade its code hash but then not give any honest validators the code. At this point, the malicious chain can attempt repeatedly to sneak through a bad block, either blocks survive due to early DoS attacks on approval checkers, or else approval checkers all no-show due to lacking code and we abandon the block. It's similarly problematic if WASM crashes when building the code. We need to put code into the availability system, and eventually recover code from availability. It follows code should be distributed as parachain blocks, with backers and approval checkers doing builds. All this ensure some validator claims the code builds correctly |
Not sure I can follow. If not enough validators sign off that they have the code, the code update will never go live, so a malicious actor not providing the code can do no harm at all. The system described above is actually rather similar to the availability system, except that we don't chunk the data as all validators need the full data anyways. So in summary, code gets distributed and only when enough validators said (with a signed message) that they have the code (similar to bitfields), the update can go live at some point, if not, it can not. In that case it can either be abandoned after some timeout or just overwritten by another attempt. About the second problem: The code distributed is already wasm, so it does not need to be built - just compiled for performance reasons maybe. If that code is faulty, then after upgrade the parachain won't be able to make any more progress. This is no different to what we have now though - we also just put the code on chain, without any further verification (that I am aware of). I am also not sure if there is a meaningful way of verifying the code ahead of time (apart from sanity checks). On the other hand, It should not be necessary, as the code comes from execution of the PVF executed by validators, which we trust to do sane stuff, if executed faithfully (which we do check). |
Yes, all validators having the full code before voting works fine for parachains. A priori, we'll likely want erasure coded distribution for parathreads however since some validators never run some parathreads, except we'll likely run parathreads in large pools all with identical code. |
Some discussion of validator-set hand-offs (session change) is also required |
With contextual execution statements are out of the "hot path" - will no longer need to propagate within 2 seconds, thus is issue becomes mostly about reducing load on chain storage. |
In my opinion, maybe the best way to do this is the following:
This doesn't impact parachain liveness, as the parachain continues to operate with the old code until the new code is posted on-chain (and other checks pass and the This is a very simple solution because it punts the problem of actually delivering the code to the relay chain completely off-chain. Parachain operators can manually post it but would eventually have bots to do it for them. And we don't need to implement a complex gossip protocol. With asynchronous backing (formerly contextual execution) this issue is also about reducing statement-distribution code complexity as we could completely kill the large-statement codepaths as a result. That's a major net benefit. |
paritytech#971) * reward relayer from asset hub sovereign account that matches asset hub * fix tests * updates sovereign account * refactor * fixes * updates template parachain sovereign account --------- Co-authored-by: claravanstaden <Cats 4 life!>
Right now we distribute a parachain runtime upgrade via the relay chain and statement distribution, which cannot really work long term as statement distribution is time critical and parachain runtime upgrades can be large, to make matters worse - that large data is transferred twice in a time critical path - once in statements and then in the distributed relay chain block. Storing large amounts of data in chain storage is also not good for performance.
Plan for resolving this:
Reasoning:
Open questions:
I have code messages
do the rest.I have code messages
protocol for full nodes, where those messages are not signed, so runtime upgrades can also be propagated by any non validator node on the network (reducing load on validators). Validators would not even need to be part of that gossip, so this could be implemented in a strictly load reducing way.The text was updated successfully, but these errors were encountered: