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

Disable static analyzer by default #73

Open
cusma opened this issue Oct 18, 2024 · 6 comments
Open

Disable static analyzer by default #73

cusma opened this issue Oct 18, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@cusma
Copy link

cusma commented Oct 18, 2024

Problem

The .algokit/static_analysis/snapshot JSONs keep growing (quickly) with the # of pre-commit runs.

I've noticed it just when GB rejected a commit due to file oversize (118 MB 😱).

Solution

Make static analysis optional and disable them by default.

Dependencies

None.

@cusma cusma added the enhancement New feature or request label Oct 18, 2024
@aorumbayev
Copy link
Collaborator

aorumbayev commented Oct 18, 2024

@cusma can you provide an example or expand on what exactly is growing quickly?
It should match the # of artifacts in the artifacts folder. So if you add N contracts - upon running tealer it will save N snapshots - which are then used in ci to compare if the pushed contract has any new results from tealer output compared against snapshots.

I have just instantiated a template against latest python example, generated 100 hello world artifacts, and then run the analyze task which resulted in a snapshots folder of size only ~2mb. Which will remain static unless new contracts are added or new contract is added into the project.

Are you able to provide a small reproducible example if you are saying that multiple re runs of the tealer task against unchanged artifacts increases size of snapshots. Alternatively if you have a lot of contracts, it may also depend on the complexity of the contract itself, algokit-cli only forwards the inputs into tealer but if tealer produces an abnormally large snapshot file then might be an even better case for having a reproducible example so we can report on the tealer repository.

@cusma
Copy link
Author

cusma commented Oct 18, 2024

So, I can be wrong here. Not sure if I'm able to set up a reproducible example quickly, but... this is my condition: I have just 1 contract. The resulting .approval.json snapshot is 118 MB size. The smart contract is not so complex. So even if it's static I think 118 MB is pretty heavy, considered that AlgoKit project are usually committed to GH.

@aorumbayev
Copy link
Collaborator

@cusma this sounds like a bug on tealer side then, any chance this contract can be shared ? I can re test against tealer and open an issue on tealer repository with a reproducible snippet.

@aorumbayev
Copy link
Collaborator

@cusma just found this on tealer repo, looks like its the related root cause for why your approval snapshot is so large -> crytic/tealer#101

@aorumbayev
Copy link
Collaborator

@cusma above PR disables this as per this issue but will keep it open until there are fixes in tealer. At that point worth re enabling the behaviour as other than the existing bug, its a useful feature to have out of the box

@cusma
Copy link
Author

cusma commented Oct 18, 2024

@cusma just found this on tealer repo, looks like its the related root cause for why your approval snapshot is so large -> crytic/tealer#101

Yes, that my be the cause. My contract is not complex but involved quite heavy loops. Maybe TEALer files/paths proliferate with each loop execution.

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

2 participants