Skip to content

Commit

Permalink
tests: more test
Browse files Browse the repository at this point in the history
  • Loading branch information
namn-grg committed Oct 6, 2024
1 parent 46eb5f0 commit c959aae
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 6 deletions.
59 changes: 58 additions & 1 deletion benchmark/geo_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,67 @@ def update_batch_size(json_file_path, mechanism_name, new_batch_size):
except Exception as e:
print(f"An error occurred: {e}")

# def update_parameters(json_file_path, mechanism_name, new_tx_size=None, new_rate=None, new_batch_size=None):
# try:
# with open(json_file_path, "r") as file:
# data = json.load(file)

# if mechanism_name in data["remote"]:
# # Update tx_size
# if new_tx_size is not None:
# data["remote"][mechanism_name]["bench_params"]["tx_size"] = new_tx_size

# # Update rate
# if new_rate is not None:
# if isinstance(new_rate, list):
# data["remote"][mechanism_name]["bench_params"]["rate"] = new_rate
# else:
# data["remote"][mechanism_name]["bench_params"]["rate"] = [new_rate]

# # Update batch_size
# if new_batch_size is not None:
# if mechanism_name == "hotstuff":
# data["remote"][mechanism_name]["node_params"]["mempool"]["batch_size"] = new_batch_size
# elif mechanism_name == "bullshark" or mechanism_name == "cometbft":
# data["remote"][mechanism_name]["node_params"]["batch_size"] = new_batch_size

# with open(json_file_path, "w") as file:
# json.dump(data, file, indent=4)
# print(f"Parameters for {mechanism_name} updated successfully.")
# else:
# print(f"Mechanism {mechanism_name} not found in the JSON file.")

# except Exception as e:
# print(f"An error occurred: {e}")

# def update_batch_size_relative(json_file_path, mechanism_name, relative_tx_rate):
# try:
# with open(json_file_path, "r") as file:
# data = json.load(file)

# if mechanism_name in data["remote"]:
# if mechanism_name == "hotstuff":
# tx_rate = data["remote"][mechanism_name]["bench_params"]["rate"][0]
# tx_size = data["remote"][mechanism_name]["bench_params"]["tx_size"]
# data["remote"][mechanism_name]["node_params"]["mempool"]["batch_size"] = int(tx_size) * (int(tx_rate) + int(relative_tx_rate))
# elif mechanism_name == "bullshark":
# data["remote"][mechanism_name]["node_params"]["batch_size"] = relative_tx_rate
# with open(json_file_path, "w") as file:
# json.dump(data, file, indent=4)
# print(f"Batch count for {mechanism_name} updated to {tx_rate + relative_tx_rate}.")
# else:
# print(f"Mechanism {mechanism_name} not found in the JSON file.")

# except Exception as e:
# print(f"An error occurred: {e}")


if __name__ == "__main__":

batch_sizes = [512, 1024, 10000, 20000, 50000, 80000, 100000, 200000, 300000]
# batch_sizes = [512, 1024, 10000, 20000, 50000, 80000, 100000, 200000, 300000]
batch_sizes = [1000, 5000, 10000, 100000, 1000000, 5000000, 7500000, 10000000, 12500000, 15000000]
# batch_sizes = [-100, 100, -10, 0, 10, 20, 30, 40, 50, 70]

mechanism = ["hotstuff"]

print("Starting benchmarking tool")
Expand Down
8 changes: 4 additions & 4 deletions fab-params.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
4
],
"rate": [
200000
50000
],
"tx_size": 128,
"duration": 300,
"duration": 100,
"runs": 3
},
"node_params": {
Expand All @@ -22,8 +22,8 @@
"gc_depth": 50,
"sync_retry_delay": 5000,
"sync_retry_nodes": 3,
"batch_size": 300000,
"max_batch_delay": 100
"batch_size": 150000,
"max_batch_delay": 5000
}
}
},
Expand Down
27 changes: 27 additions & 0 deletions results/metrics.csv
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,30 @@ run_id,name,faults,input_rate,committee_size,transaction_size,execution_time,bat
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,
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,
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
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,
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,
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,
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
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,
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,
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,
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
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,
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,
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,
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,
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
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,
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,
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,
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
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,
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,
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,
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,
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,
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
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,
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,
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,
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
2 changes: 1 addition & 1 deletion rundata/geo_input.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ id,name,title,location,state,country,state_abbv,continent,latitude,longitude,cou
90,StLouis,St Louis,St Louis,Missouri,United States,MO,1,38.63,-90.2,1,1
125,SaoPaulo,Sao Paulo,Sao Paulo,Sao Paulo,Brazil,SP,2,-23.55,-46.6333,1,1
32,Warsaw,Warsaw,Warsaw,Mazovia,Poland,MZ,3,52.23,21.0108,1,1
169,Perth,Perth,Perth,Western Australia,Australia,WA,4,-31.9522,115.8589,1,10
169,Perth,Perth,Perth,Western Australia,Australia,WA,4,-31.9522,115.8589,1,1

0 comments on commit c959aae

Please sign in to comment.