refactor: improve price cap configuration #101
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old max cost for total transaction didn't make sense as everything is handled in the per compute unit pricing and in the grand scheme of things we care about the price of an update not a transaction (which can have between 1 to 12 updates). This will make the behaviour simpler. Also, there were cases where the tx had little updates and the per compute unit price went very high and it impacted other publishers.
This is a non-breaking change because the config reader ignores incorrect fields (I checked it).
The default cap is also changed to 10 million as there have been spikes up to 6 million in the past. If publishers have working ws + short pulls. For this reason I changed the default for pull duration to 5 seconds which can have bad impact on Pythnet but the network load is not that high.
I considered injecting slot data via websocket and polling to make sure the global data is up to date but there is no way to subscribe to latest confirmed slot and also relying on the context for the updates won't be useful (because if there is no update coming, we don't know whether it is a websocket problem or not any actual update).
After this rollout, we won't have massive sol burn incident anymore because we always halve the median of the minimum landed tx over the past slots (whereas previously we just used that value).