[#767] Use `head~2` block in `branch` field of RPC operations
Description
Problem: We use the head
block ID in the branch
field of the
run_operation
, forge
and preapply
operations.
However, with the introduction of the ithaca
protocol and the
Tenderbake consensus algorithm, it is no longer safe to use the head
block as the branch of those operations, because that block "is not
necessarily final".
Solution: Use the head~2
block instead, as recommended by the docs:
https://web.archive.org/web/20220305165609/https://tezos.gitlab.io/protocols/tenderbake.html
Related issue(s)
Resolves #767 (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.
Edited by Diogo Castro