Skip to content

[#816] Implement wait-for-operation via RPC

Nikolay Yakimov requested to merge lierdakil/#816-wait-for-rpc into master

Note: I've hard-coded the number of retries. This doesn't sound good, but I'm not sure how we would parametrize that.

Description

Problem: tezos-client's wait for operation only looks for the operation hash in head. There are circumstances when operation might be included, but with failing status. We'd like to test for that. Besides, we also need waiting for operations on pure RPC interface, too.

Solution: Implement wait-for-operation via RPC. The logic here mimics tezos-client, for the most part, with the exception that the status of the operation is checked and an exception is thrown if it's failing, and the backwards search terminates on the FinalHead we've seen before running the operation instead of arbitrary lookbehnid.

Problem: We have observed that operation injection on network can fail after preapply succeeds. We'd like to retry if this happens.

Solution: Try to reapply operations in case of errors a couple times.

Related issue(s)

Resolves #816 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Nikolay Yakimov

Merge request reports