Closed rootwarp closed 1 year ago
Calculate contributions in parallel.
To test benchmark, try mocha -g contribution
mocha -g contribution
On Intel Mac.
Naive
rootwarp@LT-026 ~/g/d/dsrv-kzg-ceremony issue#21 > mocha -g contribution contribution Covertion 14.229253240048886 Update Power of Tau... updatePowerOfTau [ 45915742653004781650753367670786467853246025385405826871947405855011599548415n, 756481571057053953858854549305078053140817115968096697509558293808040378368n, 24093627315301504734212457777887725837250955099074956480846757788118388047871n, 38628788243150733715781968540084257093232597313016912593196222747886726676479n ] Contribution 371.2364852460027 Update Witnesses... { x: { c0: 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n, c1: 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n }, y: { c0: 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n, c1: 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n } } New PotPubkey a929b6ed5574cbd2e43303ca26d03dd45181dfd082aa798f127e72fd33cef383933b429f54c8fb1c47194ed4f5445cb8015352b527ed0e07d6f717e74f57df1091198ac5bda886237e0ac33e8250e347e0f4155d853f6bcaf556eb0e4c8f8b8f { x: { c0: 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n, c1: 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n }, y: { c0: 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n, c1: 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n } } New PotPubkey 8784f17cbeb1be4a3d18703935c8382f931601a281472464924e5293ed010d07675167fe0d1e91af91552b49865887950fcd1002920d00ded9a2f7c698ea329ed8c700d548f25f1c0301dbf19d120a1a72eac78224aac9fbc038b5b15703a0ab { x: { c0: 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n, c1: 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n }, y: { c0: 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n, c1: 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n } } New PotPubkey 93dc37db972a895cf89a212facf9e179ce43d86ed20635329dbaf1f1a597fcbe49d34bdf1b09dc35a9cc22de70046fa60ad81a5bdcff2453785442e687cd697d267b0eee1cdb7d1e060f0851493468b6ffd1f0b351de8cef2f9ffac25b1cd85b { x: { c0: 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n, c1: 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n }, y: { c0: 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n, c1: 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n } } New PotPubkey 900e8a6abcc74499fd34b249071b9a0a5ca993f1079f99bc2ddf433fc07abd7a9d013527645d951e93daa36a78252a461324e2c94fd76d83acc1365827f8aff78486abe1261de1f4d8892075292e2c05c9ab7e1120163161396d31e5f8537246 Witness 0.11616720396280289 ✔ naive (385579ms)
It takes about 6.5 minutes.
With 4 Workers
start test with worker Covertion 14.4332717320323 Update Power of Tau... contributeWorker 16713724183719903637269572094649476873884278167085257043122419838561151877120n contributeWorker 8989950593383464219678156492680739830181875003714498962342221679217029939198n contributeWorker 47787751613532407851575036521381710027966643960766312337548496530290832834560n contributeWorker 5740472213313736838203407929420956447356756208782354362979036634532301242367n receive new contribution receive new contribution receive new contribution receive new contribution Contribution 195.19783513700963 Update Witnesses... { x: { c0: 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n, c1: 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n }, y: { c0: 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n, c1: 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n } } New PotPubkey 9224b32d927f73cd68e2cc93105557891d23c1a7592c871f5ca3b09fc85d15f443ef9d1ecccd246ef42d18312737b7bf19587675b4219ccf694c30f2469eed3d086bdb285d18838e9e80d522aa52df58441ac3e82f23b8c5876428c1d2650757 { x: { c0: 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n, c1: 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n }, y: { c0: 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n, c1: 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n } } New PotPubkey ae963cac73c58cf78176ae2cc90c75af8f275eee8fc8b70743f3cd0d3a769bc8e38989dbafecf9d9fa98f17cde65c3880e80a953a7d6fc7c5f03beacd52646754fe53ac2ca42e3b62ca054f8d46efca17f84d1963cd56b4bec28b329fd131bb4 { x: { c0: 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n, c1: 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n }, y: { c0: 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n, c1: 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n } } New PotPubkey a37d48bb3ebf61b1a85646712e788de8130afe629eb371e43b056552c33b0e171cfaea7bcea1d298ebe8fe5299d3f32e03c0be8728dc36f5e93e0c1046a5340a754e7099ae471258318e731365b8610345c38bb0d6af89a6f41ec8ae2df8bde6 { x: { c0: 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n, c1: 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n }, y: { c0: 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n, c1: 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n } } New PotPubkey aea0b557d4abf8c321ee819875b9a6c671e07ed1978d268f9250ee7580b4172cc752fb86eeb2d4b87649675f650a7fb8096762421dfd8c18f7ec888cd76032e00827baf5c85d61545f2118d226b7ee9e4911869fb5c248e2c8824edff5a26dd2 Witness 0.12263271296024322 ✔ contribution.worker (209786ms) 2 passing (10m)
It takes about 3.5 minutes.
Got about 46% efficiency.
Testnet at private sequencer.
{ receipt: '{"identity":"git|9974087|rootwarp","witness":["0xaaa48d3009c1f137a772db9a08893c4353fb709c707a2a739cbbf8d4a6fdd075f429b531fa7ec3bf0fc48f40a7e0aeff19a3c460f16074a31331985dacf1c9e3d1110c5708528e6c22af0020697d39b6e7ac7d47b55ac1d9b110fc6e93090ba7","0xa43aa61eb147368bcefae893802c88f3fd934f0d0d0a035d8fcd1ce0003f0afe1569109fe92bb8f296a20ac21a9b04b4132b0e90a37ccf5c4c646975bb8603d24e71d35a8bd73b6da3e37236e1a04d5a8bc4fa3793a65bfa59e62696ccfd0fdb","0xb3cf77ce5aea8c59e6230dda35e6741d4263202362253db1b825306545b60ac046b33dbb04aad34977bccaff7257feab17828e6b127e925c03d90a8dc1eb2dd42150cca407d14ef57a4fd1e1bdcdbe314fc6385ae472e0023cf3503ecf5ef6fb","0x85d3e28ecb128f96438f7580465616a51314bfdce10e4b1c8e40c16e48ce59874c34e0889f4cc77f07eed5e960f1da8b0ec7a7f0eb87432f73be46c2f7691dd370be25b8c3da21560908fadb8fbc06279da7fe89b870bafe16b0fd1ccc30ea47"]}', signature: '5c9630266acf13be7b2e54161cc129c0771b9609441445d9cecd41628bea717001646bcbd333cba8353ef6702e65f5a5dd22025a217f9c1b291c77641c29ffb81b' }
close #21
Calculate contributions in parallel.
To test benchmark, try
mocha -g contribution
On Intel Mac.
Naive
It takes about 6.5 minutes.
With 4 Workers
It takes about 3.5 minutes.
Got about 46% efficiency.
Testnet at private sequencer.
close #21