Replies: 1 comment 2 replies
-
Thanks paul, let me just lay it out here. Versioning, Natspec, and Documentation all in one: DappSpecDappspec deals with the lifecycle of a contract deployment, namely release management and distribution for consumption. The motivating factor really is for being able to reliably assert which version of a protocol we are dealing with. Protocols are rarely released simultaneously on all chains, ergo there are differences in their deployments and interfaces. This causes issues when trying to automate/integrate cross-chain. Dappspec aims to help enable trustless exchange of protocol interfaces and relevant information for intergrations. Versioning (foundry-tags)
There are two orthogonal problems when importing an external dependency (generally): Availability: Will A be available at the host site? Versioning in this regard is referred to as Accretive Versioning1 Accretive versioning is based on matching type signatures against a generated ABI V2. Imagine a package manager that ran the test suite of the version you're currently using against the code of the version you'd like to upgrade to, and told you exactly what wasn't going to work. This is a lofty goal, and for the purposes of this discussion worthwhile to mention but beyond the scope of this spec (and intro). Basically, take the compiler's ABI-generated artifact, and generate a solidity interface from that ABI, that is your 'version'. Mark functions depreciated minor increments or patch. Those specifics I have not narrowed down yet, but I think the idea of automated versioning via diffing generated interfaces warrants further investigation as it's simple, robust (at least for our purposes, YMMV when traveling into other ecosystems), and best of all, automated. The issues with Semver et al are all due to the human inference into the process of creating a versioned release, which is why you see such applications such as changesets / semantic versioning CI pipelines that try to automate this away from developers' interjections. Additionally, with well-versioned artifacts, things like scoping become easier to do. Note that I mention this here only to provide additional context as to how an implementation may look like for persisting that sort of versioning information (hint: it is not going to be in your TOML file). Forge TagsOriginally the issue I was wanting to resolve was not using git submodules. There is a GitHub action at the repo that handles git tagging with these semantics (not this is not per see Accretive Versioning!) Forge Tagging Releases GitHub ActionBy default, if you do not pass a
The Accretive versioning spec is not formalized yet, so would like to hear any feedback at all. Dappspec: @custom/natspec:Dappspec takes the The Specifics Admonitions include identifiers for code blocks that reference gas optimizations, assembly blocks and emit events. The @Custom: security tag is used by OpenZeppelin for identifying the point of contact. Similar to security.txt, see an example here The General Admonitions are meant to render the docstring content as a code block that you would find in generators like mkdocs. see squidfunk.github.io/mkdocs-material/reference/admonitions/#supported-types The style of how to do
Documentation:Autogenerated and opinionated: this is from the 'literate programming' movement, originally sourced from 'groc', see more here https://github.com/nevir/groc/blob/master/README.md Basically, This all builds on each other: Versioned well documented and oriented towards lowering friction both on the developer side and consumer side. Here is an example of the generated documentation for the new OpenMev Router for Sushiswap A go binary generates the docs. It uses pygementize under the hood to provide for highlighting. No need to involve Here is a selected portion of the generated docs: I think adding a 3rd slim column for margin notes would be interesting, potentially for specific natspec directives e,g, Thanks for posting this comment, it forced me to type all this together in a more cohesive fashion, let me know what you think, and much appreciate your work , enjoy your weekend, Thanks again, and sorry for the wall of text Footnotes |
Beta Was this translation helpful? Give feedback.
-
See @sambacha's project foundry-tags:
https://github.com/sambacha/foundry-tags
Beta Was this translation helpful? Give feedback.
All reactions