Commit Graph

14295 Commits

Author SHA1 Message Date
tequ
d40f05015a fee test for V2 2026-09-08 14:55:58 +09:00
tequ
2166530a62 fix guard-checker build 2026-09-07 20:38:47 +09:00
tequ
0507a9932f Merge branch 'HookFeeV2' into HookFeeV3 2026-09-07 20:34:59 +09:00
tequ
1d5cdfbb43 clang-format 2026-09-07 20:33:44 +09:00
tequ
d04fa60d87 HookFeeV3: gate per-API costs and HookGasPrice behind a HookFeeV3 amendment
HookFeeV2 keeps the flat model (100 units per API call, 10 units per drop,
rounded up). HookFeeV3 layers on top of it:

- features.macro: add HookFeeV3 (Supported::yes, DefaultNo)
- getImportWhitelist: every API defaults to hook_api::api_call_cost;
  HOOK_API_COST overrides only when HookFeeV3 is enabled, and uses find()
  so a cost line can never whitelist an API whose definition is gated off
- hookCostToFee: flat V2 pricing unless HookFeeV3 is enabled, then the
  ledger's HookGasPrice applies
- sfHookGasPrice on FeeSettings / SetFee / validations, fee voting,
  genesis FeeSettings and server_info / ledger stream output are gated
  on HookFeeV3 instead of HookFeeV2
- tests that only avoid the amendment because genesis FeeSettings changes
  now subtract HookFeeV3; SetHook cost expectations remain the V3 values
2026-09-07 20:23:14 +09:00
tequ
cacdc5b1cd HookFeeV3: per-API cost table and votable HookGasPrice
Builds on the flat HookFeeV2 model:

- hook_api.macro: HOOK_API_COST(name, cost, amendment) per API, loaded
  into the import whitelist and charged per import call in Guard.h
- sfHookGasPrice on FeeSettings / SetFee / validations, voted through
  FeeVote and exposed in server_info, ledger streams and validations
- hook_gas_price config knob (FeeSetup) and genesis FeeSettings value
- hookCostToFee(view, cost) prices cost units with the ledger's gas price
- jtx Env applies features before the app is built so genesis FeeSettings
  see them; hash-order dependent tests updated accordingly
2026-09-07 19:16:19 +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
0a4631ada2 fix tests 2026-09-07 16:44:21 +09:00
tequ
5e2f7a07e8 remove unnesessary line changes 2026-09-07 16:14:02 +09:00
tequ
c152f71cce Set sfHookGasPrice at genesis instead of waiting for FeeVoting in tests 2026-09-07 16:06:53 +09:00
tequ
0ebdd68807 Merge remote-tracking branch 'upstream/dev' into HookFeeV2 2026-09-07 15:06:26 +09:00
tequ
69e3c361d0 Update cost 2026-09-07 14:45:19 +09:00
Richard Holland
6191c1e09d Onchain manifests (#779) 2026-09-07 13:19:25 +10:00
tequ
0a13e3b5c4 Merge branch 'dev' into HookFeeV2 2026-09-06 01:48:49 +09:00
tequ
f1a3a775a1 Add optional Hooks data to account_info response (#789) 2026-09-02 17:22:53 +10:00
tequ
c1dabe5576 Fix comments (#768) 2026-09-01 14:18:28 +10:00
Niq Dudfield
c6d5b345eb fix: subscription webhook delivery stalling on HTTP errors (#677) 2026-08-27 12:13:21 +10:00
tequ
c484619967 Add HookDefinitionUpdate tests (partially) 2026-08-13 03:30:32 +09:00
tequ
3b51e2b68e Merge branch 'dev' into HookFeeV2 2026-08-13 01:50:09 +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
Richard Holland
bb244ef772 put release builds into a candidate folder to prevent auto-update scripts running before smoke tests (#761) 2026.6.21-release+3350 2026-06-21 12:12:43 +10:00
Richard Holland
639ea34377 Fixhookmap (#756) 2026-06-16 17:06:25 +10:00
tequ
089c0dc3fe Fix ammLPHolds logic to include escrowed cases (#757) 2026-06-16 15:26:29 +10:00
tequ
78167e09c0 change sfHookOn of ltHookDefinition to soeOptional for HookOnV2 (#755) 2026-06-16 13:58:53 +10:00
tequ
607a7fdf98 Change AMM to Supported::no (#758) 2026-06-16 13:56:58 +10:00
tequ
4599fedd40 fix 2026-06-10 14:04:31 +09:00
tequ
bbbce7337f fix oracle TSH test 2026-06-09 22:49:10 +09:00
tequ
68fc622e26 fix oracle TSH test 2026-06-09 16:50:01 +09:00
tequ
93c135aabc Custom Hook API Cost 2026-06-09 16:12:47 +09:00
tequ
acc639acb0 fix tests 2026-06-09 15:00:00 +09:00
tequ
22620bb585 add incLgrSeqForGasPriceEnabled 2026-06-09 14:04:29 +09:00
tequ
978e50b575 fix conflict 2026-06-09 13:17:01 +09:00
tequ
1b75b9f72f Merge branch 'dev' into HookFeeV2 2026-06-09 13:07:02 +09:00
tequ
c55420bcd8 Fix duplicate and incorrect fields in server_definitions (#753) 2026-05-27 07:58:13 +10:00
tequ
cb91b4e88e Restore pre-reserved tem codes (#754) 2026-05-27 07:57:55 +10:00
tequ
90333b6fd0 Fix HookAPI Expected and Refactor Enum classes (#729) 2026-05-26 11:02:17 +10:00
tequ
7f9a9364b0 fix: Ensures canonical order for PriceDataSeries upon PriceOracle creation (#5485) (#744) 2026-05-25 11:34:24 +10:00
tequ
706d31f01d Update .git-blame-ignore-revs (#746) 2026-05-25 11:28:56 +10:00
tequ
083e9e4315 Generate hook extern declarations with C linkage (#750) 2026-05-25 11:27:21 +10: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
663ed4edb8 Named Hook (#718) 2026-05-19 12:00:25 +10:00
tequ
8422758d4d chore: Improve codecov coverage reporting (#4977) (#745) 2026-05-18 12:21:47 +10:00
tequ
586c78e812 fix: Replace badCurrency() checks with isBadCurrency() for improved clarity (#742) 2026-05-18 11:57:25 +10:00
Niq Dudfield
9b50b68d39 perf(ledger): optimize catalogue loading memory usage and performance (#548) 2026-05-06 17:29:44 +10:00
tequ
5e8d26f67a refactor: Calculate numFeatures automatically (#5324) (#739)
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-04-30 18:17:50 +10:00
tequ
a6186d7855 IOURewardClaim (#500) 2026-04-30 15:27:51 +10:00
tequ
b449599408 Add --definitions CLI flag to output static server definitions without starting server (#708) 2026-04-30 12:42:42 +10:00
tequ
9d4e507675 Treat suspicious gcov hit counts as coverage warnings (#737) 2026-04-29 17:06:44 +10:00
tequ
49fd0c33b5 fixIOULockedBalanceInvariant Amendment (#732) 2026-04-29 17:05:18 +10:00