Fix/handle all decimal conversions#8
Merged
unconst merged 8 commits intoopentensor:masterfrom Jan 7, 2025
Merged
Conversation
sam0x17
approved these changes
Jan 7, 2025
There was a problem hiding this comment.
Looks good to me, some nits:
- tests covering maximum and minimum values for u64 and U256 in the balance converters would be nice, but the bound checks look correct
- would be nice if we could get a more detailed description / name for
EVM_DECIMALS_FACTORlikeEVM_TO_SUBSTRATE_DECIMALSmaybe? - The
into_evm_balanceand into_substrate_balance methods usechecked_mulandchecked_div. We might want to do some logging when the conversion fails
13 tasks
Author
See opentensor/subtensor#1129 for most of those fixes |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes an issue with the gas charging on the EVM layer.
The gas was withdrawn at the limit, but the unused gas was not refunded.
This happened because the refund calculation never converted the remainder to the right magnitude, meaning the refund was
<1 RAOand refunded as0 RAO