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

feat: update e2e and nillion-interactor #84

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
588 changes: 260 additions & 328 deletions services/nillion-interactor/E2E_Nillion_Test.ipynb

Large diffs are not rendered by default.

Binary file modified services/nillion-interactor/binaries/double.nada.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion services/nillion-interactor/binaries/double.nada.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"functions":[],"parties":[{"name":"Party1","source_ref_index":3}],"inputs":[{"type":"SecretInteger","party":"Party1","name":"foo","doc":"","source_ref_index":1}],"literals":[],"outputs":[{"name":"my_output","operation_id":4347741072,"party":"Party1","type":"SecretInteger","source_ref_index":2}],"operations":{"4347741072":{"Addition":{"id":4347741072,"left":4347690704,"right":4347690704,"type":"SecretInteger","source_ref_index":0}},"4347690704":{"InputReference":{"id":4347690704,"refers_to":"foo","type":"SecretInteger","source_ref_index":1}}},"source_files":{"double.py":"from nada_dsl import *\n\ndef nada_main():\n party1 = Party(name=\"Party1\")\n a = SecretInteger(Input(name=\"foo\", party=party1))\n\n result = a + a\n\n return [Output(result, \"my_output\", party1)]\n"},"source_refs":[{"file":"double.py","lineno":7,"offset":131,"length":18},{"file":"double.py","lineno":5,"offset":75,"length":54},{"file":"double.py","lineno":9,"offset":0,"length":0},{"file":"double.py","lineno":4,"offset":41,"length":33}]}
{"functions":[],"parties":[{"name":"Party1","source_ref_index":3}],"inputs":[{"type":"SecretInteger","party":"Party1","name":"foo","doc":"","source_ref_index":1}],"literals":[],"outputs":[{"name":"my_output","operation_id":2,"party":"Party1","type":"SecretInteger","source_ref_index":2}],"operations":{"1":{"InputReference":{"id":1,"refers_to":"foo","type":"SecretInteger","source_ref_index":1}},"2":{"Addition":{"id":2,"left":1,"right":1,"type":"SecretInteger","source_ref_index":0}}},"source_files":{"double.py":"from nada_dsl import *\n\ndef nada_main():\n party1 = Party(name=\"Party1\")\n a = SecretInteger(Input(name=\"foo\", party=party1))\n\n result = a + a\n\n return [Output(result, \"my_output\", party1)]\n"},"source_refs":[{"file":"scalar_types.py","lineno":136,"offset":0,"length":0},{"file":"double.py","lineno":5,"offset":75,"length":54},{"file":"double.py","lineno":9,"offset":0,"length":0},{"file":"double.py","lineno":4,"offset":41,"length":33}]}
Binary file modified services/nillion-interactor/binaries/muscle-perform.nada.bin
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"functions":[],"parties":[{"name":"Party1","source_ref_index":10}],"inputs":[{"type":"SecretInteger","party":"Party1","name":"genotype1","doc":"","source_ref_index":4},{"type":"SecretInteger","party":"Party1","name":"snp1","doc":"","source_ref_index":7}],"literals":[{"name":"0420609fa1d35394f41049df03ef341f","value":"0","type":"Integer"},{"name":"10d33944d37d5b1b833be6fd73d3033c","value":"1","type":"Integer"},{"name":"86e63315b115f2a1eb1d7fc854e4c36f","value":"9","type":"Integer"},{"name":"3bf3aca3a9762f07ea27308c85649001","value":"11","type":"Integer"},{"name":"be9dc3499e38754968f0ed1e2d88d815","value":"2","type":"Integer"}],"outputs":[{"name":"Result","operation_id":4372700816,"party":"Party1","type":"Integer","source_ref_index":9}],"operations":{"4372695760":{"IfElse":{"id":4372695760,"this":4372694928,"arg_0":4372695312,"arg_1":4372695568,"type":"SecretInteger","source_ref_index":6}},"4372696400":{"Not":{"id":4372696400,"this":4372700822,"type":"SecretBoolean","source_ref_index":3}},"4372697488":{"IfElse":{"id":4372697488,"this":4372696656,"arg_0":4372697040,"arg_1":4372697296,"type":"SecretInteger","source_ref_index":3}},"4372700432":{"LiteralReference":{"id":4372700432,"refers_to":"0420609fa1d35394f41049df03ef341f","type":"Integer","source_ref_index":1}},"4372697040":{"LiteralReference":{"id":4372697040,"refers_to":"10d33944d37d5b1b833be6fd73d3033c","type":"Integer","source_ref_index":3}},"4372696016":{"LiteralReference":{"id":4372696016,"refers_to":"0420609fa1d35394f41049df03ef341f","type":"Integer","source_ref_index":6}},"4372694352":{"LiteralReference":{"id":4372694352,"refers_to":"3bf3aca3a9762f07ea27308c85649001","type":"Integer","source_ref_index":8}},"4372700112":{"IfElse":{"id":4372700112,"this":4372699216,"arg_0":4372699664,"arg_1":4372699920,"type":"SecretInteger","source_ref_index":1}},"4372695312":{"LiteralReference":{"id":4372695312,"refers_to":"10d33944d37d5b1b833be6fd73d3033c","type":"Integer","source_ref_index":6}},"4372698768":{"Not":{"id":4372698768,"this":4372700821,"type":"SecretBoolean","source_ref_index":1}},"4372697296":{"LiteralReference":{"id":4372697296,"refers_to":"0420609fa1d35394f41049df03ef341f","type":"Integer","source_ref_index":3}},"4372695568":{"LiteralReference":{"id":4372695568,"refers_to":"0420609fa1d35394f41049df03ef341f","type":"Integer","source_ref_index":6}},"4372694736":{"Not":{"id":4372694736,"this":4372700820,"type":"SecretBoolean","source_ref_index":6}},"4372700816":{"Reveal":{"id":4372700816,"this":4372700624,"type":"Integer","source_ref_index":0}},"4372700819":{"LessThan":{"id":4372700819,"left":4372694352,"right":4372643472,"type":"SecretBoolean","source_ref_index":6}},"4372694928":{"Not":{"id":4372694928,"this":4372700819,"type":"SecretBoolean","source_ref_index":6}},"4372698000":{"IfElse":{"id":4372698000,"this":4372696400,"arg_0":4372697488,"arg_1":4372697808,"type":"SecretInteger","source_ref_index":3}},"4372700817":{"LessThan":{"id":4372700817,"left":4372699088,"right":4372698192,"type":"SecretBoolean","source_ref_index":1}},"4372643472":{"InputReference":{"id":4372643472,"refers_to":"snp1","type":"SecretInteger","source_ref_index":7}},"4369825936":{"InputReference":{"id":4369825936,"refers_to":"genotype1","type":"SecretInteger","source_ref_index":4}},"4372698576":{"LiteralReference":{"id":4372698576,"refers_to":"be9dc3499e38754968f0ed1e2d88d815","type":"Integer","source_ref_index":1}},"4372700818":{"LessThan":{"id":4372700818,"left":4372694480,"right":4369825936,"type":"SecretBoolean","source_ref_index":3}},"4372700820":{"LessThan":{"id":4372700820,"left":4372643472,"right":4372694352,"type":"SecretBoolean","source_ref_index":6}},"4372696656":{"Not":{"id":4372696656,"this":4372700818,"type":"SecretBoolean","source_ref_index":3}},"4372699216":{"Not":{"id":4372699216,"this":4372700817,"type":"SecretBoolean","source_ref_index":1}},"4372694480":{"LiteralReference":{"id":4372694480,"refers_to":"86e63315b115f2a1eb1d7fc854e4c36f","type":"Integer","source_ref_index":5}},"4372700624":{"IfElse":{"id":4372700624,"this":4372698768,"arg_0":4372700112,"arg_1":4372700432,"type":"SecretInteger","source_ref_index":1}},"4372699664":{"LiteralReference":{"id":4372699664,"refers_to":"10d33944d37d5b1b833be6fd73d3033c","type":"Integer","source_ref_index":1}},"4372699920":{"LiteralReference":{"id":4372699920,"refers_to":"0420609fa1d35394f41049df03ef341f","type":"Integer","source_ref_index":1}},"4372697808":{"LiteralReference":{"id":4372697808,"refers_to":"0420609fa1d35394f41049df03ef341f","type":"Integer","source_ref_index":3}},"4372698192":{"Addition":{"id":4372698192,"left":4372696208,"right":4372698000,"type":"SecretInteger","source_ref_index":2}},"4372696208":{"IfElse":{"id":4372696208,"this":4372694736,"arg_0":4372695760,"arg_1":4372696016,"type":"SecretInteger","source_ref_index":6}},"4372699088":{"LiteralReference":{"id":4372699088,"refers_to":"be9dc3499e38754968f0ed1e2d88d815","type":"Integer","source_ref_index":1}},"4372700822":{"LessThan":{"id":4372700822,"left":4369825936,"right":4372694480,"type":"SecretBoolean","source_ref_index":3}},"4372700821":{"LessThan":{"id":4372700821,"left":4372698192,"right":4372698576,"type":"SecretBoolean","source_ref_index":1}}},"source_files":{"muscle-perform.py":"from nada_dsl import *\n\n\n# Checks based on SNP rs1815739 whether someone is a sprinter or an endurance athelete\n# Genotype TT indicates endurance athlete\n# We arbitrarily assume sprinter otherwise\n# This program returns 0 if sprinter, 1 if endurance athelete\ndef nada_main():\n\n party1 = Party(name=\"Party1\")\n\n\n snp1 = SecretInteger(Input(name=\"snp1\", party=party1))\n genotype1 = SecretInteger(Input(name=\"genotype1\", party=party1))\n\n target_snp_1 = Integer(11)\n target_genotype_1 = Integer(9)\n\n eq1 = (snp1 >= target_snp_1).if_else((target_snp_1 >= snp1).if_else(Integer(1), Integer(0)), Integer(0))\n eq2 = (genotype1 >= target_genotype_1).if_else((target_genotype_1 >= genotype1).if_else(Integer(1), Integer(0)), Integer(0))\n\n\n total = eq1 + eq2\n\n is_successful = (total >= Integer(2)).if_else((Integer(2) >= total).if_else(Integer(1), Integer(0)), Integer(0))\n\n result = is_successful.reveal()\n\n return [Output(result, \"Result\", party1)]\n"},"source_refs":[{"file":"muscle-perform.py","lineno":27,"offset":890,"length":35},{"file":"muscle-perform.py","lineno":25,"offset":772,"length":116},{"file":"muscle-perform.py","lineno":23,"offset":749,"length":21},{"file":"muscle-perform.py","lineno":20,"offset":618,"length":128},{"file":"muscle-perform.py","lineno":14,"offset":372,"length":68},{"file":"muscle-perform.py","lineno":17,"offset":473,"length":34},{"file":"muscle-perform.py","lineno":19,"offset":509,"length":108},{"file":"muscle-perform.py","lineno":13,"offset":313,"length":58},{"file":"muscle-perform.py","lineno":16,"offset":442,"length":30},{"file":"muscle-perform.py","lineno":29,"offset":0,"length":0},{"file":"muscle-perform.py","lineno":10,"offset":277,"length":33}]}
{"functions":[],"parties":[{"name":"Party1","source_ref_index":10}],"inputs":[{"type":"SecretInteger","party":"Party1","name":"genotype1","doc":"","source_ref_index":4},{"type":"SecretInteger","party":"Party1","name":"snp1","doc":"","source_ref_index":7}],"literals":[{"name":"3","value":"0","type":"Integer"},{"name":"2","value":"1","type":"Integer"},{"name":"1","value":"9","type":"Integer"},{"name":"0","value":"11","type":"Integer"},{"name":"4","value":"2","type":"Integer"}],"outputs":[{"name":"Result","operation_id":28,"party":"Party1","type":"SecretInteger","source_ref_index":9}],"operations":{"1":{"InputReference":{"id":1,"refers_to":"snp1","type":"SecretInteger","source_ref_index":7}},"2":{"InputReference":{"id":2,"refers_to":"genotype1","type":"SecretInteger","source_ref_index":4}},"3":{"LiteralReference":{"id":3,"refers_to":"0","type":"Integer","source_ref_index":8}},"4":{"LiteralReference":{"id":4,"refers_to":"1","type":"Integer","source_ref_index":5}},"5":{"Not":{"id":5,"this":34,"type":"SecretBoolean","source_ref_index":1}},"6":{"Not":{"id":6,"this":33,"type":"SecretBoolean","source_ref_index":1}},"7":{"LiteralReference":{"id":7,"refers_to":"2","type":"Integer","source_ref_index":6}},"8":{"LiteralReference":{"id":8,"refers_to":"3","type":"Integer","source_ref_index":6}},"9":{"IfElse":{"id":9,"this":6,"arg_0":7,"arg_1":8,"type":"SecretInteger","source_ref_index":6}},"10":{"LiteralReference":{"id":10,"refers_to":"3","type":"Integer","source_ref_index":6}},"11":{"IfElse":{"id":11,"this":5,"arg_0":9,"arg_1":10,"type":"SecretInteger","source_ref_index":6}},"12":{"Not":{"id":12,"this":32,"type":"SecretBoolean","source_ref_index":1}},"13":{"Not":{"id":13,"this":31,"type":"SecretBoolean","source_ref_index":1}},"14":{"LiteralReference":{"id":14,"refers_to":"2","type":"Integer","source_ref_index":3}},"15":{"LiteralReference":{"id":15,"refers_to":"3","type":"Integer","source_ref_index":3}},"16":{"IfElse":{"id":16,"this":13,"arg_0":14,"arg_1":15,"type":"SecretInteger","source_ref_index":3}},"17":{"LiteralReference":{"id":17,"refers_to":"3","type":"Integer","source_ref_index":3}},"18":{"IfElse":{"id":18,"this":12,"arg_0":16,"arg_1":17,"type":"SecretInteger","source_ref_index":3}},"19":{"Addition":{"id":19,"left":11,"right":18,"type":"SecretInteger","source_ref_index":2}},"20":{"LiteralReference":{"id":20,"refers_to":"4","type":"Integer","source_ref_index":0}},"21":{"Not":{"id":21,"this":30,"type":"SecretBoolean","source_ref_index":1}},"22":{"LiteralReference":{"id":22,"refers_to":"4","type":"Integer","source_ref_index":0}},"23":{"Not":{"id":23,"this":29,"type":"SecretBoolean","source_ref_index":1}},"24":{"LiteralReference":{"id":24,"refers_to":"2","type":"Integer","source_ref_index":0}},"25":{"LiteralReference":{"id":25,"refers_to":"3","type":"Integer","source_ref_index":0}},"26":{"IfElse":{"id":26,"this":23,"arg_0":24,"arg_1":25,"type":"SecretInteger","source_ref_index":0}},"27":{"LiteralReference":{"id":27,"refers_to":"3","type":"Integer","source_ref_index":0}},"28":{"IfElse":{"id":28,"this":21,"arg_0":26,"arg_1":27,"type":"SecretInteger","source_ref_index":0}},"29":{"LessThan":{"id":29,"left":22,"right":19,"type":"SecretBoolean","source_ref_index":1}},"30":{"LessThan":{"id":30,"left":19,"right":20,"type":"SecretBoolean","source_ref_index":1}},"31":{"LessThan":{"id":31,"left":4,"right":2,"type":"SecretBoolean","source_ref_index":1}},"32":{"LessThan":{"id":32,"left":2,"right":4,"type":"SecretBoolean","source_ref_index":1}},"33":{"LessThan":{"id":33,"left":3,"right":1,"type":"SecretBoolean","source_ref_index":1}},"34":{"LessThan":{"id":34,"left":1,"right":3,"type":"SecretBoolean","source_ref_index":1}}},"source_files":{"muscle-perform.py":"from nada_dsl import *\n\n\n# Checks based on SNP rs1815739 whether someone is a sprinter or an endurance athelete\n# Genotype TT indicates endurance athlete\n# We arbitrarily assume sprinter otherwise\n# This program returns 0 if sprinter, 1 if endurance athelete\ndef nada_main():\n\n party1 = Party(name=\"Party1\")\n\n\n snp1 = SecretInteger(Input(name=\"snp1\", party=party1))\n genotype1 = SecretInteger(Input(name=\"genotype1\", party=party1))\n\n target_snp_1 = Integer(11)\n target_genotype_1 = Integer(9)\n\n eq1 = (snp1 >= target_snp_1).if_else((target_snp_1 >= snp1).if_else(Integer(1), Integer(0)), Integer(0))\n eq2 = (genotype1 >= target_genotype_1).if_else((target_genotype_1 >= genotype1).if_else(Integer(1), Integer(0)), Integer(0))\n\n\n total = eq1 + eq2\n\n is_successful = (total >= Integer(2)).if_else((Integer(2) >= total).if_else(Integer(1), Integer(0)), Integer(0))\n\n result = is_successful\n\n return [Output(result, \"Result\", party1)]\n"},"source_refs":[{"file":"muscle-perform.py","lineno":25,"offset":772,"length":116},{"file":"scalar_types.py","lineno":200,"offset":0,"length":0},{"file":"scalar_types.py","lineno":136,"offset":0,"length":0},{"file":"muscle-perform.py","lineno":20,"offset":618,"length":128},{"file":"muscle-perform.py","lineno":14,"offset":372,"length":68},{"file":"muscle-perform.py","lineno":17,"offset":473,"length":34},{"file":"muscle-perform.py","lineno":19,"offset":509,"length":108},{"file":"muscle-perform.py","lineno":13,"offset":313,"length":58},{"file":"muscle-perform.py","lineno":16,"offset":442,"length":30},{"file":"muscle-perform.py","lineno":29,"offset":0,"length":0},{"file":"muscle-perform.py","lineno":10,"offset":277,"length":33}]}
Binary file modified services/nillion-interactor/binaries/thrombosis.nada.bin
Binary file not shown.
Loading