docs: clarify that gasLimits includes teardownGasLimits - #25220
Closed
vezenovm wants to merge 2 commits into
Closed
Conversation
vezenovm
marked this pull request as ready for review
August 13, 2026 19:49
nchamo
approved these changes
Aug 14, 2026
| ): { | ||
| /** | ||
| * Gas limit for the tx, excluding teardown gas | ||
| * Total gas limit for the tx, including teardown gas |
Contributor
There was a problem hiding this comment.
docs-developers/docs/aztec-js/aztec_js_reference.md:1909 still has the old "excluding teardown gas" sentence, so the generated reference now contradicts this comment on next. It's auto-generated, so it'd need a run of docs/scripts/aztecjs_reference_generation/update_docs.sh rather than a hand edit. Worth regenerating here? That block also still documents the old two-arg getGasLimits(simulationResult, pad), so it looks stale beyond just this line.
vezenovm
force-pushed
the
mv/f378-gas-limits-docs
branch
from
August 17, 2026 11:47
2285385 to
abde750
Compare
vezenovm
added a commit
that referenced
this pull request
Aug 18, 2026
The committed `aztec_js_reference.md` was last generated on 2025-12-10. Against today's aztec.js source it documents 125 symbols where the package exports 188: 19 documented symbols no longer exist (`AccountInterface`, `AccountWithSecretKey`, `DeploySentTx`, `broadcastPrivateFunction`, `getGasLimits`, ...) and 82 current exports are missing. The v5.1.0 snapshot that production serves carries the same December content, so this is what the live API reference shows today. The release refreshed the CLI references, the aztec-nr API and the TypeDoc TypeScript API in the same commit, but `aztecjs_reference_generation/update_docs.sh` is not part of the release checklist. This also resolves the contradiction @nchamo spotted in #25220, where the stale block still described the old two-argument form and said gas limits exclude teardown gas. ### Why the generator changed too A straight regeneration does not build, so two generator bugs are fixed first: - Multi-line types were emitted inside inline code spans. A type body containing a blank line closes the span early, and its braces and angle brackets then reach the MDX parser, failing the build with `Unexpected end of file in expression`. Multi-line types now use a fenced code block, matching what `format_return_type` already did. Verified this reproduces on `merge-train/fairies` itself with none of these commits applied. - The table of contents built anchors with its own slug logic that stripped underscores Docusaurus keeps, leaving `CAPABILITY_VERSION` and the `Contract / Protocol_Contracts` section unreachable and pointing `NO_WAIT`/`NO_FROM` at the `NoWait`/`NoFrom` headings. Anchors now derive from the rendered heading text the way github-slugger does. The aztec.js JSDoc edits are comment-only, and are needed because the regenerated page otherwise fails `yarn spellcheck` on a `metadata` typo and on `on-chain`, which is a `flagWords` entry in the root `cspell.json`.
Collaborator
|
This issue was automatically closed because it was referenced in PR #25248 which has been merged to the default branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves F-378.
teardownGasLimitsis a reservation carved out ofgasLimits, not an addition on top: the total a tx may consume isgasLimits, the fee limit isgasLimits × maxFeesPerGas, and a tx with a teardown call is billed the fullteardownGasLimitsregardless of actual teardown consumption (seegas_meter.nrand the tail output validators). Three places documented the opposite model or stayed silent:how_to_pay_fees.mddescribedgasLimitsas "main execution phase" only.Gas_Settings_Componentssnippet (rendered on the fees page) never said teardown is inside the total.getGasLimitsJSDoc said the returnedgasLimitsexcludes teardown gas, while the value is computed fromtotalGaswhich includes it.This fixes all three, adds per-field docs to the
GasSettingsconstructor (rendered on the fees page via thegas_settings_varssnippet), and documents the full-reservation billing behavior. Docs only, no behavior change. The unrelated hunks ingeneral_snippets.jsare prettier reformatting.