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

chore[ux]: compute natspec as part of standard pipeline #3946

Merged

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Apr 14, 2024

Commit message

prior to this commit, natspec had to be explicitly requested by the user
(`-f userdoc`, `-f devdoc` or `-f combined_json`). this would lead to
discrepancies between development time and verification time, where a
contract could compile locally (because no natspec was requested), but
not on the verifier's pipeline (because the verifier would request the
natspec via one of the above methods). this commit computes the natspec
as part of the dependencies of the analysed AST (the reasoning being
that, a consumer might expect semantic analysis to include natspec
validation). so, there is no way to produce bytecode for a contract
without validating natspec.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

prior to this commit, natspec had to be explicitly requested by the user
(`-f userdoc`, `-f devdoc` or `-f combined_json`). this would lead to
discrepancies between development time and verification time, where a
contract could compile locally (because no natspec was requested), but
not on the verifier's pipeline (because the verifier would request the
natspec via one of the above methods). this commit computes the natspec
as part of the dependencies of IR generation, so there is no way to
produce bytecode for a contract without validating natspec.
@codecov-commenter
Copy link

codecov-commenter commented Apr 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.85%. Comparing base (6f09e29) to head (eafb3a0).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3946   +/-   ##
=======================================
  Coverage   90.84%   90.85%           
=======================================
  Files          95       95           
  Lines       14436    14449   +13     
  Branches     3201     3204    +3     
=======================================
+ Hits        13114    13127   +13     
  Misses        914      914           
  Partials      408      408           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

presumably, a consumer requesting annotated ast would want natspec as
well
@charles-cooper charles-cooper merged commit 074073f into vyperlang:master Apr 14, 2024
149 checks passed
@charles-cooper charles-cooper deleted the chore/ux/compile-natspec branch April 14, 2024 17:00
pcaversaccio added a commit to pcaversaccio/snekmate that referenced this pull request Apr 15, 2024
…devdoc` Sanity Check (#235)

### 🕓 Changelog

This PR refactors the existing module-friendly contracts to use the new
dunder method `__interface__` (see
vyperlang/vyper#3919), which allows you to
export all functions of a module without specifying the individual
functions.

We apply the following rules:

- Library modules keep the individual list `exports` syntax due to
explicitness (application developers can thus identify faster what is
exported within a library module),
- Mocks might use it if more than one `external` function is exported.
We do not use it in mock contracts if critical code comments for
exported functions would be lost.

Furthermore, we remove the `userdoc` and `devdoc` compilation script &
CI pipeline since it's now computed as part of the standard compilation
pipeline (vyperlang/vyper#3946).

---------

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Co-authored-by: sudo rm -rf --no-preserve-root / <pcaversaccio@users.noreply.github.com>
Co-authored-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
electriclilies pushed a commit to electriclilies/vyper that referenced this pull request Apr 27, 2024
prior to this commit, natspec had to be explicitly requested by the user
(`-f userdoc`, `-f devdoc` or `-f combined_json`). this would lead to
discrepancies between development time and verification time, where a
contract could compile locally (because no natspec was requested), but
not on the verifier's pipeline (because the verifier would request the
natspec via one of the above methods). this commit computes the natspec
as part of the dependencies of the analysed AST (the reasoning being
that, a consumer might expect semantic analysis to include natspec
validation). so, there is no way to produce bytecode for a contract
without validating natspec.
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.

None yet

3 participants