Proto: Support for BLS signatures and tz4 accounts in protocol
Context
Fixes #2881 (closed), #2492 (closed).
This MR adds support for tz4 accounts in the protocol and support for BLS signatures throughout.
The main pain point is the size of the signatures which can now be 64 or 96 bytes (instead of only 64 bytes previously). The binary encodings (especially for operations) relies on the fact that the signature is of a known fixed size, so we had to implement workarounds to preserve binary compatibility for operations.
If we used BLS MinSig (where signatures are 48 bytes, but public keys are 96 bytes) instead of MinPk, this would have been a lot more straightforward.
Depends on:
Dependency graph of staked MR for this feature is as such:
graph BT
!5444 --> !6171
!6302 --> !6287
!6302 --> !6295
!5444 --> !6302
!6291[<s>!6291] -.-> !6282
!6295 -.-> !6291
!6295 --> !6282
click !6171 "https://gitlab.com/tezos/tezos/-/merge_requests/6171"
click !6282 "https://gitlab.com/tezos/tezos/-/merge_requests/6282"
click !6287 "https://gitlab.com/tezos/tezos/-/merge_requests/6287"
click !5444 "https://gitlab.com/tezos/tezos/-/merge_requests/5444"
click !6291 "https://gitlab.com/tezos/tezos/-/merge_requests/6291"
click !6295 "https://gitlab.com/tezos/tezos/-/merge_requests/6295"
click !6302 "https://gitlab.com/tezos/tezos/-/merge_requests/6302"
style !6171 fill:#afa
style !6282 fill:#afa
style !6291 fill:#fff
style !6295 fill:#afa
style !6287 fill:#afa
The gas model needs to be updated in a follow up MR (see #3183 (closed)).
Manually testing the MR
To ensure binary backward compatibility:
dune exec tezt/tests/main.exe -- -f retro.ml
Test the rest:
dune exec tezt/tests/main.exe -- bls
Unit tests:
dune exec src/proto_alpha/lib_protocol/test/pbt/test_operation_encoding.exe
dune exec src/proto_alpha/lib_protocol/test/unit/test_operation_repr.exe
dune exec ./src/proto_alpha/lib_protocol/test/unit/main.exe -- test Operation_repr
dune exec src/proto_alpha/lib_protocol/test/integration/operations/main.exe -- test "^transfer$"
dune exec src/proto_alpha/lib_protocol/test/integration/consensus/main.exe -- test "^consensus key$"
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR