design - tee upgradability - #149
Open
paolocappelletti wants to merge 35 commits into
Open
paolocappelletti wants to merge 35 commits into
paolocappelletti wants to merge 35 commits into
Conversation
saratnt
reviewed
Jul 6, 2026
| if (enclaveKey.length != PK_LENGTH) revert InvalidPKLength(); | ||
|
|
||
| bytes memory candidate = _extractPcr0(pcrs); // pcrs[4 : 4 + PCR0_LENGTH], PCR0 is a fixed 48-byte SHA-384 | ||
| if (!acceptedPcr0[keccak256(candidate)]) revert InvalidPCR(); |
Contributor
There was a problem hiding this comment.
Why is acceptedPcr0 checked and not directly activeImage ? Shouldn't only the activeImage be the one that can update the keys?
Collaborator
Author
There was a problem hiding this comment.
correct: let's use the activeImage
| | 2 | Add `PCR0_new` to the **KMS key policy** (keep `PCR0_old`). | yes (remove it) | | ||
| | 3 | `proposePcr0Swap(PCR0_new)` on-chain. Old PCR0 still the only accepted/active image. | yes (let the proposal expire) | | ||
| | 4 | *(Audit / timelock window — users may verify the image or withdraw.)* | — | | ||
| | 5 | After `pcr0UpgradeDelay`, `applyPcr0Swap()`: `PCR0_new` joins the accepted set and becomes `activeImage`; `Pcr0Swapped` is emitted. The Manager drains and stops the old enclave; an operator launches the new EIF (manual step); the handshake recovers the key set via KMS. Service resumes. Both PCR0s are now accepted. | yes (instant on-chain rollback — see below) | |
Contributor
There was a problem hiding this comment.
Maybe the executor could be restarted only after the last result has been finalized, to be sure to avoid reorgs executed with 2 different versions of the executor.
Updated failure mitigation strategies for enclave upgrades.
Clarified the manual step for launching the new EIF after waiting to avoid reorgs.
St/hzn 2920 vela upgrade
saratnt
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.