diff --git a/hybrid-compute/aa_utils/__init__.py b/hybrid-compute/aa_utils/__init__.py index 31fc3ff..ed60508 100644 --- a/hybrid-compute/aa_utils/__init__.py +++ b/hybrid-compute/aa_utils/__init__.py @@ -174,6 +174,10 @@ def sign_submit_op(self, op, owner_key): break if 'error' in response.json(): emsg = response.json()['error']['message'] + if emsg == "replacement underpriced": + print("*** Retrying with increased maxPriorityFeePerGas") + op['maxPriorityFeePerGas'] += 1 + time.sleep(5) # Workaround for sending debug_traceCall to unsynced node if not re.search(r'message: block 0x.{64} not found', emsg): break @@ -188,7 +192,7 @@ def sign_submit_op(self, op, owner_key): op_hash = {} op_hash['hash'] = response.json()['result'] timeout = True - for _ in range(100): + for _ in range(500): print("Waiting for receipt...") time.sleep(10) op_receipt = requests.post(self.bundler_url, json=request( diff --git a/hybrid-compute/deploy-local.py b/hybrid-compute/deploy-local.py index 3f5101b..ee76958 100644 --- a/hybrid-compute/deploy-local.py +++ b/hybrid-compute/deploy-local.py @@ -239,7 +239,7 @@ def deploy_account(factory, owner): return acct_addr def deploy_forge(script, cmd_env): - args = ["forge", "script", "--silent", "--json", "--broadcast"] + args = ["forge", "script", "--silent", "--json", "--broadcast", "--via-ir"] args.append("--rpc-url=http://127.0.0.1:9545") args.append("--contracts") if ep7: diff --git a/hybrid-compute/offchain/userop_utils.py b/hybrid-compute/offchain/userop_utils.py index 753ac3a..68bae27 100644 --- a/hybrid-compute/offchain/userop_utils.py +++ b/hybrid-compute/offchain/userop_utils.py @@ -84,6 +84,13 @@ print("EP at", EP.address) +boba_token = os.environ['BOBA_TOKEN'] + +def boba_balance(addr): + """Returns the Boba token balance of an address""" + bal_calldata = selector("balanceOf(address)") + ethabi.encode(['address'], [addr]) + bal = w3.eth.call({'to':boba_token, 'data':bal_calldata}) + return Web3.to_int(bal) def show_balances(): print("CLIENT_ADDR", EP.functions.getDepositInfo( @@ -92,6 +99,9 @@ def show_balances(): bundler_addr).call(), w3.eth.get_balance(bundler_addr)) print("OC_HYBRID_ACCOUNT ", EP.functions.getDepositInfo( HA.address).call(), w3.eth.get_balance(HA.address)) + print("Helper BOBA token:", boba_balance(HH.address)) + print("HybridAcct BOBA token:", boba_balance(HA.address)) + print("Client BOBA token:", boba_balance(u_account)) # -------------------------------------------------------------