Skip to content

chore: add console_time #31

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

Open
wants to merge 4 commits into
base: test_with_eigen_service
Choose a base branch
from
Open
Changes from all commits
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
21 changes: 17 additions & 4 deletions scripts/run_with_eigen_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ async function sign(m, key_store, delay, public_key_address) {
console.log("public_key_address = ", public_key_address);
user_id = 1;
sign_url = `${eigen_service}/tss/sign`;
console.time(11);
res = await axios.post(
sign_url,
querystring.stringify({
Expand All @@ -160,9 +161,11 @@ async function sign(m, key_store, delay, public_key_address) {
key_store,
digest.slice(2)
);
console.timeEnd(11);
console.log("sign new context: ", context);

round = 0;
console.time(0);
res = await axios.post(
sign_url,
querystring.stringify({ user_id: user_id, round: round }),
Expand All @@ -176,6 +179,7 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);

context = await m.gg18_sign_client_round0(context, delay);
console.timeEnd(0);
console.log("sign round0: ");

round = 1;
Expand All @@ -193,6 +197,7 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);

context = await m.gg18_sign_client_round1(context, delay);

console.log("sign round1: ");
console.timeEnd(1);

Expand All @@ -211,8 +216,9 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);

context = await m.gg18_sign_client_round2(context, delay);
console.log("sign round2: ");

console.timeEnd(2);
console.log("sign round2: ");

round = 3;
console.time(3);
Expand All @@ -229,6 +235,7 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);

context = await m.gg18_sign_client_round3(context, delay);

console.log("sign round3: ");
console.timeEnd(3);

Expand All @@ -247,6 +254,7 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);

context = await m.gg18_sign_client_round4(context, delay);

console.log("sign round4: ");
console.timeEnd(4);

Expand All @@ -265,6 +273,7 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);

context = await m.gg18_sign_client_round5(context, delay);

console.log("sign round5: ");
console.timeEnd(5);

Expand All @@ -283,9 +292,10 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);

context = await m.gg18_sign_client_round6(context, delay);

console.log("sign round6: ");
console.timeEnd(6);

round = 7;
console.time(7);
res = await axios.post(
Expand All @@ -301,8 +311,10 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);
Copy link
Member

Choose a reason for hiding this comment

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

is it a must to wait for 1s?


context = await m.gg18_sign_client_round7(context, delay);
console.log("sign round7: ");

console.timeEnd(7);
console.log("sign round7: ");


round = 8;
console.time(8);
Expand All @@ -319,8 +331,9 @@ async function sign(m, key_store, delay, public_key_address) {
await delay_ms(1000);

context = await m.gg18_sign_client_round8(context, delay);
console.log("sign round8: ");

console.timeEnd(8);
console.log("sign round8: ");

round = 9;
console.time(9);
Expand Down