Skip to content

fix: input share store safe v2#213

Merged
metallicalfa2 merged 7 commits intomasterfrom
fix/input-share-store-safe-2
Jul 11, 2023
Merged

fix: input share store safe v2#213
metallicalfa2 merged 7 commits intomasterfrom
fix/input-share-store-safe-2

Conversation

@guru-web3
Copy link
Copy Markdown
Contributor

No description provided.

const tb2 = new ThresholdKey({ serviceProvider: customSP, storageLayer: customSL, manualSync: mode });
await tb2.initialize({ neverInitializeNewKey: true });
tb2.inputShareStore(resp1.deviceShare);
await tb2.inputShareStoreSafe(resp1.deviceShare);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we deprecating inputShareStore and use only inputShareStoreSafe for all usage ?
if so, we can check for if polynomial_id is equal with the tkey's latest polynomial and update it without catchupToLatestShare.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, we should make inputShareStore internal or mark internal somehow. With existence of core kit, tkey has more room to be "swiss army knife"

Comment thread packages/core/src/core.ts Outdated
const latestShareRes = await this.catchupToLatestShare({ shareStore: ss, includeLocalMetadataTransitions: true });
// if not in poly id list, metadata is probably outdated
// is !this.metadata.polyIDList.includes(latestShareRes.latestShare.polynomialID)
if (!latestShareRes.shareMetadata.polyIDList.find((tuple) => tuple[0] === this.metadata.getLatestPublicPolynomial().getPolynomialID())) {
Copy link
Copy Markdown
Contributor

@ieow ieow Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this before the comment as the comment are meant for line 821

can add comment for this new code checking
check if the latest share is part of the current tkey instances

Copy link
Copy Markdown
Contributor

@ieow ieow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@metallicalfa2 metallicalfa2 merged commit 637e0f4 into master Jul 11, 2023
@metallicalfa2 metallicalfa2 deleted the fix/input-share-store-safe-2 branch July 11, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants