Closed kaiwetlesen closed 1 year ago
It would seem indeed that the allocation optimiser is rounding the optimal allocation somewhere that it should not:
Python 3.10.7
>>> self_stake = 10000000100000000000000000
>>> delegated_tokens = 6631901656669909529623937
>>> total_stake = self_stake + delegated_tokens
>>> print(total_stake)
16631901756669909529623937
>>> import math
>>> fp_total_stake = total_stake / math.pow(10,18)
>>> print(fp_total_stake)
16631901.756669909
>>> allocations = [4495710291212000000000000, 6538176653363000000000000, 1440996064083000000000000, 4157018748012000000000000]
>>> total_allocations = sum(allocations)
>>> print(total_allocations)
16631901756670000000000000
>>> fp_total_allocations = total_allocations / math.pow(10,18)
>>> print(fp_total_allocations)
16631901.75667
>>> if total_stake < total_allocations:
... print('No way Jose!')
...
No way Jose!
>>>
Values taken from the resultant actions as noted in the log above.
Values for self_stake
and delegated_tokens
may be obtained via this GraphQL query:
query($addr: String) {
indexer(id: $addr) {
indexer_id: id
indexer_name: defaultDisplayName
self_stake: stakedTokens
delegated_stake: delegatedTokens
}
}
Variants:
{"addr":"0xd75c4dbcb215a6cf9097cfbcc70aab2596b96a9c"}
Contents of whitelist.csv:
whitelist,blacklist,pinnedlist,frozenlist
QmQDGVhAjCh3gkdMznBMUkSUhPZEK5mwdjYqJUukdeJsee,,,
QmbHg6vAJRD9ZWz5GTP9oMrfDyetnGTr5KWJBYAq59fm1W,,,
QmWkVS3Uzr2WsTwvxtte2dpHbSYJSQ1bTQMVciKXCWx7TM,,,
QmcpX4ScNaWfSE1ZmfEFM3mPSCz5frk6edwsYMAvfGtrXV,,,
QmYDgkkfE3d9y1C5RPmVLmoxayWpFZDuiAiQYqUpFnHFiE,,,
QmVQdzeGdPUiLiACeqXRpKAYpyj8Z1yfWLMUq7A7WundUf,,,
QmeUiEKEDTJ5gPRoN5FcUZn2tp1cBdae5DMbFDiL8UPxrZ,,,
QmfUeMt1bhS5mGmBQWABkJAsVG1mBmZjfrrtUX5Ce9NSA5,,,
QmZXc689BRN9ZDRc6EBfT1QvU9c56ewkiZJ9uXgvN8wd2X,,,
QmRDGLp6BHwiH9HAE2NYEE3f7LrKuRqziHBv76trT4etgU,,,
QmaaDA7XVVktfxCLMgfwG1z3KM8DSMoLkbemkTt9mQT8Qf,,,
QmeQ69NF8EWnaBCV9VaNhEBcAtie82Px64qEF8MpPCiEGS,,,
QmTKXLEdMD6Vq7Nwxo8XAfnHpG6H1TzL1AGwiqLpoae3Pb,,,
QmdemKB9KFeuDcCxRn2iBuRE35LSZ63vDBCdKaBtaw2Qm9,,,
Qmaz1R8vcv9v3gUfksqiS9JUz7K9G8S5By3JYn8kTiiP5K,,,
QmeqmxPhWWNb9Piboswf92LmzspSxN8ZV7UkK5c9yJoc4B,,,
QmZDfRpakj4BTNaRUDiCAknzE5rbXQcQm2hRYzX8kNSpx6,,,
should be resolved here: b16af80b2a03466f54929bf8f88ef18267df1a35
Bug Description AllocationOpt generates actions which are not executable due to the optimiser allocating fractionally more tokens than those which are in available stake.
To Reproduce Steps to reproduce the behavior:
Expected behavior AllocationOpt generates optimal rules which are actionable based on the premise that the total of all allocations is less than or equal to the total available stake.
Desktop (please complete the following information):
Additional context Logs from Indexer Agent after executing actions proposed by the Allocation Optimiser: