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

[feat] Make the openvm::entry! macro a proc-macro attribute #1313

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

Golovanov399
Copy link
Contributor

This resolves INT-2784. Now, instead of openvm::entry!(main), we just write #[openvm::entry] before fn main.

This comment has been minimized.


/// Used for defining the guest's entrypoint and main function.
///
/// When `#![no_main]` is used, the programs entrypoint and main function is left undefined. The
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering, do you think it's safe to add the #![no_main] within the macro, where it figures out based on whether std is enabled etc? This has the benefit that on host we can make it always std and allows cargo clippy to work etc

Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

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

Rename suggestion, and wanted to ask/discuss if we can handle no_main within the macro for better UX. Otherwise LGTM

Copy link

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (+11 [+0.5%]) 2,186 513,827 18,710,764 - - -
fibonacci_program (-10 [-0.2%]) 5,302 1,500,095 51,485,080 - - -
regex_program (+65 [+0.4%]) 15,281 1,914,103 165,455,373 - - -
ecrecover_program (-70 [-2.7%]) 2,516 284,567 15,055,723 - - -

Commit: 521f8af

Benchmark Workflow

@Golovanov399 Golovanov399 merged commit b75dc85 into develop Jan 30, 2025
17 of 18 checks passed
@Golovanov399 Golovanov399 deleted the feat/entry-proc-macro-attr branch January 30, 2025 19:06
Avaneesh-axiom pushed a commit that referenced this pull request Feb 4, 2025
* Make the `openvm::entry!` macro a proc-macro attribute

* Rename `entry` -> `main`
Avaneesh-axiom pushed a commit that referenced this pull request Feb 5, 2025
* Make the `openvm::entry!` macro a proc-macro attribute

* Rename `entry` -> `main`
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.

2 participants