Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in HMSS implementation. #1611

Merged
merged 5 commits into from May 13, 2024
Merged

Fix bugs in HMSS implementation. #1611

merged 5 commits into from May 13, 2024

Conversation

renjiezh
Copy link
Contributor

@renjiezh renjiezh commented May 8, 2024

  • Bypass ShufflePhaseInput blob from SETUP_PHASE to SHUFFLE_PHASE for worker2.
  • ShufflePhase correctly sorts RequisitionsList.
  • VerifySecretSeed in ShufflePhase correctly interpret secret seed ciphertext.
  • Handle PublicApiVersion for secret seed.
  • Get non-aggregator ids from protocol config instead of SystemComputation.

@wfa-reviewable
Copy link

This change is Reviewable

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 12 of 12 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ple13 and @renjiezh)

a discussion (no related file):
nit: "Fix bugs" is too vague. Be more specific in PR description, even if that just means adding a list of the bugs fixed after the title.



src/main/kotlin/org/wfanet/measurement/duchy/daemon/herald/HonestMajorityShareShuffleStarter.kt line 84 at r1 (raw file):

            val privateKeyHandle = TinkPrivateKeyHandle.generateHpke()
            requireNotNull(privateKeyStore) { "privateKeyStore cannot be null" }

nit: put precondition checks as early as possible. No need to wait until computationDetails is being built.

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 12 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ple13, @renjiezh, and @SanjayVas)

a discussion (no related file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

nit: "Fix bugs" is too vague. Be more specific in PR description, even if that just means adding a list of the bugs fixed after the title.

I agree - please list out the defects and the remediations



src/main/kotlin/org/wfanet/measurement/duchy/daemon/herald/Herald.kt line 81 at r1 (raw file):

  private val protocolsSetupConfig: ProtocolsSetupConfig,
  private val clock: Clock,
  private val privateKeyStore: PrivateKeyStore<TinkKeyId, TinkPrivateKeyHandle>? = null,

when is null a valid use case?


src/main/proto/wfa/measurement/internal/duchy/protocol/honest_majority_share_shuffle.proto line 155 at r1 (raw file):

    // The list of ids of non-aggregators participating in this computation.
    repeated string non_aggregators = 3;

shouldn't we also have an aggregator field?

Copy link
Member

@kungfucraig kungfucraig left a comment

Choose a reason for hiding this comment

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

Can you describe what is being fixed in the PR description?

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ple13, @renjiezh, and @SanjayVas)

Copy link
Contributor Author

@renjiezh renjiezh left a comment

Choose a reason for hiding this comment

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

Reviewable status: 10 of 12 files reviewed, 2 unresolved discussions (waiting on @ple13, @SanjayVas, and @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/duchy/daemon/herald/Herald.kt line 81 at r1 (raw file):

Previously, stevenwarejones (Steven Ware Jones) wrote…

when is null a valid use case?

privateKeyStore is used for the encryption keys for secret seed. Aggregator does not need it for now.


src/main/proto/wfa/measurement/internal/duchy/protocol/honest_majority_share_shuffle.proto line 155 at r1 (raw file):

Previously, stevenwarejones (Steven Ware Jones) wrote…

shouldn't we also have an aggregator field?

This non-aggregators field is only used to check whether the aggregator receives both input blob from non-aggregators.

Copy link
Contributor

@ple13 ple13 left a comment

Choose a reason for hiding this comment

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

Reviewed 12 of 12 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @renjiezh and @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/duchy/daemon/mill/shareshuffle/HonestMajorityShareShuffleMill.kt line 247 at r1 (raw file):

  private fun aggregatorStub(): ComputationControlCoroutineStub {
    // The last participant is the aggregator.

nit: remove the comment line.

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 12 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @renjiezh)


src/main/kotlin/org/wfanet/measurement/duchy/daemon/herald/Herald.kt line 81 at r1 (raw file):

Previously, renjiezh wrote…

privateKeyStore is used for the encryption keys for secret seed. Aggregator does not need it for now.

in the init, what if we check to see if the duchyId is "aggregator" or soemthing like that and throw an error if its not an aggregator but privateKeyStore is null.


src/main/proto/wfa/measurement/internal/duchy/protocol/honest_majority_share_shuffle.proto line 155 at r1 (raw file):

Previously, renjiezh wrote…

This non-aggregators field is only used to check whether the aggregator receives both input blob from non-aggregators.

when would an aggregator receive data from another aggregator?

Copy link
Contributor Author

@renjiezh renjiezh left a comment

Choose a reason for hiding this comment

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

Reviewable status: 10 of 12 files reviewed, 2 unresolved discussions (waiting on @ple13, @SanjayVas, and @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/duchy/daemon/herald/Herald.kt line 81 at r1 (raw file):

Previously, stevenwarejones (Steven Ware Jones) wrote…

in the init, what if we check to see if the duchyId is "aggregator" or soemthing like that and throw an error if its not an aggregator but privateKeyStore is null.

Good idea. I added checks in init {} for both herald and mill to fail it earlier. But to take care of both null and non-null usage, the parameter here will still be nullable.


src/main/proto/wfa/measurement/internal/duchy/protocol/honest_majority_share_shuffle.proto line 155 at r1 (raw file):

Previously, stevenwarejones (Steven Ware Jones) wrote…

when would an aggregator receive data from another aggregator?

Sorry I didn't make it very clear. This field is used for aggregator's WAIT_ON_AGGREGATION_INPUT phase to determine whether it has received all required AggregationPhaseInput from non-aggregators. This field contains two ids of non-aggregators so the aggregator just check them against the input blobs in storage.

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/duchy/daemon/herald/HonestMajorityShareShuffleStarter.kt line 84 at r1 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

nit: put precondition checks as early as possible. No need to wait until computationDetails is being built.

This is still happening inside of the DSL builder for computationDetails. I meant to move it to init.

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)

Copy link
Contributor Author

@renjiezh renjiezh left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)


src/main/kotlin/org/wfanet/measurement/duchy/daemon/herald/HonestMajorityShareShuffleStarter.kt line 84 at r1 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

This is still happening inside of the DSL builder for computationDetails. I meant to move it to init.

It has been done in Herald's init while the starter is just helper functions instead of a real class.

@renjiezh renjiezh merged commit aa2c919 into main May 13, 2024
4 checks passed
@renjiezh renjiezh deleted the renjiez-hmss-impl-patch branch May 13, 2024 16:57
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.

None yet

6 participants