Skip to content

Proto: allow account manager to submit proposals and to cast votes

G.-B. Fefe requested to merge g.b.fefe/tezos:ld2 into master

Context

This is an implementation for : tzip!175 (closed), see also : https://forum.tezosagora.org/t/rfc-allow-delegators-to-subsume-their-delegate-votes/4212

Testing

 dune exec tezt/tests/main.exe -- --color --file manager_voting.ml --verbose

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.rst for the protocol and the environment, the Development Version section of CHANGES.md for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR

Implementation details

At the start of a voting period, the listings, as reported by the RPC /votes/listings should only contains the active bakers with at least one roll. The initial voting power of a baker is its full staking balance at the start of the voting period.

Latter on during the voting cycle, implicit accounts with an active baker at the start of the voting period might be added to the listings. They are lazily added when they cast a vote.

For that purpose, at the start of a voting period the protocol now takes a snapshot of the balance and delegation of all accounts. When the manager of an account cast a vote, she is added to the listings with their snapshotted balance as voting power; and the same amount of voting power is removed from their snapshotted delegate. Thus the total voting power is constant in the listings during the whole voting period. This MR try to be efficient while snapshotting balance of all accounts.

Edited by G.-B. Fefe

Merge request reports