Skip to content

Commit

Permalink
Upload eblocbroker_wf_test-results_October_2023-2.xlsx as test results
Browse files Browse the repository at this point in the history
  • Loading branch information
avatar-lavventura committed Nov 11, 2023
1 parent 49e3945 commit e0d987b
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 1,312 deletions.
2 changes: 2 additions & 0 deletions broker/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ def connect_to_eblocbroker() -> None:
env.TOKEN_CONTRACT_ADDRESS, abi=read_abi_file(env.EBB_SCRIPTS / "abi_usdtmy.json")
)

"""
from brownie import project as pro
roc_contract_address = "0x3fb704dfDB72Fc06860D9F09124C30919488f13C"
_project = pro.load(env.CONTRACT_PROJECT_PATH / "_other" / "roc")
config.roc = _project.ResearchCertificate.at(roc_contract_address)
config.roc.contract_address = cfg.w3.toChecksumAddress(roc_contract_address)
config._roc = cfg.w3.eth.contract(roc_contract_address, abi=read_abi_file(env.EBB_SCRIPTS / "abi_roc.json"))
"""

except Exception as e:
print_tb(e)
Expand Down
Git LFS file not shown
3 changes: 3 additions & 0 deletions broker/results/eblocbroker_wf_test-results_October_2023.xlsx
Git LFS file not shown
27 changes: 27 additions & 0 deletions broker/roc/example_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/bloxberg/schema/research_object_certificate_v1"
],
"type": ["VerifiableCredential", "BloxbergCredential"],
"issuer": "https://raw.githubusercontent.com/bloxberg-org/issuer_json/master/issuer.json",
"issuanceDate": "2023-10-13T19:33:33.818511+00:00",
"credentialSubject": {
"id": "https://blockexplorer.bloxberg.org/address/0x29e613B04125c16db3f3613563bFdd0BA24Cb629",
"issuingOrg": { "id": "https://bloxberg.org" }
},
"id": "https://bloxberg.org",
"crid": "0xabcd",
"cridType": "sha2-256",
"metadataJson": "{\"authorName\": \"alper\", \"researchTitle\": \"\", \"emailAddress\": \"[email protected]\"}",
"proof": {
"type": "MerkleProof2019",
"created": "2023-10-13T19:33:42.989482",
"proofValue": "z7veGu1qoKR3AS5LTdxmF14v4PgnHi638vsnMvoFthRMjLxGsnmC6Nu7Jv85Wf7AeViLhmsqNZVgYufRHUjcngRs6HoN5TJU1qUCkQSqa4TC8J7rsa8bcQtToi1H7keJBtA4dTMCYfrgwYaBSBYnoEDGjVyNiRxj9grfR7hn8WAa1CqcLWDuYwdwt2GuCcQHmqhacVWyimkXyav63cqxCeNvnYNX3cwvyb3osXTTUuncx2SfZsCNTSogYZ5pc3kGD6CjnXJSrBBAYjDhZRtLJQ5SPSyuW78SxYJQG24sPZb3XQZrzCe3Ws",
"proofPurpose": "assertionMethod",
"verificationMethod": "ecdsa-koblitz-pubkey:0xD748BF41264b906093460923169643f45BDbC32e",
"ens_name": "mpdl.berg"
}
}
]
72 changes: 35 additions & 37 deletions broker/test_setup_w/read_txs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
is_excel = True
if is_excel:
log(
"name,provider_label,id,sourceCodeHash,index,job_id,received_bn,w_type,elapsed_time,processPayment_tx_hash,"
"type,provider_label,id,sourceCodeHash,index,job_id,received_bn,w_type,elapsed_time,processPayment_tx_hash,"
"processPayment_gasUsed,submitJob_tx_hash,submitJob_gas_used,data_transfer_in_to_download,data_transfer_out,"
"job_price"
)
Expand All @@ -26,7 +26,6 @@


def read_txs_layer(n, edges, fn):
checked = {}
BASE = Path.home() / "test_eblocbroker" / "workflow" / f"{n}_{edges}"
try:
with open(BASE / fn, "rb") as f:
Expand Down Expand Up @@ -81,25 +80,26 @@ def read_txs_layer(n, edges, fn):
tx_receipt = Ebb.get_transaction_receipt(logged_receipt["transactionHash"].hex())
total_processpayment_gas += int(tx_receipt["gasUsed"])
if is_excel:
if job_id == 0:
if int(job_id) == 0:
log(
f"{name},{provider_id[provider.lower()]},j{idx},{job_key},{index},{job_id},{received_bn},{n}_{edges},{output['run_time'][job_id]},"
f"{name},{provider_id[provider.lower()]},j{idx},{job_key},{index},{job_id},{received_bn},{n}_{edges},{output['run_time'][int(job_id)]},"
f"{tx_receipt['transactionHash'].hex()},{tx_receipt['gasUsed']},{output_g['submitJob_tx_hash']},{output_g['submitJob_gas_used']},"
f"{output_g['data_transfer_in_to_download']},{output_g['data_transfer_out']},{jp}"
)
else:
log(
f"{name},{provider_id[provider.lower()]},j{idx},{job_key},{index},{job_id},{received_bn},{n}_{edges},{output['run_time'][job_id]},"
f"{name},{provider_id[provider.lower()]},j{idx},{job_key},{index},{job_id},{received_bn},{n}_{edges},{output['run_time'][int(job_id)]},"
f"{tx_receipt['transactionHash'].hex()},{tx_receipt['gasUsed']}"
)

log(f"LAYER {n} {edges}")
log(f"total_submitjob_gas={total_submitjob_gas}")
log(f"total_processpayment_gas={total_processpayment_gas} idx={idx}")
log(f"total_received={sum_received} [pink]USDmy")
log(f"total_refunded={Cent(total_refunded)._to()} [pink]USDmy")
log(f"job_price_sum={job_price_sum}")
log("--------------------------------------------------------")
if not is_excel:
log(f"LAYER {n} {edges}")
log(f"total_submitjob_gas={total_submitjob_gas}")
log(f"total_processpayment_gas={total_processpayment_gas} idx={idx}")
log(f"total_received={sum_received} [pink]USDmy")
log(f"total_refunded={Cent(total_refunded)._to()} [pink]USDmy")
log(f"job_price_sum={job_price_sum}")
log("--------------------------------------------------------")


def read_txs(n, edges, fn):
Expand Down Expand Up @@ -168,41 +168,39 @@ def read_txs(n, edges, fn):
# log(logged_receipt.args)
# log()

log()
log(f"* HEFT {n} {edges}")
log(f"total_submitjob_gas={total_submitjob_gas}")
log(f"total_processpayment_gas={total_processpayment_gas} idx={idx}")
log(f"total_received={sum_received} [pink]USDmy")
log(f"total_refunded={Cent(total_refunded)._to()} [pink]USDmy")
log(f"job_price_sum={job_price_sum}")
log("--------------------------------------------------------")
if not is_excel:
log()
log(f"* HEFT {n} {edges}")
log(f"total_submitjob_gas={total_submitjob_gas}")
log(f"total_processpayment_gas={total_processpayment_gas} idx={idx}")
log(f"total_received={sum_received} [pink]USDmy")
log(f"total_refunded={Cent(total_refunded)._to()} [pink]USDmy")
log(f"job_price_sum={job_price_sum}")
log("--------------------------------------------------------")


def main():
"""
test = [(20, 25), (40, 50), (60, 72), (80, 100), (100, 125), (120, 150), (140, 200), (160, 225)]
test = dict(test)
for n, edges in test.items():
read_txs(n, edges)
breakpoint() # DEBUG
"""
###

test = [(16, 28), (32, 56), (64, 112), (128, 224), (256, 448)]
test = [(16, 28)]
# test = [(16, 28)]
# test = [(32, 56)]
# test = [(64, 112)]
# test = [(128, 224)]
# test = [(256, 448)]
test = dict(test)
for n, edges in test.items():
read_txs(n, edges, "heft_submitted_dict_1.pkl")
# read_txs(n, edges, "heft_submitted_dict_2.pkl")
# read_txs(n, edges, "heft_submitted_dict_3.pkl")
log("\n\n\n")
read_txs(n, edges, "heft_submitted_dict_2.pkl")
log("\n\n\n")
read_txs(n, edges, "heft_submitted_dict_3.pkl")
# -----------------------------------------------------
# read_txs_layer(n, edges, "layer_submitted_dict_1.pkl")
# read_txs_layer(n, edges, "layer_submitted_dict_2.pkl")
# read_txs_layer(n, edges, "layer_submitted_dict_3.pkl")
log("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-", "yellow")
read_txs_layer(n, edges, "layer_submitted_dict_1.pkl")
log("\n\n\n")
read_txs_layer(n, edges, "layer_submitted_dict_2.pkl")
log("\n\n\n")
read_txs_layer(n, edges, "layer_submitted_dict_3.pkl")
if not is_excel:
log("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-", "yellow")


if __name__ == "__main__":
Expand Down
2 changes: 0 additions & 2 deletions contract/_other/roc/.gitattributes

This file was deleted.

6 changes: 0 additions & 6 deletions contract/_other/roc/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions contract/_other/roc/README.org

This file was deleted.

Loading

0 comments on commit e0d987b

Please sign in to comment.