-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly handle trx.ref_block_prefix == tapos_block_summary.block_id._hash[1] #680
Comments
This means the node you've been connected to didn't had correct tapos block, probably it wasn't synced, probably this is related to recent network stuck. |
In the future we can add reconnection to another node when catching this error. |
I mean a check inside dexbot/orderengines/bitshares_engine.py |
We should have auto next node within retry_action() and for all places where any order activity is happening (place, cancel orders). I can add the check but in general node rotation should be handled by node manager. |
place, cancel orders all uses |
Expected Behavior
No error
Actual Behavior
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubuntu/dexbot/dexbot/orderengines/bitshares_engine.py", line 133, in _cancel_orders
orders, account=self.account, fee_asset=self.fee_asset['id']
File "/home/ubuntu/dexbot/dexbot/orderengines/bitshares_engine.py", line 648, in retry_action
return action(*args, **kwargs)
File "/home/ubuntu/.local/lib/python3.6/site-packages/bitshares/bitshares.py", line 956, in cancel
return self.finalizeOp(op, account["name"], "active", **kwargs)
File "/home/ubuntu/.local/lib/python3.6/site-packages/graphenecommon/chain.py", line 227, in finalizeOp
return self.txbuffer.broadcast()
File "/home/ubuntu/.local/lib/python3.6/site-packages/graphenecommon/transactionbuilder.py", line 504, in broadcast
raise e
File "/home/ubuntu/.local/lib/python3.6/site-packages/graphenecommon/transactionbuilder.py", line 502, in broadcast
self.blockchain.rpc.broadcast_transaction(ret, api="network_broadcast")
File "/home/ubuntu/.local/lib/python3.6/site-packages/grapheneapi/api.py", line 176, in func
self.post_process_exception(e)
File "/home/ubuntu/.local/lib/python3.6/site-packages/bitsharesapi/bitsharesnoderpc.py", line 24, in post_process_exception
raise exceptions.UnhandledRPCError(msg)
bitsharesapi.exceptions.UnhandledRPCError: Assert Exception: trx.ref_block_prefix == tapos_block_summary.block_id._hash[1]:
bbot6 using account bbot6 on BTS/USD - ERROR - Unable to cancel order
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.6/site-packages/grapheneapi/api.py", line 168, in func
r = func(*args, **kwargs)
File "/home/ubuntu/.local/lib/python3.6/site-packages/grapheneapi/rpc.py", line 138, in method
message = self.parse_response(r)
File "/home/ubuntu/.local/lib/python3.6/site-packages/grapheneapi/rpc.py", line 106, in parse_response
raise RPCError(ret["error"]["message"])
grapheneapi.exceptions.RPCError: Assert Exception: trx.ref_block_prefix == tapos_block_summary.block_id._hash[1]:
Steps to Reproduce the Problem
│ buy_order_amount: 1.0
│ buy_order_size_threshold: 1.0
│ fee_asset: BTS
│ lower_bound: 0.01
│ market: BTS/USD
│ min_order_lifetime: 6
│ mode: both
│ module: dexbot.strategies.king_of_the_hill
│ relative_order_size: True
│ sell_order_amount: 1.0
│ sell_order_size_threshold: 1.0
│ upper_bound: 1.0
Specifications
The text was updated successfully, but these errors were encountered: