[#816] Implement wait-for-operation via RPC
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
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.