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

chore(stdlib)!: Change stdlib methods to accept slices #2050

Closed
wants to merge 7 commits into from

Conversation

vezenovm
Copy link
Contributor

Description

Problem*

Resolves #1842

Summary*

Move from generic arrays syntax on methods to slices in the SSA

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@vezenovm vezenovm requested review from jfecher and TomAFrench and removed request for jfecher July 26, 2023 12:56
@kevaundray kevaundray requested review from jfecher and removed request for TomAFrench July 26, 2023 12:58
@TomAFrench
Copy link
Member

Yeah Jake's probably the best to review this sensibly.

Base automatically changed from remove-legacy-ssa to master July 26, 2023 13:14
@vezenovm
Copy link
Contributor Author

Changing the Poseidon generics was leading to some issues during branch analysis. For now this PR just updates the hash functions to accept slices

Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

I'm not sure about this change. It seems to be putting a band-aid over the real problem of to_le_bytes and friends lying about their type signature. This may fix the linked bug but there are also several other bugs that are a result of the same issue in to_le_bytes.

I think to properly fix it we need to fix to_le_bytes to return an array of some maximum length, with any extra space filled up with zeroes. If we want to be wary of the Field size changing we can add an assert that the field size is smaller than whatever can fit in the maximum length we decide upon. We should just document that it will fail if the field size and value are too large.

@vezenovm
Copy link
Contributor Author

Closing in favor of #2070

@vezenovm vezenovm closed this Jul 31, 2023
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.

Compiler error hashing a field
3 participants