Skip to content

v1.6.0-rc0: TEE Secret node open sourcing

Pre-release
Pre-release
Compare
Choose a tag to compare
@Victor-Salomon Victor-Salomon released this 01 Sep 13:02
· 67 commits to next since this release

This release aims to:

  • improve 🔒 TEE Cluster/Enclaves interaction with SDK.
  • allow ⏱️ Metrics Server Reporting #173

⚠️ Important note: This release comes with several breaking changes and must be installed to use alphanet!

✋ This new version requires you to update your application accordingly: ✋
For now the following breaking changes only concern the Alphanet chain network (the updated TEE/SGX code is being tested on alphanet and not yet available on Mainnet).

  • This package version is currently available as a release-candidate version. It's close to the next stable version but is still subject to minor changes. It is only available and usable on the Alphanet chain network in a first time - before being deployed to Mainnet production network.

  • 📅 A release schedule of the Mainnet chain network will soon be provided.

Contributors: @Victor-Salomon

Breaking changes (4)

TEE Pallet Helpers in src/helpers/tee.ts

  • teeUpload() renamed to => teePost()
    • Migration information: update the name of the function.

  • getClusterData() now returns both the enclave operator address and enclave slot, alongside with clusterType ("Disabled" | "Admin" | "Public" | "Private").
    👀 If you intend to create a Secret NFT or a Capsule NFT, the good practice will be to filter the public clusters only, (unless you have access to a private or an admin cluster).
    (ClusterDataType updated according to new response format).
    • Migration information: Update the response according to the ClusterDataType and add a filter on "public" cluster types.

      From:
      {
      enclaves: string[ ]
      }
      ==> To:
      {
      enclaves: [string, number][ ]
      clusterType: "Disabled" | "Admin" | "Public" | "Private"
      }
      JSON Response example:
      {
      enclaves: [
      [ 5CcqaTBwW...pPVT3Xf8v7tC, 0]
      [ 5G1AGcU2...KGmhyV9DrzFs, 1]
      ...
      ]
      clusterType: Public
      }

  • teeKeySharesStore() now also return enclaveAddress, enclaveSlot, and operatorAddress
    (TeeSharesStoreType updated according to new response format).
    • Migration information: no particular thing to do after package upgrade.

  • getEnclaveHealthStatus() now also return block_number, sync_state, version. Date is not anymore returned. Under the hood, the status returned is now a true https status (this does not change anything from a code point of view but, provides a more accurate status code). About the sync_state key: When the returned status is 200, you also receive the new sync_state key info, which can be either a block "number", an empty string, or a "setup". Only the block "number" can be considered as an available enclave. This function automatically applies the check on status & sync_state. 😎
    (EnclaveHealthType updated according to the corresponding response retrurned by enclave health check).

    • Migration information: no particular thing to do after package upgrade unless you do any manual checks or use the returned response.
    • If you do and use the date key, remove it.
    • Reminder of this rule: only 200 http status providing a block "number" for the key sync_state can be considered as an available enclave.

Features Added (6)

TEE Pallet updated with METRICS SERVER REPORTING

nft/extrinsics:

  • submitMetricsServerReportTx()- Creates an unsigned unsubmitted Submit Metrics Server Report Transaction Hash for an Era.
  • submitMetricsServerReport()- Submit the metrics server report for a specific era. Returns a MetricsServerReportSubmittedEvent Blockchain event.

src/helpers/tee.ts

  • populateEnclavesData() - Populate enclaves data with addresses, slot and urls. This should be used rather than using the getClusterData()storage request.
  • getEnclaveDataAndHealth() - Get the enclave data from a cluster populated with a health check. This should be used rather than using the getEnclaveHealthStatus() helper.
  • getEnclavesQuote() generate the enclaves quote report.

helper/http.ts

  • getRaw() - return both data and raw HTTP status code

Storage Updated (1)

Tee Storage: src/tee/storage.ts

  • getClusterData() - see breaking change section

Fixes (3)

  • sharesAvailableOnTeeCluster() loop can't overpass the enclave's length anymore.
  • ensureHttps() now return an error in case of a missing URL.
  • mintCapsuleNFT() now handle dynamic cluster ids

Feel free to ask any question in discussion #175.