Declared condenser queries omit the legacy-style operation conversion the backend runs for condenser_api
Problem and intended result
The declared performance queries for condenser_api methods (performance.queries in .aidev/project.yaml) leave out the legacy-style operation conversion that the real backend runs for them. With _is_legacy_style true, which is every condenser_api call, the backend formats each operation body as:
hive.get_legacy_style_operation(hafd._operation_from_jsonb(<body>))::JSONBThe sites are:
backend/jsonrpc/methods/account_history.sql(ah_get_account_history)backend/jsonrpc/methods/ops_in_block.sqlbackend/jsonrpc/methods/transaction.sql
Every condenser declaration selects the non-legacy body instead: the inlined helper_operations_view expression jsonb_build_object('type', …, 'value', ho.body_value). So their plans and timings miss a per-row function call the real requests make.
Measured on the full-scale node, the conversion costs about 2.5 ms per 1000 operations. It is a real but small share of condenser account-history time, so this is a fidelity correction to the stand-ins and not, by itself, expected to fix the calibration misfit tracked in aidev#15973.
Intended result: each condenser declaration selects the operation body exactly as the backend formats it for condenser_api.
Required behavior
- In every declared query that stands in for a condenser_api method returning operation bodies, wrap the selected body in
hive.get_legacy_style_operation(hafd._operation_from_jsonb(<body>))::JSONB, as the backend does. That covers allcondenser-account-history*variants (plain, named, by-type, by-rare-type, type-count, and their-low/-highvariants),condenser-ops-in-blockandcondenser-transaction-by-hash. - JSON-RPC (
account_history_api.*) and REST declarations are unchanged. - Nothing else in the declarations changes: parameter maps, limits,
replay.expected, assertions. - hafah's real API, backend SQL and schema are not changed. This edits only the
performance:section.
Context and decisions
The operator gave a standing approval on 2026-10-14 for correcting declared performance queries to match the real API. This change uses that approval and is limited to it.
Acceptance criteria
- Each condenser declaration listed above selects the operation body through
hive.get_legacy_style_operation(hafd._operation_from_jsonb(…))::JSONB, matching the backend's legacy branch for that method. - No JSON-RPC or REST declaration changes, and no file outside
.aidev/project.yamlchanges. aidev db shape checkplans every changed declaration without error on the project's shape.
Verification
- Diff review of the performance section against the backend's legacy branches.
aidev db shape checkagainst the approved shape plans every declaration.
Integration points
.aidev/project.yaml:performance.queriescondenser declarations.
Scope boundary
- Calibration judging and diagnostics are aidev#15973.
- Re-pinning hafah's shape and publishing a calibration are ops steps.