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

Marcopremier fix confirmcomputationparticipant #1272

Merged
merged 7 commits into from
Oct 11, 2023

Conversation

Marco-Premier
Copy link
Contributor

PR to solve issue #1269

@wfa-reviewable
Copy link

This change is Reviewable

Copy link
Contributor

@uakyol uakyol left a comment

Choose a reason for hiding this comment

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

The code looks good to me thanks for the quick fix Marco.
We also need to update the unit tests for this change. Can you add it to this PR please?

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @SanjayVas and @stevenwarejones)

Copy link
Contributor Author

@Marco-Premier Marco-Premier left a comment

Choose a reason for hiding this comment

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

Hey @uakyol just added the test :)

Reviewable status: 1 of 3 files reviewed, all discussions resolved (waiting on @SanjayVas and @stevenwarejones)

Copy link
Contributor

@uakyol uakyol left a comment

Choose a reason for hiding this comment

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

thank you :), added some minor comments.

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


src/main/kotlin/org/wfanet/measurement/kingdom/service/internal/testing/ComputationParticipantsServiceTest.kt line 704 at r2 (raw file):

  @Test
  fun `confirmComputationParticipant succeeds with two duchies`() = runBlocking {

What do you think about changing the name to confirmComputationParticipant succeeds with a subset of registered duchies since 2 is arbitrary, we are trying to test if this would work if not all duchies are included.


src/main/kotlin/org/wfanet/measurement/kingdom/service/internal/testing/ComputationParticipantsServiceTest.kt line 705 at r2 (raw file):

  @Test
  fun `confirmComputationParticipant succeeds with two duchies`() = runBlocking {
    val duchies = DUCHIES.take(2)

consider using droplast() (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/drop-last.html).
This way if someone changes the DUCHIES in the Population class to 2 duchies this test will still be correct.


src/main/kotlin/org/wfanet/measurement/kingdom/service/internal/testing/Population.kt line 90 at r2 (raw file):

    val WORKER1_DUCHY = DuchyIds.Entry(2, "worker1", VALID_ACTIVE_START_TIME..VALID_ACTIVE_END_TIME)
    val WORKER2_DUCHY = DuchyIds.Entry(3, "worker2", VALID_ACTIVE_START_TIME..VALID_ACTIVE_END_TIME)
    val DUCHIES = listOf(AGGREGATOR_DUCHY, WORKER1_DUCHY, WORKER2_DUCHY)

Consider adding an inactive duchy?
There are lots of other tests using this object and after those tests are refactored to account for this change. The functionality of removing a duchy should work. As things stand, we caught this bug but there might be others. This change would uncover more if any.

For example if we had an inactive duchy here, the above tests would have failed.

wdyt? If you think this is a good idea too, feel free to tackle this in another PR.

Copy link
Contributor Author

@Marco-Premier Marco-Premier 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: 2 of 3 files reviewed, 3 unresolved discussions (waiting on @SanjayVas, @stevenwarejones, and @uakyol)


src/main/kotlin/org/wfanet/measurement/kingdom/service/internal/testing/ComputationParticipantsServiceTest.kt line 704 at r2 (raw file):

Previously, uakyol wrote…

What do you think about changing the name to confirmComputationParticipant succeeds with a subset of registered duchies since 2 is arbitrary, we are trying to test if this would work if not all duchies are included.

Done.


src/main/kotlin/org/wfanet/measurement/kingdom/service/internal/testing/ComputationParticipantsServiceTest.kt line 705 at r2 (raw file):

Previously, uakyol wrote…

consider using droplast() (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/drop-last.html).
This way if someone changes the DUCHIES in the Population class to 2 duchies this test will still be correct.

yeah I agree even though some constraint will remain. e.g. if someone change the order of DUCHIES ad put the aggregator as last element in the list, test would fail.


src/main/kotlin/org/wfanet/measurement/kingdom/service/internal/testing/Population.kt line 90 at r2 (raw file):

Previously, uakyol wrote…

Consider adding an inactive duchy?
There are lots of other tests using this object and after those tests are refactored to account for this change. The functionality of removing a duchy should work. As things stand, we caught this bug but there might be others. This change would uncover more if any.

For example if we had an inactive duchy here, the above tests would have failed.

wdyt? If you think this is a good idea too, feel free to tackle this in another PR.

I see your point. I think it would be even more helpful to add a duchy which is active but is not a "required duchy" in any data provider.
Inactive duchy are automatically "dropped" when a measurement is created instead active ones my be added to the list of participant if the minimum number of required duchies is not met.

I'll follow up in a different PR :)

@SanjayVas SanjayVas requested a review from uakyol October 6, 2023 17:19
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 1 of 1 files at r1, 1 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Marco-Premier, @stevenwarejones, and @uakyol)


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/gcloud/spanner/writers/ConfirmComputationParticipant.kt line 145 at r3 (raw file):

  }

  private suspend fun TransactionScope.getComputationParticipants(

nit

Suggestion:

getComputationParticipantDuchyIds

Copy link
Contributor

@uakyol uakyol left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Marco-Premier and @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/kingdom/service/internal/testing/Population.kt line 90 at r2 (raw file):

Previously, Marco-Premier (marcopremier) wrote…

I see your point. I think it would be even more helpful to add a duchy which is active but is not a "required duchy" in any data provider.
Inactive duchy are automatically "dropped" when a measurement is created instead active ones my be added to the list of participant if the minimum number of required duchies is not met.

I'll follow up in a different PR :)

awesome thanks :)

@SanjayVas
Copy link
Member

Waiting on this for the 0.4.1 patch release.

Copy link
Contributor Author

@Marco-Premier Marco-Premier left a comment

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

@Marco-Premier Marco-Premier left a comment

Choose a reason for hiding this comment

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

Dismissed @uakyol from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/kingdom/service/internal/testing/Population.kt line 90 at r2 (raw file):

Previously, uakyol wrote…

awesome thanks :)

Done.

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 1 of 2 files at r2, 1 of 1 files at r3, 1 of 1 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Marco-Premier)

@Marco-Premier Marco-Premier merged commit 192c5ee into main Oct 11, 2023
4 checks passed
@Marco-Premier Marco-Premier deleted the marcopremier-fix-confirmcomputationparticipant branch October 11, 2023 13:38
SanjayVas pushed a commit that referenced this pull request Oct 11, 2023
PR to solve issue #1269

---------

Co-authored-by: marcopremier <[email protected]>

(cherry picked from commit 192c5ee)
SanjayVas pushed a commit that referenced this pull request Oct 11, 2023
PR to solve issue #1269

---------

Co-authored-by: marcopremier <[email protected]>

(cherry picked from commit 192c5ee)
ple13 pushed a commit that referenced this pull request Aug 16, 2024
PR to solve issue #1269

---------

Co-authored-by: marcopremier <[email protected]>
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.

ConfirmComputationParticipant checks status of non-participant Duchies
5 participants