Skip to content

Commit

Permalink
Log every ten tx receipts in performance 005 (#375)
Browse files Browse the repository at this point in the history
* Twice a day

* Up the gas, log every ten
  • Loading branch information
moraygrieve authored Nov 12, 2024
1 parent f6271f4 commit 7c284ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/local_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: '[locally] Run local tests'
run-name: Run local tests (${{ github.event_name }})
on:
schedule:
- cron: '0 */6 * * *'
- cron: '0 */12 * * *'
workflow_dispatch:
inputs:
target_branch:
Expand Down
13 changes: 11 additions & 2 deletions tests/ten/ten_per_005/Input/storage_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ def create_signed_tx(name, account, nonce, contract, gas_price, gas_limit, chain
return account.sign_transaction(build_tx)


def tenths(list):
every_tenth = list[9::10]
last_element = list[-1]
if last_element not in every_tenth:
return every_tenth + [last_element]
return every_tenth


def run(name, chainId, web3, account, contract, num_iterations, gas_limit):
"""Run a loop of bulk loading transactions into the mempool, draining, and collating results. """
logging.info('Creating and signing %d transactions', num_iterations)
Expand All @@ -40,8 +48,9 @@ def run(name, chainId, web3, account, contract, num_iterations, gas_limit):
stats[1] += 1
logging.warning('Ratio failures = %.2f', float(stats[1]) / sum(stats))

logging.info('Waiting for last transaction %s', receipts[-1][0].hex())
web3.eth.wait_for_transaction_receipt(receipts[-1][0], timeout=900)
for receipt in tenths(receipts):
logging.info('Waiting for transaction receipt number %s', receipt[1])
web3.eth.wait_for_transaction_receipt(receipt[0], timeout=900)
logging.info('Retrieved value for %s is %d', name, contract.functions.getItem(name).call())

logging.info('Constructing binned data from the transaction receipts')
Expand Down
2 changes: 1 addition & 1 deletion tests/ten/ten_per_005/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def execute(self):
self.chain_id = network.chain_id()
self.gas_price = web3.eth.gas_price
params = {'from': account.address, 'chainId': web3.eth.chain_id, 'gasPrice': self.gas_price}
self.gas_limit = storage.contract.functions.setItem('test', 1).estimate_gas(params)
self.gas_limit = 4*storage.contract.functions.setItem('test', 1).estimate_gas(params)
funds_needed = 1.1 * self.ITERATIONS * (self.gas_price*self.gas_limit)

# run the clients
Expand Down

0 comments on commit 7c284ed

Please sign in to comment.