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

account abstraction using its own "custom" constants instead of using shared constants... #1779

Closed
rahul-kothari opened this issue Jun 21, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@rahul-kothari
Copy link

Problem

Consider abi.nr where we store MAX_ARGS. If I want to change this, I need to manually find all places where this is used and update there too since I can't read the MAX ARGS slot like in entrypoint.nr - notice how because we can't do math or refer other storage slots, we have to manually update the counts everywhere.

When updating MAX_ARGS, I actually didn't know where else it had to be updated (because relevant comments weren't there) so everything broke temporarily (ty @sirasistant for your help btw!)

Happy Case

Instead of

// MAX_ARGS * (ACCOUNT_MAX_PUBLIC_CALLS + ACCOUNT_MAX_PRIVATE_CALLS)
global ACCOUNT_FLATTENED_ARGS_SIZE: comptime Field = 32;

have:

global ACCOUNT_FLATTENED_ARGS_SIZE: comptime Field = abi::MAX_ARGS * (....)

this would also prevent the number of vars that need to be passed in!

Alternatives Considered

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@rahul-kothari rahul-kothari added the enhancement New feature or request label Jun 21, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jun 21, 2023
@rahul-kothari rahul-kothari changed the title Have storage slot assinged for fixed values account abstraction using its own "custom" constants instead of using shared constants... Jun 21, 2023
@jfecher
Copy link
Contributor

jfecher commented Jun 21, 2023

This looks like a potential duplicate of #1734. Can you confirm if allowing globals to reference other globals would solve your issue?

@rahul-kothari
Copy link
Author

yup is a duplicate my bad!

@rahul-kothari rahul-kothari closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jun 23, 2023
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
Archived in project
Development

No branches or pull requests

2 participants