fix(ml-dsa): correct gas-key fee and meta-tx verify-compute charging#16064
fix(ml-dsa): correct gas-key fee and meta-tx verify-compute charging#16064Wiezzel wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #16064 +/- ##
==========================================
+ Coverage 73.31% 73.32% +0.01%
==========================================
Files 857 857
Lines 189233 189318 +85
Branches 189233 189318 +85
==========================================
+ Hits 138731 138823 +92
+ Misses 46068 46066 -2
+ Partials 4434 4429 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9519759 to
a8b5dba
Compare
Pull request overviewFixes a total-supply leak in the gas-key host functions for ML-DSA-65 keys. The VM host path priced the Changes:
Reviewed changesPer-file summary
FindingsNo blocking issues found. The fix is correct, cleanly gated, and consistent across both VM runners and the runtime send-fee path. Verified:
Non-blocking (nits, follow-ups, suggestions):
✅ Approved |
879eb41 to
f4791d4
Compare
f4791d4 to
3e01fba
Compare
…er shard The inner DelegateAction signature verification cost was charged (gas and compute) at tx conversion on the signer/relayer shard, but the actual verify runs at execution in apply_delegate_action on the receiver shard. For ML-DSA-65 inner signers (0.1 Tgas compute) this let the verify work escape the receiver shard's compute_limit: naming delegate-senders onto a target shard and relayers elsewhere concentrates un-budgeted verify compute on that shard. Meter the inner-delegate verify compute on the receiver shard instead: charge only its gas at conversion and add its compute to result.compute_usage in apply_delegate_action. Gas and balances are unchanged. This is the same class of ML-DSA-65 cost mislocation as the gas-key fee fix, so gate it behind the same protocol feature, renamed FixGasKeyFeeCharging -> FixMlDsaCostCharging to cover both.
3e01fba to
dedccc0
Compare
This PR fixes two separate but related issues in how ML-DSA-65 (post-quantum) key costs are charged. Both are harmless for the classical ed25519/secp256k1 schemes (where the relevant quantities coincide), and both are gated behind the same new
FixMlDsaCostChargingprotocol feature.trie_id_len()and the send (transmission) fee on the wire length, applied consistently on both the transaction path (config.rs) and the runtime host-function path (both VM runners).DelegateActionsignature-verification compute was charged at transaction conversion on the signer/relayer shard, but the real verification runs at execution inapply_delegate_actionon the receiver shard. For ML-DSA-65 (0.1 Tgas) this let the verification work escape the receiver shard'scompute_limit. The fix charges only the gas at conversion (the signer still pays economically) and meters the verification compute on the receiver shard that actually performs it.Both changes alter deterministic gas/compute accounting, so they are protocol-version-gated. Regression tests are added for each.