Skip to content

Commit 6260aef

Browse files
committed
tests: more test
1 parent c68f7b0 commit 6260aef

File tree

4 files changed

+90
-6
lines changed

4 files changed

+90
-6
lines changed

benchmark/geo_runs.py

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,67 @@ def update_batch_size(json_file_path, mechanism_name, new_batch_size):
425425
except Exception as e:
426426
print(f"An error occurred: {e}")
427427

428+
# def update_parameters(json_file_path, mechanism_name, new_tx_size=None, new_rate=None, new_batch_size=None):
429+
# try:
430+
# with open(json_file_path, "r") as file:
431+
# data = json.load(file)
432+
433+
# if mechanism_name in data["remote"]:
434+
# # Update tx_size
435+
# if new_tx_size is not None:
436+
# data["remote"][mechanism_name]["bench_params"]["tx_size"] = new_tx_size
437+
438+
# # Update rate
439+
# if new_rate is not None:
440+
# if isinstance(new_rate, list):
441+
# data["remote"][mechanism_name]["bench_params"]["rate"] = new_rate
442+
# else:
443+
# data["remote"][mechanism_name]["bench_params"]["rate"] = [new_rate]
444+
445+
# # Update batch_size
446+
# if new_batch_size is not None:
447+
# if mechanism_name == "hotstuff":
448+
# data["remote"][mechanism_name]["node_params"]["mempool"]["batch_size"] = new_batch_size
449+
# elif mechanism_name == "bullshark" or mechanism_name == "cometbft":
450+
# data["remote"][mechanism_name]["node_params"]["batch_size"] = new_batch_size
451+
452+
# with open(json_file_path, "w") as file:
453+
# json.dump(data, file, indent=4)
454+
# print(f"Parameters for {mechanism_name} updated successfully.")
455+
# else:
456+
# print(f"Mechanism {mechanism_name} not found in the JSON file.")
457+
458+
# except Exception as e:
459+
# print(f"An error occurred: {e}")
460+
461+
# def update_batch_size_relative(json_file_path, mechanism_name, relative_tx_rate):
462+
# try:
463+
# with open(json_file_path, "r") as file:
464+
# data = json.load(file)
465+
466+
# if mechanism_name in data["remote"]:
467+
# if mechanism_name == "hotstuff":
468+
# tx_rate = data["remote"][mechanism_name]["bench_params"]["rate"][0]
469+
# tx_size = data["remote"][mechanism_name]["bench_params"]["tx_size"]
470+
# data["remote"][mechanism_name]["node_params"]["mempool"]["batch_size"] = int(tx_size) * (int(tx_rate) + int(relative_tx_rate))
471+
# elif mechanism_name == "bullshark":
472+
# data["remote"][mechanism_name]["node_params"]["batch_size"] = relative_tx_rate
473+
# with open(json_file_path, "w") as file:
474+
# json.dump(data, file, indent=4)
475+
# print(f"Batch count for {mechanism_name} updated to {tx_rate + relative_tx_rate}.")
476+
# else:
477+
# print(f"Mechanism {mechanism_name} not found in the JSON file.")
478+
479+
# except Exception as e:
480+
# print(f"An error occurred: {e}")
481+
428482

429483
if __name__ == "__main__":
430484

431-
batch_sizes = [512, 1024, 10000, 20000, 50000, 80000, 100000, 200000, 300000]
485+
# batch_sizes = [512, 1024, 10000, 20000, 50000, 80000, 100000, 200000, 300000]
486+
batch_sizes = [1000, 5000, 10000, 100000, 1000000, 5000000, 7500000, 10000000, 12500000, 15000000]
487+
# batch_sizes = [-100, 100, -10, 0, 10, 20, 30, 40, 50, 70]
488+
432489
mechanism = ["hotstuff"]
433490

434491
print("Starting benchmarking tool")

fab-params.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
4
88
],
99
"rate": [
10-
200000
10+
50000
1111
],
1212
"tx_size": 128,
13-
"duration": 300,
13+
"duration": 100,
1414
"runs": 3
1515
},
1616
"node_params": {
@@ -22,8 +22,8 @@
2222
"gc_depth": 50,
2323
"sync_retry_delay": 5000,
2424
"sync_retry_nodes": 3,
25-
"batch_size": 300000,
26-
"max_batch_delay": 100
25+
"batch_size": 150000,
26+
"max_batch_delay": 5000
2727
}
2828
}
2929
},

results/metrics.csv

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,3 +683,30 @@ run_id,name,faults,input_rate,committee_size,transaction_size,execution_time,bat
683683
682,hotstuff,0.0,80000.0,4.0,128.0,3.0,15000000.0,1527777.0,195555483.0,36.0,18556.0,2375169.0,1608.0,
684684
683,hotstuff,0.0,80000.0,4.0,128.0,0.0,15000000.0,0.0,0.0,0.0,0.0,0.0,0.0,
685685
684,hotstuff,0.0,80000.0,4.0,128.0,0.0,15000000.0,509259.0,65185161.0,12.0,6185.333333333333,791723.0,536.0,3.0
686+
685,hotstuff,0.0,80000.0,4.0,128.0,101.0,150000.0,79816.0,10216494.0,597.0,79151.0,10131315.0,1031.0,
687+
686,hotstuff,0.0,80000.0,4.0,128.0,100.0,150000.0,80131.0,10256830.0,588.0,79285.0,10148503.0,1028.0,
688+
687,hotstuff,0.0,80000.0,4.0,128.0,100.0,150000.0,80312.0,10279949.0,599.0,79458.0,10170678.0,1044.0,
689+
688,hotstuff,0.0,80000.0,4.0,128.0,101.0,150000.0,80086.33333333333,10251091.0,594.6666666666666,79298.0,10150165.333333334,1034.3333333333333,3.0
690+
689,hotstuff,0.0,80000.0,4.0,128.0,100.0,150000.0,79997.0,10239573.0,641.0,79178.0,10134723.0,1063.0,
691+
690,hotstuff,0.0,80000.0,4.0,128.0,100.0,150000.0,80092.0,10251832.0,625.0,79312.0,10151875.0,1054.0,
692+
691,hotstuff,0.0,80000.0,4.0,128.0,100.0,150000.0,79928.0,10230773.0,592.0,79148.0,10130947.0,1006.0,
693+
692,hotstuff,0.0,80000.0,4.0,128.0,100.0,150000.0,80005.66666666667,10240726.0,619.3333333333334,79212.66666666667,10139181.666666666,1041.0,3.0
694+
693,hotstuff,0.0,80000.0,4.0,128.0,100.0,150000.0,80043.0,10245521.0,8.0,79994.0,10239183.0,106.0,
695+
694,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,49883.0,6385037.0,1013.0,49486.0,6334245.0,2015.0,
696+
695,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50022.0,6402817.0,782.0,49595.0,6348193.0,1373.0,
697+
696,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50056.0,6407146.0,773.0,49611.0,6350256.0,1343.0,
698+
697,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,49987.0,6398333.333333333,856.0,49564.0,6344231.333333333,1577.0,3.0
699+
698,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50018.0,6402368.0,380.0,49573.0,6345336.0,765.0,
700+
699,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50075.0,6409584.0,383.0,49593.0,6347919.0,766.0,
701+
700,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50263.0,6433672.0,380.0,49607.0,6349709.0,764.0,
702+
701,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50118.66666666666,6415208.0,381.0,49591.0,6347654.666666667,765.0,3.0
703+
702,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50031.0,6403988.0,386.0,49542.0,6341424.0,804.0,
704+
703,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,49854.0,6381259.0,392.0,49540.0,6341063.0,811.0,
705+
704,hotstuff,0.0,50000.0,4.0,128.0,101.0,150000.0,50248.0,6431782.0,332.0,49600.0,6348850.0,795.0,
706+
705,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50127.0,6416228.0,327.0,49622.0,6351611.0,789.0,
707+
706,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50270.0,6434499.0,345.0,49659.0,6356318.0,816.0,
708+
707,hotstuff,0.0,50000.0,4.0,128.0,101.0,150000.0,50215.0,6427503.0,334.6666666666667,49627.0,6352259.666666667,800.0,3.0
709+
708,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50002.0,6400207.0,683.0,49393.0,6322284.0,1291.0,
710+
709,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50260.0,6433301.0,669.0,49526.0,6339338.0,1240.0,
711+
710,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,49956.0,6394397.0,659.0,49573.0,6345378.0,1231.0,
712+
711,hotstuff,0.0,50000.0,4.0,128.0,100.0,150000.0,50072.666666666664,6409301.666666667,670.3333333333334,49497.333333333336,6335666.666666667,1254.0,3.0

rundata/geo_input.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ id,name,title,location,state,country,state_abbv,continent,latitude,longitude,cou
22
90,StLouis,St Louis,St Louis,Missouri,United States,MO,1,38.63,-90.2,1,1
33
125,SaoPaulo,Sao Paulo,Sao Paulo,Sao Paulo,Brazil,SP,2,-23.55,-46.6333,1,1
44
32,Warsaw,Warsaw,Warsaw,Mazovia,Poland,MZ,3,52.23,21.0108,1,1
5-
169,Perth,Perth,Perth,Western Australia,Australia,WA,4,-31.9522,115.8589,1,10
5+
169,Perth,Perth,Perth,Western Australia,Australia,WA,4,-31.9522,115.8589,1,1

0 commit comments

Comments
 (0)