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

Function data hash could just pack the inputs into a field #3057

Open
Tracked by #7167
sirasistant opened this issue Oct 26, 2023 · 1 comment
Open
Tracked by #7167

Function data hash could just pack the inputs into a field #3057

sirasistant opened this issue Oct 26, 2023 · 1 comment
Labels
C-protocol-circuits Component: Protocol circuits (kernel & rollup) T-optimisation Type: Optimisation. Making something faster / cheaper / smaller

Comments

@sirasistant
Copy link
Contributor

struct FunctionData {
    // First four bytes of the abi encoding 
    // of a function. 
    selector : FunctionSelector,
    is_internal : bool,
    is_private : bool,
    is_constructor : bool,
}

This fits into a single field. We could just not hash and implement a pack method, and use it instead.

@sirasistant sirasistant added C-protocol-circuits Component: Protocol circuits (kernel & rollup) T-optimisation Type: Optimisation. Making something faster / cheaper / smaller labels Oct 26, 2023
@iAmMichaelConnor
Copy link
Contributor

I guess it depends which is more efficient (across both the kernel and aztec.nr), constraint-wise: packing vs hashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-protocol-circuits Component: Protocol circuits (kernel & rollup) T-optimisation Type: Optimisation. Making something faster / cheaper / smaller
Projects
Status: Todo
Development

No branches or pull requests

2 participants