Skip to content
This repository has been archived by the owner. It is now read-only.

Replace generic array with vec #6

Merged
merged 1 commit into from
Nov 9, 2020
Merged

Replace generic array with vec #6

merged 1 commit into from
Nov 9, 2020

Conversation

rishflab
Copy link
Member

@rishflab rishflab commented Nov 6, 2020

This speeds up the painfully slow compilation of the swap crate in
xmr-btc-swap.

Attempt to fix comit-network/xmr-btc-swap#31

Copy link
Member

@bonomat bonomat left a comment

Choose a reason for hiding this comment

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

🎊

Copy link

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

I assume @luckysori wanted to get the typesystem to verify certain properties by using GenericArray instead of Vec? Have you thought about how this is affected once GenericArray is no longer used?

I assume the refactoring towards Vec will require quite a bit more changes then just replacing GenericArray with Vec, starting with Vec taking only a single type parameter :D

Edit: I see @luckysori is actually part of the commit, should be fine then :)

@luckysori
Copy link
Collaborator

Edit: I see @luckysori is actually part of the commit, should be fine then :)

Hehe, I just rebased onto master now that I added CI and force pushed so that this cannot be merged by mistake.

But yeah, type safety was the main reason behind using GenericArray. We were trying to verify if giving up the type safety would resolve our slow compilation in xmr-btc-swap, but we have to make it compile first 😛. In any case, I recommend replacing this library with secp256kfun/sigma_fun as soon as LLFourn/secp256kfun#29 is merged.

@bonomat
Copy link
Member

bonomat commented Nov 8, 2020

Edit: I see @luckysori is actually part of the commit, should be fine then :)

Hehe, I just rebased onto master now that I added CI and force pushed so that this cannot be merged by mistake.

But yeah, type safety was the main reason behind using GenericArray. We were trying to verify if giving up the type safety would resolve our slow compilation in xmr-btc-swap, but we have to make it compile first 😛. In any case, I recommend replacing this library with secp256kfun/sigma_fun as soon as LLFourn/secp256kfun#29 is merged.

This PR makes use of GenericArrays as well unfortunately.

CC @LLFourn

@luckysori luckysori force-pushed the fix-slow-compile branch 2 times, most recently from c3bbeb0 to 19db237 Compare November 8, 2020 23:46
Losing type safety in the process. Instead we check that all the
vectors in the proof have the right number of elements when verifying.
@luckysori luckysori merged commit a196087 into master Nov 9, 2020
@luckysori luckysori deleted the fix-slow-compile branch November 9, 2020 00:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swap crate compiles very slowly
4 participants