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

Switch to Scroll-owned Goldilocks repository #459

Merged
merged 21 commits into from
Nov 5, 2024
Merged

Conversation

matthiasgoergens
Copy link
Collaborator

@matthiasgoergens matthiasgoergens commented Oct 25, 2024

Also remove manual Ord implementation for Expression and use a derived implementation that does the same as the manual one used to do.

@matthiasgoergens matthiasgoergens marked this pull request as draft October 25, 2024 05:17
@matthiasgoergens matthiasgoergens marked this pull request as ready for review October 25, 2024 05:29
@matthiasgoergens matthiasgoergens changed the title Remove manual Ord implementation for Expression Use Scroll-owned Goldilocks repository Oct 28, 2024
@matthiasgoergens matthiasgoergens changed the title Use Scroll-owned Goldilocks repository Switch to Scroll-owned Goldilocks repository Oct 28, 2024
@matthiasgoergens matthiasgoergens requested review from darth-cy and yczhangsjtu and removed request for iammadab November 5, 2024 04:37
@yczhangsjtu
Copy link
Collaborator

For the Ord, I don't know why is there a custom implementation in the first place? Was there any special considerations?

@matthiasgoergens
Copy link
Collaborator Author

matthiasgoergens commented Nov 5, 2024

For the Ord, I don't know why is there a custom implementation in the first place? Was there any special considerations?

I only added 'derive Ord' to the upstream repo (which is now scroll owned) recently.

In general, we should do more upstream fixes, instead of just working around them.

@matthiasgoergens
Copy link
Collaborator Author

@yczhangsjtu Please tell me, if there's anything left you want me to do before you can approve? (Or let me know, if you just feel uncomfortable with the responsibility.)

@yczhangsjtu
Copy link
Collaborator

yczhangsjtu commented Nov 5, 2024

@yczhangsjtu Please tell me, if there's anything left you want me to do before you can approve? (Or let me know, if you just feel uncomfortable with the responsibility.)

I do feel uneasy since the default implementation may introduce a different order on the types from here, and I don't know if that might break something. But I figure it should be okay if the tests pass.

@yczhangsjtu
Copy link
Collaborator

For the Ord, I don't know why is there a custom implementation in the first place? Was there any special considerations?

I only added 'derive Ord' to the upstream repo (which is now scroll owned) recently.

In general, we should do more upstream fixes, instead of just working around them.

So the reason for this custom implementation was that Goldilocks didn't implement Ord, right?

@matthiasgoergens
Copy link
Collaborator Author

matthiasgoergens commented Nov 5, 2024

So the reason for this custom implementation was that Goldilocks didn't implement Ord, right?

Well, that's my best guess from reading the code and digging through the git history. There was lots of other weirdness that I can't explain, though. For example, why all the tedious cases analysis, instead of then or then_with.

@matthiasgoergens
Copy link
Collaborator Author

I do feel uneasy since the default implementation may introduce a different order on the types from here, and I don't know if that might break something. But I figure it should be okay if the tests pass.

That's a fair point to make. Do you want me to investigate, or are you happy with the existing tests?

Copy link
Collaborator

@naure naure left a comment

Choose a reason for hiding this comment

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

Are there any other differences besides Ord?

@@ -22,7 +22,7 @@ use crate::{
structs::{ChallengeId, RAMType, WitnessId},
};

#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

@matthiasgoergens
Copy link
Collaborator Author

Are there any other differences besides Ord?

Not really.

@matthiasgoergens matthiasgoergens merged commit f36a5b1 into master Nov 5, 2024
6 checks passed
@matthiasgoergens matthiasgoergens deleted the matthias/plane branch November 5, 2024 07:43
@naure
Copy link
Collaborator

naure commented Nov 5, 2024

That weird custom Ord is used to deduplicate commutative operations (b*a == a*b).

It can be replaced with the default order now.

@matthiasgoergens
Copy link
Collaborator Author

That weird custom Ord is used to deduplicate commutative operations (b*a == a*b).

It can be replaced with the default order now.

I understand that one. I was more confused by the custom reimplementation of 'then'.

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