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

Use splitmap for utxo #2592

Merged
merged 1 commit into from Jan 7, 2022
Merged

Use splitmap for utxo #2592

merged 1 commit into from Jan 7, 2022

Conversation

lehins
Copy link
Contributor

@lehins lehins commented Dec 17, 2021

This PR switches UTxO to SplitMap, which is in itself is based on a nested data structure IntMap and custom KeyMap that is indexed by 32byte keys.

@lehins lehins force-pushed the lehins/use-splitmap-for-utxo branch from 1691f71 to 165a152 Compare December 20, 2021 21:27
Copy link
Contributor

@TimSheard TimSheard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every thing looks good. The set algebra function function (◁) where the value on the right is a SpitMap is use so many times. We should make a version ins SpitMap, and then use

(set Split.◁ splitmap) this maintains continuity with the spec and the older code.

@lehins lehins force-pushed the lehins/use-splitmap-for-utxo branch 2 times, most recently from 254688d to e75a132 Compare January 6, 2022 15:15
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think it would be nice to make the special case domain restriction function like @TimSheard suggests.

@lehins lehins force-pushed the lehins/use-splitmap-for-utxo branch 4 times, most recently from ca58dfd to 4b0f331 Compare January 7, 2022 10:41
* Add missing instances for `KeyMap` and `SplitMap`

* Add missing functions for `SplitMap`

* Remove all `SplitMap` related stuff from set algebra

* Add `NoThunks` instance

* Identify and fix one normalization bug in KeyMap and another in SplitMap:

* Add various annotations to tests for helping to identify causes of failure

* Fix `Show` instance for `SplitMap`

* Remove `InstanceSigs` in order to get rid of compilation warning

* Add `Traversable` for `SplitMap` and slight optimization for `UTxO` generator

* Implement specialized `extractKeysSet` and utilize it in the rules

* Add comments that match the spec to a now different looking implementation

* Switch `scriptsNeeded` to use list comprehensions for clarity

* Tap into list fusion for `SplitMap` list conversions

* Add `◁` for `SplitMap`

* Improve performance of `balance` function and add some benchmarks for it
@lehins lehins force-pushed the lehins/use-splitmap-for-utxo branch from 4b0f331 to a5eea8d Compare January 7, 2022 15:55
@lehins lehins merged commit 50e9e2b into master Jan 7, 2022
@iohk-bors iohk-bors bot deleted the lehins/use-splitmap-for-utxo branch January 7, 2022 23:05
@lehins lehins mentioned this pull request Feb 24, 2022
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.

None yet

3 participants