Skip to content

Shared Secret Fixes#492

Merged
lydiagarms merged 3 commits into
masterfrom
lyd/sharedSecretOwnershipFix
Jul 13, 2026
Merged

Shared Secret Fixes#492
lydiagarms merged 3 commits into
masterfrom
lyd/sharedSecretOwnershipFix

Conversation

@lydiagarms

@lydiagarms lydiagarms commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #472. This PR fixes two issues relating to shared secret variables and adds a more user friendly error message:

  • Fixes a bug, where for shared secret variables that are modified in a function where there is a require statement such as require(msg.sender == admin), the ownership of the variable is assigned to the admin. This means the new commitment will be created under the admins public key and not the sharedPublicKey, which is what we want by default.
  • Introduces a fix in the event listener for shared secret variables. Say there are shared between Clients A and B, when client A nullifies one of these variables it will update its own commitment DB, but client B will not know that the commitment is nullified. In this PR, when the commitment DB is accessed we check the nullification is update with the onchain state.
  • Adds an error message, when in orchestration a usable commitment cannot be found.

Checklist

  • Tests added/updated
  • CI passes
  • No secrets/keys committed
  • Docs updated (if needed)
  • Backwards compatible (or noted breaking change)

How to test

  1. Test with Swap.zol where startSwap can only be called by an admin,

…t also fix the owner via the require statement, the sharedPublicKey is used for new commitments
@lydiagarms lydiagarms requested review from SwatiEY and Wei-257 June 4, 2026 15:17
@lydiagarms lydiagarms changed the title fix(orchestration): ensure that for functions with shared secrets tha… Fix ownership of shared secret variables Jun 4, 2026
@lydiagarms lydiagarms marked this pull request as ready for review June 4, 2026 15:22
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch 2 times, most recently from 2b79ede to 36b304c Compare June 5, 2026 14:39
@lydiagarms lydiagarms changed the title Fix ownership of shared secret variables Shared Secret Fixes Jun 10, 2026
Comment thread src/boilerplate/common/commitment-storage.mjs Outdated
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch 4 times, most recently from 40baa09 to 0abe2a1 Compare June 11, 2026 11:36
Comment thread src/boilerplate/common/backup-encrypted-data-listener.mjs Outdated
Comment thread src/codeGenerators/orchestration/files/toOrchestration.ts Outdated
Comment thread src/codeGenerators/orchestration/files/toOrchestration.ts Outdated
Wei-257
Wei-257 previously approved these changes Jul 7, 2026
@lydiagarms lydiagarms requested a review from AdarshRon July 7, 2026 10:07
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch 2 times, most recently from 784d97d to 64acbf6 Compare July 7, 2026 12:34
Comment thread src/boilerplate/common/backup-encrypted-data-listener.mjs Outdated
AdarshRon
AdarshRon previously approved these changes Jul 10, 2026
Wei-257
Wei-257 previously approved these changes Jul 10, 2026
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch from 64acbf6 to b012534 Compare July 10, 2026 11:23
@lydiagarms lydiagarms dismissed stale reviews from AdarshRon and Wei-257 via 905b12b July 10, 2026 14:02

@AdarshRon AdarshRon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

…n't be found with the correct state variable id
@lydiagarms lydiagarms force-pushed the lyd/sharedSecretOwnershipFix branch from 905b12b to 1820628 Compare July 13, 2026 10:55
@lydiagarms lydiagarms merged commit 7e5e1a7 into master Jul 13, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.10.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ownership of shared address variables

4 participants