[go: up one dir, main page]

Proto: do not use snapshot to compute rights

Context

To compute rights, instead of using snapshots of stakes which makes things hard to reason with, we can use:

  • for staked tez, the value at the end of the cycle; those tez are going to stay frozen for at least 7 more cycles;
  • for delegated tez, the minimum over the cycle; if you switched delegate or if you staked during the cycle, then those tez do not bring rights in that cycle.

I think it has the good properties:

  • not counting twice the same tez,
  • not bringing rights to people moving tez, hence preventing people buying and selling tez right before the snapshot to gather the rights.

What we lose is the consistency that the sum of rights correspond to the sum of delegated+frozen stake at some point in time.

The MR is made based on !10413 (merged), !11086 (merged), !11197 (merged), and made of:

Manually testing the MR

See updated tests.

Some AI tests are still broken, they make assumptions on what the snapshot contains. Leaving the fix to @lrand

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, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Mehdi Bouaziz

Merge request reports

Loading