Commit Graph

9 Commits

Author SHA1 Message Date
tequ
8b7bdd6303 Change log message output to distinguish between hook and cbak costs 2026-09-08 22:02:16 +09:00
tequ
e93c46b3f5 fix guard-checker log 2026-09-08 21:16:40 +09:00
tequ
27592e7fec HookFeeV2: flat cost model (0.1 drop per instruction, 10 drops per API call)
Per-API cost tables and the votable HookGasPrice move to the HookFeeV3
branch. V2 charges one cost unit per wasm instruction and 100 units per
hook API call (including _g), with ten units per drop rounded up.

- Guard.h: drop the per-import cost map, charge a fixed api_call_cost on
  every import call
- Remove sfHookGasPrice, FeeSettings/SetFee/validation fields, fee voting,
  server_info output and the hook_gas_price config knob
- hookCostToFee no longer depends on the ledger view
- Restore genesis ledger, jtx Env and fragile-hash tests to dev
- Update expected hook costs in SetHook_test
2026-09-07 18:24:30 +09:00
tequ
a238935038 Fix hook api cost accounting in the guard checker
Api costs were looked up as import_type_map[callee_idx], but that map is
keyed by wasm type index while callee_idx is a function index. A hook was
charged whichever api happened to occupy the callee's index, or nothing at
all when no type carried that index, and imports sharing a signature
collapsed to a single cost. Reordering imports was enough to call
util_verify, the most expensive api, for free. Costs now come from
import_cost_map, keyed by import function index, and import_type_map is
reduced to the signature checking it is actually used for.

compute_wce() applied the loop multiplier to instruction_count only, so an
api call inside a guarded loop was charged for one iteration no matter how
many the guard allowed. The multiplier now applies to execution_cost as
well, with the same floor instruction_count uses.
2026-08-05 15:00:16 +09:00
tequ
4599fedd40 fix 2026-06-10 14:04:31 +09:00
tequ
1b75b9f72f Merge branch 'dev' into HookFeeV2 2026-06-09 13:07:02 +09:00
tequ
b9e0c56def Guard depth 32 (#653) 2026-05-25 11:10:49 +10:00
tequ
3a2cc49106 Merge branch 'dev' into HookFeeV2 2026-05-21 20:56:35 +09:00
tequ
e95edcba48 fix for xahaud codebase 2026-02-20 07:11:14 +09:00