MatrixAI / Polykey-CLI

Polykey CLI - Open Source Decentralized Secret Sharing System for Zero Trust Workflows
https://polykey.com
GNU General Public License v3.0
6 stars 3 forks source link

Failure to Update Gestalt with New Node ID and Issues with Discovery Mechanism Transparency #163

Closed CryptoTotalWar closed 5 months ago

CryptoTotalWar commented 5 months ago

Describe the Bug(s)

Issue 1: Stale Node ID Data Retention

Issue 2: Inefficient Discovery Mechanism

To Reproduce

  1. User A discovers User B's Node ID with polykey identities discover.
  2. User B destroys their node and recreates a new one, leaving the old cryptolink intact.
  3. User A attempts to rediscover User B, but the old Node ID remains visible.

Note: For the demo, in order for us to solve for this, manual deletion of the cryptolink on GH was required after deleting the old node.

Expected Behavior

Proposed Solutions

Screenshots/Logs

(attach relevant screenshots or logs here, when recreating the issue.)

Platform

Additional Context

Links to Related GitHub Issues

Notify maintainers

(Use git blame or refer to Discord conversations to identify relevant contributors.)

linear[bot] commented 5 months ago

ENG-29 Failure to Update Gestalt with New Node ID

CMCDragonkai commented 5 months ago

Looks good. My only recommendations is capturing screenshots of the cryptolinks and a excalidraw diagram that usually explains things that are complex to be more easier to understand. We usually use sequence diagrams. But for this it can be even more basic.

tegefaulkes commented 5 months ago

I think this would normally be two separate Issues, One for each of the problems you outlined at the top.

As for the problems.

Issue 1

The system fails to update gestalts with new Node IDs when a node is destroyed and recreated. Old cryptolinks are not automatically removed, causing outdated information to persist.

What do you mean by re-created? Deleting a node and creating a new one is strictly a new separate node. It doesn't replace the old one implicitly in any form. It is strictly a new node.

Using a recovery code can generate a node from scratch, this can be considered re-creating a node. Functionally it is the same node, same keys and identity. But there is no way for us to re-create the sigchain and by extension any of the cryptiolinks. This means any of the cryptolinks on other nodes or in the github gists are no longer valid for this node. Any links will need to be manually re-created.

So going by the steps outlined above, What you're expecting and seeing as the problem can't actually be implemented. Maybe I'm just missing some details?

Issue 2

The background discovery system lacks transparency and does not work well with multiple cryptolinks, failing to prioritize the most recent cryptolinks. Manual rediscovery does not update the gestalt with a new Node ID, leading to stale data issues.

This seems like a few issues in one?

In the future, if there are multiple issues you should break it down to a list and make very clear what each problem is. Make very clear that.

  1. What is it doing?
  2. What should it be doing?

Also when outlining the reproducible steps, it helps me a lot if you give a very clear list of each command you ran and the order you ran it.

tegefaulkes commented 5 months ago

After discussing it with @CryptoTotalWar I have a clearer idea of the problem. I'll write up some more details later. The core of it is that the discover isn't properly handling multiple claims on a single identity.

tegefaulkes commented 5 months ago

With the recent released version we should be able to properly re-discover a vertex now. @amydevs Also did some testing and found that the discovery process was in fact handling multiple cryptolinks just fine. Automatic removal of dead links is not really something we need right now. If we need that, it can be discussed in #164

So I think all of the main points here are addressed now. I'm going to close this.

CMCDragonkai commented 4 months ago

There is still a problem with a user having multiple cryptolinks on the same GitHub identity. @aryanj recently had this problem where he had claimed GitHub multiple times using the SAME node. And then when I tried to discover github.com:aryanjassal it resulted in a task time out in the agent logs.

It shows up as:

WARN:polykey.PolykeyAgent.task v0phkmdj0tlo0146ppc9ce79g0k:Failed - Reason: ErrorTaskTimeOut
CMCDragonkai commented 4 months ago

Will be starting a new issue on this problem @aryanj unless you've already posted a bug?