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: drop unused public functions from contract artifact #11101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TomAFrench
Copy link
Member

I'm not sure if this is done later in the pipeline but there's no reason for aztec to track any functions other than public_dispatch so we can drop these to reduce the size of the artifact.

Copy link
Contributor

fcarreiro commented Jan 8, 2025

The AVM only handles the public_dispatch function exposed by Aztec contracts.
This is not strictly true, actually the AVM can execute any function but Aztec only deploys public_dispatch.

  1. This will break avm_simulator.test.ts. We test some functions directly there, since otherwise we need to emulate the AztecNr calling convention (via public dispatch) which is sth the AVM in principle doesn't need to know of.**

  2. My only concern with removing these is down to tooling/debugging. Are we sure the debugging info for these functions will never be needed? Also not by the PXE? I'm not sure to what extent the artifact information is used.

**however, we do test some functions via public_dispatch so this is negotiable.

@TomAFrench
Copy link
Member Author

TomAFrench commented Jan 8, 2025

This is not strictly true, actually the AVM can execute any function but Aztec only deploys public_dispatch.

This will break avm_simulator.test.ts. We test some functions directly there, since otherwise we need to emulate the AztecNr calling convention (via public dispatch) which is sth the AVM in principle doesn't need to know of.**

Perhaps we can move this to whichever service is storing all of the contract artifacts and serving them to users when requested? I'm not sure if this is done "intelligently" so that only the relevant functions are transmitted or whether users get the full json object thrown at them. I'm not sure who's responsible for building that service though.

My only concern with removing these is down to tooling/debugging. Are we sure the debugging info for these functions will never be needed? Also not by the PXE? I'm not sure to what extent the artifact information is used.

All the relevant debug information should be in the debug info attached to public_dispatch.

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