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

unlynx_v2 the big and great cleanup #14

Merged
merged 50 commits into from
Apr 29, 2019
Merged

unlynx_v2 the big and great cleanup #14

merged 50 commits into from
Apr 29, 2019

Conversation

JoaoAndreSa
Copy link
Contributor

@JoaoAndreSa JoaoAndreSa commented Mar 29, 2019

I finished the big refactoring cleanup of Unlynx (let us call it v2 :P). I already merged it with master, but @ineiti if you see something that have missed or wrongly merged please let me know.

Since there are quite a lot of commits here is a list of the main changes:

1. Refactor of packages: I changed some of the packages:

  • Added a data package (contains the functions to generate fake data)
  • The proofs in the lib package have been split into different packages (add_rm, aggregation, deterministic_tag...)
  • no longer services/default package -> copied the files directly to services/

2. Cleanup: Deleted some unused code and added some more logs to catch all those naughty errors

3. Proofs: Homogenised and added hook functions for the proofs to define what to do with them (e.g. in unlynx we just create the proofs while in drynx we create them and send them to the skipchain).

4. Removed the PARALLELIZE flag: The parallelization is now by default.

5. Added a new protocol: shuffling+ddt protocol (does the shuffling and ddt in one single round)

6. Fixed #11 : just added the same for el == nil {...} in the HandleSurveyResponseQuery() to the HandleSurveyResultsQuery()

Please take a look at it and let me know if I should add or change things. This is the perfect time to do it (before I send it to master and create a new release).

JoaoAndreSa and others added 29 commits December 5, 2018 14:35
Changed shuffle proofs to account for any possible use for them (e.g.…
@JoaoAndreSa JoaoAndreSa requested a review from ineiti March 29, 2019 10:47
app/client.go Outdated
if err != nil {
log.Fatal("Service did not start.", err)
}

grp, aggr, err := client.SendSurveyResultsQuery(*surveyID)
if err != nil {
log.Fatal("Service could not output the results.")
log.Fatal("Service could not output the results.", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really Fatal, or should this just return the error? Fatal really means: "the internal state of the conode is inconsistent and every further action might make it worse". While here I think it should only be: "oups, something went wrong. Let's discard what happened and wait for a new request."

Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing for all Fatals in the rest of the code...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am checking all log.Fatals now. I will add a commit after reviewing all of them

Copy link
Contributor Author

@JoaoAndreSa JoaoAndreSa Apr 3, 2019

Choose a reason for hiding this comment

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

@ineiti just commited this 5ad4d7e it should fix this comment (just for the app/ part)

@@ -17,7 +17,7 @@ import (
)

// Groups identifies all different groups to be added to the test data file
var Groups [][]int64
//var Groups [][]int64
Copy link
Contributor

Choose a reason for hiding this comment

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

Style: remove commented out code sections.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 780f203

@@ -177,11 +185,18 @@ func WriteDataToFile(filename string, testData map[string][]libunlynx.DpClearRes
}

writer := bufio.NewWriter(fileHandle)
if err := writer.Flush(); err != nil {
log.Fatal(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

like above: it's much cleaner to return an error and let the caller decide what should happen...

@ineiti
Copy link
Contributor

ineiti commented Apr 3, 2019

Another downside of huge PRs: I don't even know where to start ;) Is there something specific that you would like me to look at?

@JoaoAndreSa
Copy link
Contributor Author

JoaoAndreSa commented Apr 4, 2019

Apparently the previous bug in issue #11 was not fixed. I changed the service so that it waits for all the nodes to get the survey before performing the remaining operations/protocols: 083a047. This time I am sure it will work...

@ineiti you told me something about a synchronous broadcast that waits until all nodes have gotten the message, but I only found something of that kind for the protocols: (*TreeNodeInstance) Broadcast(). I did the same with a channel, but I am not sure it's the best way (a protocol is perhaps the best choice, even though I would have to change some structures to avoid import cycles).

@ineiti
Copy link
Contributor

ineiti commented Apr 4, 2019

In fact it's the cothority/messaging/propagate protocol. Unfortunately the test sucks and doesn't show how to do it nicely. But the skipchain uses it - follow propagateGenesis in here:

https://github.com/dedis/cothority/blob/master/skipchain/skipchain.go

@JoaoAndreSa JoaoAndreSa merged commit 427401f into master Apr 29, 2019
@JoaoAndreSa JoaoAndreSa deleted the homoProto branch April 29, 2019 15:13
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.

Interface is nil
3 participants