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

Make compact values more compact #2083

Merged
merged 1 commit into from
Jan 19, 2021
Merged

Make compact values more compact #2083

merged 1 commit into from
Jan 19, 2021

Conversation

redxaxder
Copy link
Contributor

No description provided.

@redxaxder redxaxder changed the title wip Make compact values more compact Jan 6, 2021
@redxaxder redxaxder force-pushed the redxaxder/compact2 branch 4 times, most recently from f96ac50 to 4360965 Compare January 7, 2021 17:40
@redxaxder redxaxder marked this pull request as ready for review January 7, 2021 18:49
@redxaxder redxaxder requested a review from dcoutts January 7, 2021 18:51
Copy link
Contributor

@kevinhammond kevinhammond left a comment

Choose a reason for hiding this comment

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

My understanding is that the main change here is

  • to the representation of CompactValue to give a short form for Ada-only tokens
  • to map token quantities etc to different memory regions (to give a more efficient storage and access pattern)

The implications in terms of memory usage are quite subtle (and maybe architecture dependent?). I would suggest making this explicit in a comment at the start of the file, so that it could be changed in future if required (otherwise, this could take some time to unpick and redo!). I would also include some pointers to any relevant benchmarking.

It presumably also affects the minutxo calculation, so there should be a reference to this from within the file?

Copy link
Contributor

@nc6 nc6 left a comment

Choose a reason for hiding this comment

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

Looks good modulo checking that the tests cover situations where we have:

  • Duplicate Asset names
  • Duplicate policy IDs

-- These represent the index, pid offset, asset name offset, and quantity.
-- If any of the quantities out of bounds, this will produce Nothing.
-- The triples are ordered so that a component with an asset name appearing
-- earlier in the asset name section is first.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this ordering stable? What happens with multiple null asset names, which will share the offset? Can this result in different representations, and do we care?

shelley-ma/impl/src/Cardano/Ledger/Mary/Value.hs Outdated Show resolved Hide resolved
shelley-ma/impl/src/Cardano/Ledger/Mary/Value.hs Outdated Show resolved Hide resolved
@JaredCorduan JaredCorduan merged commit ca7227f into master Jan 19, 2021
@iohk-bors iohk-bors bot deleted the redxaxder/compact2 branch January 19, 2021 19:34
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.

5 participants