-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Althea L1 will natively use stablecoins like USDC and USDT these are 6 decimal of precision tokens versus DAI and native ETH having 18 decimals of precision. This is extermely relevant becuase of the way we encode prices in babel in wei/byte. Where a wei is 1*10^-18 of a whole token. This provides us a good range of pricing possibilities. But if we encode in 1 micro token / byte and the token being used to price is worth $1 then the minimum bandwidth price is $1000/gb which is obviously not useful practically. This means we need to convert from 18 decimal accounting for bandwdith into 6 decimal accounting for payments on Althea chain. Previously instead of doing this properly we added 1 micro token to every conversion operation and in the Althea payment test confirmed one micro token was sent. This patch resolves the issue by fixing rounding (no more randomly adding one unit) and modifying the tests to price banwidth more realistically, with prices represnting 10-25c a gigabyte versus some miniscule fraction of that. This means that an actual payment of a realistic amount can be made in the Althea payments test and confirmed.
- Loading branch information
Showing
8 changed files
with
315 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.