-
Notifications
You must be signed in to change notification settings - Fork 44
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
Incorrect ContractCostType::MapEntry
calibration
#1067
Comments
Also since map is implemented via vec, the cost could in theory be the same as |
This is correct. Map is implemented with Vec so the two cost types could merge. There is a slight difference though. |
Good to know, thanks! Then we can close this issue.
Yeah, I'm fine with that. However, the calibrated value difference is a bit concerning (especially given that we have |
I'll look into that as well as the difference in #1051 |
ContractCostType::MapEntry
represents a cost of accessing a single entry in the map, but is benchmarked usingget
function, that performs a binary search and then charges one moreMapEntry
access. Instead, benchmark should be usingget_at_index
which only charges a singleMapEntry
.This results in overcharging_, thus there are no security risks. However, maps are used a lot for contract types and it would be nice to be more precise about them.
The text was updated successfully, but these errors were encountered: