Summary
Spending a compiled contract requires committing a computeBudget on the
input. The artifact JSON contains no estimate of what a contract's entry
will cost, and I could not find a documented way to obtain one, so the
working procedure on TN10 is: submit, read the rejection, commit the printed
number.
Environment: silverscript v1-rc1 (c7d17a1) · rustc/cargo 1.98.0 · TN10
node kaspad v2.0.1 · macOS (Apple Silicon).
Current behavior
Measured example (contract: one r0.succinct.verify call with a
222,668-byte seal, plus output-value and output-script introspection):
- Commit 2,501 → rejected:
script units exceeded the amount committed in the input: used=25446424, limit=25019999
- Commit 2,543 → rejected:
used=25446424, limit=25439999
- Commit 2,544 → accepted (TN10 txid
3b32c7bdcf22776c78bae81e4fd40fcfedeab994b94800997c60ddffc2cfde50, and
boundary-tested again at
e409473c97d470d0b87ac909cb24e923bad707f3d704127a89d6fca2301764a3).
Two measurements that may help scope a fix:
used was identical (25,446,424) across two different receipts of the
same byte-length through the same script — the meter appears
payload-invariant, so a static per-entry estimate looks feasible.
- The compiler already does conservative per-entry sizing for the
signature-script-limit check
(compiler_rejects_entry_abis_that_cannot_fit_the_unlocking_stack), so
machinery for per-entry static analysis exists.
Expected behavior
An estimated (or upper-bound) script-unit cost per entry in the artifact
JSON, or a silverc flag that prints one.
Impact
Tooling ergonomics. Trial-by-rejection works on a testnet; it is a poor fit
for anything unattended.
Acceptance criteria
- A per-entry cost estimate is obtainable from the artifact or the CLI
without submitting a transaction.
Summary
Spending a compiled contract requires committing a
computeBudgeton theinput. The artifact JSON contains no estimate of what a contract's entry
will cost, and I could not find a documented way to obtain one, so the
working procedure on TN10 is: submit, read the rejection, commit the printed
number.
Environment: silverscript
v1-rc1(c7d17a1) · rustc/cargo 1.98.0 · TN10node kaspad v2.0.1 · macOS (Apple Silicon).
Current behavior
Measured example (contract: one
r0.succinct.verifycall with a222,668-byte seal, plus output-value and output-script introspection):
script units exceeded the amount committed in the input: used=25446424, limit=25019999used=25446424, limit=254399993b32c7bdcf22776c78bae81e4fd40fcfedeab994b94800997c60ddffc2cfde50, andboundary-tested again at
e409473c97d470d0b87ac909cb24e923bad707f3d704127a89d6fca2301764a3).Two measurements that may help scope a fix:
usedwas identical (25,446,424) across two different receipts of thesame byte-length through the same script — the meter appears
payload-invariant, so a static per-entry estimate looks feasible.
signature-script-limit check
(
compiler_rejects_entry_abis_that_cannot_fit_the_unlocking_stack), somachinery for per-entry static analysis exists.
Expected behavior
An estimated (or upper-bound) script-unit cost per entry in the artifact
JSON, or a silverc flag that prints one.
Impact
Tooling ergonomics. Trial-by-rejection works on a testnet; it is a poor fit
for anything unattended.
Acceptance criteria
without submitting a transaction.