|
|
3 anni fa | |
|---|---|---|
| .. | ||
| .ipynb_checkpoints | 3 anni fa | |
| blockchain_scripts | 3 anni fa | |
| core | 3 anni fa | |
| img | 3 anni fa | |
| log | 3 anni fa | |
| pid | 3 anni fa | |
| reports | 3 anni fa | |
| search_space | 3 anni fa | |
| README.md | 3 anni fa | |
| __init__.py | 3 anni fa | |
| acc_vs_staked_ratio.py | 3 anni fa | |
| discrete_instance.py | 3 anni fa | |
| draw.py | 3 anni fa | |
| example.csv | 3 anni fa | |
| playground.ipynb | 3 anni fa | |
| primary_discrete_auto_crawler.py | 3 anni fa | |
| secondary_discrete_auto_crawler.py | 3 anni fa | |
| secondary_takahashi_auto_crawler.py | 3 anni fa | |
| takahashi_instance.py | 3 anni fa | |
| vesting.py | 3 anni fa | |
title: darkfi lottery simulation author: ertosns
simulate darkfi consensus lottery with a discrete controller
control lottery f tunning paramter
$$f[k] = f[k-1] + K_1e[k] + K_2e[k-1] + K_3e[k-2]$$
with $k_1 = k_p + K_i + K_d$, $k_2 = -K_p -2K_d$, $k_3 = K_d$, and e is the error function.
find $K_p$, $k_i$, $K_d$ for highest accuracy running the simulation on N trials, of random number of nodes, starting with random airdrop (that all sum to total network stake), running for random runing time.
notice that best parameters are spread out in the search space, picking the highest of which, and running the simulation, running for 600 slots, result in with >36% accuracy
notice below that both y,T in the pallas field, and simulation have same range.
using discrete controller the lottery accuracy > 33% with randomized number of nodes, and randomized relative stake. can be coupled with khonsu^1 to achieve 100% accuracy and instant finality.
Replace example.csv with local distribution data. Modify the file name
in core/constants.py as follows:
VESTING_FILE='example.csv'
Then run the program:
python vesting.py
When prompted, enter the number of slots the simulation should run for. For testing purposes keep the slot time to 1-5k slots.