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

Remove builtin names from VirtualMachine.builtin_runners #921

Merged
merged 5 commits into from
Mar 27, 2023

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Mar 23, 2023

Motive: Simplify code & have a cleaner/simpler interface
Reasoning: builtin runners are now enums instead of trait objectst, so we can know exectly which builtin we are using without needing to see its name. Morover, builtins know their name, we can just call builtin.name() if we need it.
Possible consecuences: The method add_additional_hash_builtin used to store the new builtin under a different name ("hash_builtin" instead of "pedersen"), but this wont longer be needed after 0.11 changes
Other improvements: Simplified code catching NoBuiltinForLayout error
Performance: No difference

@fmoletta fmoletta marked this pull request as ready for review March 23, 2023 20:30
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Merging #921 (1babad2) into main (77fe09e) will increase coverage by 0.00%.
The diff coverage is 98.13%.

@@           Coverage Diff            @@
##             main     #921    +/-   ##
========================================
  Coverage   97.41%   97.41%            
========================================
  Files          70       70            
  Lines       29641    29528   -113     
========================================
- Hits        28876    28766   -110     
+ Misses        765      762     -3     
Impacted Files Coverage Δ
src/utils.rs 99.43% <ø> (ø)
src/vm/vm_core.rs 97.43% <96.87%> (+0.04%) ⬆️
src/vm/runners/cairo_runner.rs 97.77% <98.31%> (+0.05%) ⬆️
...hint_processor/builtin_hint_processor/signature.rs 100.00% <100.00%> (ø)
src/serde/deserialize_program.rs 97.58% <100.00%> (-0.28%) ⬇️
src/vm/security.rs 98.43% <100.00%> (ø)

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@Oppen Oppen left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

LGTM

@juanbono juanbono added this pull request to the merge queue Mar 27, 2023
Merged via the queue into main with commit cc55445 Mar 27, 2023
@juanbono juanbono deleted the remove-builtin-name branch March 27, 2023 13:25
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