HomePhabricator

[avalanche] Add a new staking reward selection algorithm

Description

[avalanche] Add a new staking reward selection algorithm

Summary:
This algo computes a score locally for each proof that is independent of
the proof set, and picks a proof based on the score. The change to get
selected is proportianal to the staked amount.

This improves on the previous algorithm in a few ways:

  • It is inherently tolerant to a missing proof as long as the missing proof is not the winner. This removes the need for a list of winners entirely.
  • Each individual proof has no impact on the selection (except for itself) which makes this algorithm more robust against manipulation.

Due to the nature of this algo, it is impossible to predict the winner
in tests by manipulating the proofs or the blockhash like with the
previous algorithm.

The algorithm is currently not in use and will replace its predecessor
in a subsequent diff.

Test Plan:

ninja check-avalanche

Run the Gitian build

Reviewers: #bitcoin_abc, PiRK, Mengerian, bytesofman

Reviewed By: #bitcoin_abc, PiRK, Mengerian, bytesofman

Subscribers: PiRK, bytesofman, Mengerian

Differential Revision: https://reviews.bitcoinabc.org/D14484

Details

Provenance
FabienAuthored on Sep 8 2023, 17:24
FabienPushed on Sep 18 2023, 07:05
Reviewer
Restricted Project
Differential Revision
D14484: [avalanche] Add a new staking reward selection algorithm
Parents
rABC470667730709: [electrum] move some methods from Transaction to TxInput
Branches
Unknown
Tags
Unknown