Skip to content
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

retry_action looses ops when invoked with self.execute #773

Open
bitphage opened this issue May 26, 2020 · 1 comment
Open

retry_action looses ops when invoked with self.execute #773

bitphage opened this issue May 26, 2020 · 1 comment

Comments

@bitphage
Copy link
Collaborator

execute() is broadcasting transactions from current txbuffer, while retry_action() clears txbuffer on retry.

Traceback (most recent call last):
  File "/home/vvk/devel/DEXBot-prod/dexbot/worker.py", line 131, in on_block
    self.workers[worker_name].ontick(data)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-prod-N9mtHQyI/lib/python3.7/site-packages/events/events.py", line 95, in __call__
    f(*a, **kw)
  File "/home/vvk/devel/DEXBot-prod/dexbot/strategies/staggered_orders.py", line 2248, in tick
    self.maintain_strategy()
  File "/home/vvk/devel/DEXBot-prod/dexbot/decorators.py", line 21, in wrapper
    func(self, *args, **kwargs)
  File "/home/vvk/devel/DEXBot-prod/dexbot/strategies/staggered_orders.py", line 197, in maintain_strategy
    trx = self.retry_action(self.execute)
  File "/home/vvk/devel/DEXBot-prod/dexbot/orderengines/bitshares_engine.py", line 692, in retry_action
    return action(*args, **kwargs)
  File "/home/vvk/devel/DEXBot-prod/dexbot/orderengines/bitshares_engine.py", line 510, in execute
    r = self.bitshares.txbuffer.broadcast()
  File "/home/vvk/.local/share/virtualenvs/DEXBot-prod-N9mtHQyI/lib/python3.7/site-packages/graphenecommon/transactionbuilder.py", line 514, in broadcast
    raise e
  File "/home/vvk/.local/share/virtualenvs/DEXBot-prod-N9mtHQyI/lib/python3.7/site-packages/graphenecommon/transactionbuilder.py", line 508, in broadcast
    ret, api="network_broadcast"
  File "/home/vvk/.local/share/virtualenvs/DEXBot-prod-N9mtHQyI/lib/python3.7/site-packages/grapheneapi/api.py", line 176, in func
    self.post_process_exception(e)
  File "/home/vvk/.local/share/virtualenvs/DEXBot-prod-N9mtHQyI/lib/python3.7/site-packages/bitsharesapi/bitsharesnoderpc.py", line 24, in post_process_e
xception
    raise exceptions.UnhandledRPCError(msg)
bitsharesapi.exceptions.UnhandledRPCError: operations.size() > 0: A transaction must have at least one operation
@abitmore
Copy link

I encountered this issue today when debugging.

Before this, there was a warning retrying on 'Execution error: Assert Exception: now <= trx.expiration:' and then the txbuffer was cleared.

I think we can simply return None when action is self.execute and txbuffer is cleared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants