Skip to content

SGX to TDX#140

Draft
eladiosch wants to merge 52 commits intomasterfrom
feat/tdx
Draft

SGX to TDX#140
eladiosch wants to merge 52 commits intomasterfrom
feat/tdx

Conversation

@eladiosch
Copy link
Copy Markdown
Contributor

This PRs modifies GuardianModule to use the new TDX instead of the deprecated SGX

@eladiosch eladiosch requested a review from ksatyarth2 February 3, 2026 11:13
@@ -51,46 +56,29 @@ contract GuardianModule is AccessManaged, IGuardianModule {
*/
uint256 internal _threshold;
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.

a better natspec for this variable like _ejectionThreshold

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

import { ALGO_ID_ES256K } from "@automata-network/automata-tee-workload-measurement/types/Constants.sol";

/**
* @title Guardian module
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.

change natspec description to remove enclave keys

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

* @notice Thrown if the Commitment does not match the workload verifier
* @dev Signature "0x5054097b"
*/
error CommitmentMismatch();
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.

unused error

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

* @dev Signature "0x6e41f97e85009a93fbd7a9e9c885b782819739d41a903d21bb4ad7a40d1af83a"
*/
event MrSignerChanged(bytes32 oldMrSigner, bytes32 newMrSigner);
event RotatedGuardianKey(bytes32 ownerFingerprint, address computedAddress);
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.

unused event

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

emit MrSignerChanged(_mrsigner, newMrSigner);
_mrenclave = newMrEnclave;
_mrsigner = newMrSigner;
function setAllowedWorkload(bytes32 workloadId, bool allowed) external restricted {
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.

check for workloadId != 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Check added to code and test

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mainnet-contracts/src/GuardianModule.sol 81.48% 5 Missing ⚠️
Files with missing lines Coverage Δ
mainnet-contracts/src/PufferProtocol.sol 94.16% <100.00%> (+0.34%) ⬆️
mainnet-contracts/src/GuardianModule.sol 89.85% <81.48%> (+4.47%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eladiosch eladiosch changed the base branch from hoodi-deployment to master March 20, 2026 13:12
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