-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(balances): Adjust balance and alert threhold automation process #5361
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5361 +/- ##
=======================================
Coverage 77.53% 77.53%
=======================================
Files 103 103
Lines 2110 2110
Branches 190 190
=======================================
Hits 1636 1636
Misses 453 453
Partials 21 21
|
"tangle": 3.13, | ||
"telos": 22.7, | ||
"torus": 5.82, | ||
"treasure": 789, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why treasure was so high initially, this is the current burn in the 10 look back window
@@ -0,0 +1,15 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overrides should include new chains, chains with temporarily low balances until we're able to fund more and special cases likes osmosis
|
||
const DAILY_BURN_PATH = | ||
'./config/environments/mainnet3/balances/dailyRelayerBurn.json'; | ||
|
||
const LOOK_BACK_DAYS = 10; // the number of days to look back for average destination tx costs | ||
const MIN_NUMBER_OF_TXS = 200; // the minimum number of txs to consider for daily burn | ||
const MIN_NUMBER_OF_TXS = 100; // the minimum number of txs to consider for daily burn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested change to 100
} | ||
|
||
// push to burnInfoTable | ||
burnInfoTable.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
show user more info about daily burn, specifically dollar values
@@ -1,124 +1,124 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Majority of the reductions are due to 1) 200 min tx => 100 min tx and 2) desiredRelayerBalanceOverrides where we are temporarily keeping the balance low
@@ -1,124 +1,124 @@ | |||
{ | |||
"abstract": 0.00291, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do a through review of all thresholds and manual reduction based on relayer burn after 200 min tx => 100 min tx changes is agreed upon
|
withBalanceThresholdConfig(yargs(process.argv.slice(2))), | ||
).argv; | ||
|
||
const configToUpdate: BalanceThresholdType[] = all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a change to always update all thresholds at once, this enables us to validate and avoid easily falling in different configs being out of whack. It does sacrifice some flexibility, which has been helpful during development, but it is not expected to be required for the production process
orderedThresholds[key] = newThresholds[key]; | ||
}); | ||
return orderedThresholds; | ||
return Object.fromEntries( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided to revert to something I consider more reliable lol
e7a25c8
to
ef8b905
Compare
Description
I haven't throughly checked all balances to see if they are kosher, I will do this once we have agreement on the 100 to 200 tx change
update-balance-threshold-config
Support
desiredRelayerBalanceOverrides.json
, allow us to override this threshold for new chains, chains were we need to maintain a temporary low balance and special cases like osmosis. Alert thresholds are also adjusted based on this override. The overrides also allows us to respond to cases where the current thresholds are significantly larger than the proposed values and we want to resetInform user if the proposed thresholds or daily burn estimation is 50% less than the current values, prompt user for manual review
If we want to reduce the thresholds, we can add an entry into the
desiredRelayerBalanceOverrides.json
and callupdate-balance-threshold-config.ts
the reset all thresholds.I haven't done any manual threshold reductions yet, I think this would be good to do in a quick follow up do the changes are more obvious
Add validation which checks if all the thresholds makes sense
![image](https://private-user-images.githubusercontent.com/22501692/409580234-b46bd0e5-85f9-4a1d-bc0e-b6e15c889f5d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4MzU3NDIsIm5iZiI6MTczODgzNTQ0MiwicGF0aCI6Ii8yMjUwMTY5Mi80MDk1ODAyMzQtYjQ2YmQwZTUtODVmOS00YTFkLWJjMGUtYjZlMTVjODg5ZjVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDA5NTA0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI5MmIyNWRjNmVjMzUxZjg2MmVhMGFkMjJhOTU5Mzk1Yjg4NjZmYzNjNjFkMTJhYjM2ZTdjMjNiYzBiYTExYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dX8MgqEkDRMJB5M6-Q0PheWNZKLXlUChAIiIA1J0_xU)
lowUrgencyKeyFunderBalance[chain] > desiredRelayerBalances[chain] > lowUrgencyEngKeyFunderBalance[chain] > highUrgencyRelayerBalance[chain]
Add
lowUrgencyEngKeyFunderBalance.json
configwrite-alert.ts
Next Steps
Testing
Manual