Skip to content

design - tee upgradability - #149

Open
paolocappelletti wants to merge 35 commits into
devfrom
pc/tee_upgrade
Open

paolocappelletti wants to merge 35 commits into
devfrom
pc/tee_upgrade

Conversation

@paolocappelletti

Copy link
Copy Markdown
Collaborator

No description provided.

@paolocappelletti
paolocappelletti requested a review from saratnt July 2, 2026 15:44
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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is acceptedPcr0 checked and not directly activeImage ? Shouldn't only the activeImage be the one that can update the keys?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct: let's use the activeImage

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed!

Comment thread docs/design/EXECUTOR_TEE_UPGRADE_DESIGN.md
Comment thread docs/design/EXECUTOR_TEE_UPGRADE_DESIGN.md Outdated
Comment thread docs/design/EXECUTOR_TEE_UPGRADE_DESIGN.md
Comment thread docs/design/EXECUTOR_TEE_UPGRADE_DESIGN.md
Comment thread docs/design/EXECUTOR_TEE_UPGRADE_DESIGN.md Outdated
| 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) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants