eliza icon indicating copy to clipboard operation
eliza copied to clipboard

feat: RP for plugin-tee-verifiable-log-api

Open gene-zhan opened this issue 1 year ago • 9 comments

Relates to:

  1. Run verifiable Eliza in the TEE.
  2. Verifiable log for Eliza in the TEE
  3. https://github.com/ai16z/eliza/pull/1259

Risks

Low

Background

What does this PR do?

This PR builds upon plugin-tee-verifiable-log by modifying the direct client to add remote attestation and query interfaces for verifiable logs.

To better understand what verifiable logs are and why we implemented this feature, it is necessary to refer to the preceding PR that introduces plugin-tee-verifiable-log and provides the context for its development.

What kind of change is this?

  • Feature
  • TEE plugin
  • Verifiable feature

Documentation changes needed?

Yes, we will add documentation about api detail.

Testing

Where should a reviewer start?

  1. Understand the existing plugin-tee

    1. We rely on Eliza's existing plugin-tee and use its key derivation interface.
  2. To better understand what verifiable logs are and why we implemented this feature, it is necessary to refer to the preceding PR that introduces plugin-tee-verifiable-log and provides the context for its development.

  3. Understand what plugin-tee-verifiable-log does

    1. Derive a key pair for verifiable logs: It uses the TEE to derive a key pair specifically for signing verifiable logs.
    2. Remote attestation: The public key of verifiable logs is embedded in the remote attestation report, making it accessible for external verification.
    3. Sign logs: This plugin accepts logs passed in from external modules (e.g., tweets sent and received by a Twitter client, or executed actions), signs them with the TEE-derived key pair, and stores them in the database.
    4. Verification: External entities can use the remotely attested public key to verify these logs, ensuring that certain actions were indeed performed by TEE Eliza.

Detailed testing steps

It have completed the integration tests and can run the pnpm test file in the test directory.

gene-zhan avatar Dec 20 '24 02:12 gene-zhan

is this a duplicate of #1259 ?

odilitime avatar Dec 20 '24 04:12 odilitime

LGTM, outside of the 1 suggested edit. I can help document tomorrow and run a test to fix any bugs i may encounter

HashWarlock avatar Dec 20 '24 07:12 HashWarlock

~@odilitime~ @gene-zhan what are the @gene-sf changes? Is that some automation? I'm approving this PR now

HashWarlock avatar Dec 22 '24 01:12 HashWarlock

~@odilitime~ @gene-zhan what are the @gene-sf changes? Is that some automation? I'm approving this PR now

sorry,I have configured two GitHub accounts locally. The problem with @gene-sf is that I forgot to switch the configuration file when submitting the code.

I have completed the following operations:

  • [x] According to your review, I have fixed the code.
  • [x] Updated the readme that is easier to understand.
  • [x] Merged the latest version of main code.

gene-zhan avatar Dec 22 '24 04:12 gene-zhan

@shakkernerd I noticed that PRs #1331 and #1333 were reopened and this PR closed, which has left me a bit confused about the current direction. Should I merge my changes into the develop branch, or is there a different branch we should treat as the standard? I’ve submitted #1369. both cpppppp7 and I have been working diligently to make progress on this code contribution. I’d appreciate any clarification to ensure we align our efforts effectively. 😊

gene-zhan avatar Dec 22 '24 10:12 gene-zhan

Hi @gene-zhan Thanks for bringing this to my attention. PRs that were closed about 5hours ago were due to develop branch getting accidentally deleted. And yes, the develop remains the standard to open PRs to.

Good to hear about your active contributions. Apologies for the confusion.

shakkernerd avatar Dec 22 '24 12:12 shakkernerd

@shakkernerd Thank you for your response! I accidentally submitted duplicate PRs (#1259 #1260 #1331, #1333, and #1369). I recommend prioritizing the merge of #1369, as this branch already includes the latest develop code. The other branches contain the same code but currently have conflicts that need to be resolved. Merging #1369 would help reduce additional workload. Thank you again for your understanding and support! 😊

gene-zhan avatar Dec 22 '24 14:12 gene-zhan

@shakkernerd @odilitime @HashWarlock How can I help facilitate the merging of this PR?

gene-zhan avatar Dec 23 '24 08:12 gene-zhan

Hi @gene-zhan which PRs do you need attention on and which ones should be closed?

shakkernerd avatar Dec 23 '24 09:12 shakkernerd

@shakkernerd

I would like to request the following actions:

  1. Close the following pull requests (PRs):
  • #1259
  • #1260
  • #1331
  • #1333 These PRs are no longer needed, and we can safely close them.
  1. Merge PR #1369 Please proceed with merging PR #1369 into the develop branch as it contains the necessary updates/fixes we need. Let me know if there are any issues or additional steps required. Thank you!

gene-zhan avatar Dec 23 '24 15:12 gene-zhan

Okay, thanks for listing them out. I will get to it.

shakkernerd avatar Dec 23 '24 17:12 shakkernerd

Closing in favor of #1369

shakkernerd avatar Dec 23 '24 17:12 shakkernerd