Skip to content
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

Remove bad LEs #1114

Merged
merged 5 commits into from
Oct 16, 2023
Merged

Remove bad LEs #1114

merged 5 commits into from
Oct 16, 2023

Conversation

graydon
Copy link
Contributor

@graydon graydon commented Oct 14, 2023

This comes out of some review on compare.rs: we were supporting a lot of LE types in the code that are not ever supposed to occur. It's better to treat the presence of those cases as internal errors than have dead code "supporting" them possibly incorrectly.

Also eliminates comparison of LEs altogether. They were only being compared because of older constraints on MeteredOrdMap wanting its value type to be comparable. That's not necessary for LEs (in the Storage map), only Vals (in HostMaps) in order to have Map be ordered itself (because Val must be ordered). Turns out we'd already relaxed the requirement on MeteredOrdMap's value type to not have to be comparable. So all the LE-ordering code was dead anyway, which is good because they were all being treated as calls to Ord on fixed size types, but they weren't all fixed size types.

Also fixed a missing case in metered_clone, where we weren't charging for substructure of AccountEntries.

I'm not sure this is all that needs to be done for these files. I'm just out of time for tonight. Will continue reviewing on monday but figured I should get this started now.

soroban-env-host/src/storage.rs Outdated Show resolved Hide resolved
@graydon graydon added this pull request to the merge queue Oct 16, 2023
Merged via the queue into main with commit 3d66fde Oct 16, 2023
9 checks passed
@graydon graydon deleted the graydon-code-review-9 branch October 16, 2023 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants