Skip to content

Rename protocol fees to program fees, and "locks" test names to what they check - #171

Merged
mikemaccana merged 1 commit into
mainfrom
claude/program-fees-rename
Sep 30, 2026
Merged

mikemaccana merged 1 commit into
mainfrom
claude/program-fees-rename

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

Follows quicknode/solana-book#190, which removes "protocol" and vague "lock" wording from the book. The book can only name identifiers that exist here, so the rename lands here first.

Identifiers

Before After
Pool.protocol_fees (perpetual futures, all variants) program_fees
Reserve.accumulated_protocol_fees (lending) accumulated_program_fees
collect_protocol_fees / CollectProtocolFees / handle_collect_protocol_fees (lending) collect_program_fees / CollectProgramFees / handle_collect_program_fees
protocol_fees_accrue_and_owner_can_collect (lending tests) program_fees_accrue_and_owner_can_collect
proof_rounding_is_protocol_favourable (lending Kani) proof_rounding_is_program_favourable
place_bid_locks_quote_in_vault, place_ask_locks_base_in_vault (order book) place_bid_moves_quote_into_vault, place_ask_moves_base_into_vault
test_write_call_locks_the_underlying (options) test_write_call_moves_underlying_into_vault

Renaming the lending instruction changes its Anchor discriminator, and the account fields get new IDL names. The byte layouts are unchanged.

Prose

  • Comments and READMEs that called the program "the protocol" now say "the program". This covers its fees, rounding in its favour, and who keeps the dust.
  • "Source of truth" comments now say which field the program reads.
  • Left alone:
    • Comments about the Solana protocol lowering slot times.
    • CHANGELOG history entries.

Checks

  • cargo fmt --check is clean in every touched crate.
  • cargo check --tests passes in every touched anchor, anchor-v1, quasar and kani-proofs crate. The Anchor ones were checked against placeholder .so files because cargo-build-sbf isn't available locally, so CI runs the tests for real.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn


Generated by Claude Code

…y check

- `protocol_fees` becomes `program_fees` in the perpetual futures pool, and
  `accumulated_protocol_fees` becomes `accumulated_program_fees` in the lending
  reserve. The lending instruction `collect_protocol_fees` becomes
  `collect_program_fees` (and `CollectProgramFees`), in every variant, along
  with the tests and the Kani harness that named them.
- Test names that said an order or option "locks" tokens now say where the
  tokens go: `place_bid_moves_quote_into_vault`,
  `place_ask_moves_base_into_vault`, `test_write_call_moves_underlying_into_vault`.
- Comments and READMEs that called the program "the protocol" (fees, rounding
  in its favour, who keeps dust) now say "the program". Mentions of the Solana
  protocol changing slot times are unchanged, as are CHANGELOG history entries.
- "source of truth" comments now say which field the program reads.

Renaming the lending instruction changes its Anchor discriminator, and renaming
the account fields changes their IDL names; the byte layout is unchanged.

Follows quicknode/solana-book#190, which rewrites the book's wording the same
way.

Claude-Session: https://claude.ai/code/session_01JGEoAUjMm7Evv69k46eNcn
@mikemaccana
mikemaccana merged commit 6d537db into main Sep 30, 2026
35 of 36 checks passed

Copy link
Copy Markdown
Collaborator Author

The anchor-v1-group-1 failure is deepest_path_adds_little_compute_to_insert_fill_and_cancel in finance/order-book/anchor-v1. An insert at depth 64 costs 15,228 CU more than on a shallow book, and the test allows 15,000.

I don't think this PR causes it:

  • The only change this PR makes to the order-book program is a comment in place_order.rs, so the program it builds is the same as main's. The other changes rename tests.
  • The Anchor v2 copy of the same test passed on this PR.
  • The test landed on 23 September (fb46fde) and passed in the 28 September scheduled run.
  • Cargo.lock is gitignored (**/*/Cargo.lock), so each CI run resolves the dependencies afresh. A newer patch release of a dependency since 28 September would change the compute cost without any change to this repository. That's my best guess, but I haven't confirmed it: I couldn't install the Solana toolchain to reproduce it.

No fix exists yet. I'm re-running the failed job once. If it fails again, the fix is to find which dependency moved and either pin it or re-measure the limit, in its own PR. I won't raise the limit here to get this PR green.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant