Open S3bb1 opened 3 years ago
@BenjaminMoe I think I had you look at this issue on the upstream, please make sure to cross link so we get their fixes implemented.
I think this is related: https://github.com/decentralized-identity/sidetree/pull/1172#pullrequestreview-857505779
@BenjaminMoe can you confirm.
Hi all,
i found a possible endless loop when resolving a DID document.
Test scenario:
When executing these three operations in order with the following order
sidetree.js runs into an endless loop during calculation of the didState. This is because i updated the DID document with 2 times the same "updateCommitment" hash.
In the resolver where the
commitValueToOperationMap
is processed i have for the same entry two values:now the while loop in https://github.com/transmute-industries/sidetree.js/blob/main/packages/core/src/Resolver.ts#L151 checks if the map has the
nextUpdateCommitmentHash
and continues the loop. MynextUpdateCommitmentHash
is always the same like in the picture aboveEiC3h5hjrIw4_DpeS0zF4ZjuQ_7sHQcEuOYTG9vNp9LuLQ
and the while loop never finishes.Solution would be that the already processed keys are deleted from the map.
I have also looked into the original Sidetree repo and it seems that the same issue exists there too.