Skip to content

Previous Operation was correct and applied the new Operation is Correct but no op(because it cannot be applied) In the case it cannot be applied, #880

Open
@mineme0110

Description

@mineme0110

In Prism Node, the CreateDIDOperation stores keys in the public_keys table, where there’s a constraint that the combination of key_id (name) and did_suffix must be unique. Similarly, for services, the combination of service_id and did_suffix must also be unique.

However, when performing an UpdateDIDOperation, I’ve noticed that there’s no check to ensure whether the provided key_ids or service_ids are already in use. As a result, if such an update operation is submitted on-chain, the syncing process fails because the SQL statements attempt to insert records that violate these composite unique key constraints.

https://github.com/input-output-hk/atala-prism/blob/main/src/main/scala/io/iohk/atala/prism/node/repositories/daos/PublicKeysDAO.scala#L15-L27

https://github.com/input-output-hk/atala-prism/blob/main/src/main/scala/io/iohk/atala/prism/node/repositories/daos/PublicKeysDAO.scala#L15-L27

https://github.com/input-output-hk/atala-prism/blob/main/src/main/scala/io/iohk/atala/prism/node/repositories/daos/ServicesDAO.scala#L49-L61

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions