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: support native constants #502

Open
DavePearce opened this issue Jan 7, 2025 · 1 comment
Open

feat: support native constants #502

DavePearce opened this issue Jan 7, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@DavePearce
Copy link
Collaborator

DavePearce commented Jan 7, 2025

The goal here is to allow a constant to be defined without giving it an actual value. Notes:

  • (Constraints) This constant can then be compiled into generated constraint packs (i.e. bin files), with the actual value being provided as part of constraint expansion (e.g. via the CLI when running go-corset check, or directly via the expansion API from within the prover).
  • (Trace Generation) On the trace generation side, native constants would be compiled as static fields in the relevant Trace.java file (as opposed to final static fields). Potentially, they could be given a default value. Eitherway, they could then be assigned by the tracer before trace generation begins..

A plausible syntax would be :

(defconst GAS_LIMIT_MAXIMUM native)

or we have a special construct, such as:

(defnativeconst GAS_LIMIT_MAXIMUM)

(or perhaps defexternconst or just defextern or defnative).

@OlivierBBB FYI.

@DavePearce DavePearce added the enhancement New feature or request label Jan 7, 2025
@DavePearce
Copy link
Collaborator Author

NOTE: you'd probably need to include a type for a native constant as, otherwise, it wouldn't know what type to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant