Skip to content

feat(ENG-269): Token program validation for base and quote mints#44

Merged
alnoki merged 13 commits intomainfrom
eng-269
Mar 31, 2026
Merged

feat(ENG-269): Token program validation for base and quote mints#44
alnoki merged 13 commits intomainfrom
eng-269

Conversation

@alnoki
Copy link
Copy Markdown
Contributor

@alnoki alnoki commented Mar 30, 2026

Changes

  1. Add base and quote token program account validation in
    register.s, verifying ownership of the respective mints
    and that each program is Token Program or Token 2022
  2. Add duplicate quote token program handling that validates
    the duplicate position is BaseTokenProgram and cross-checks
    mint owners match
  3. Extend #[instruction_accounts] proc macro to emit per-variant
    _POS position constants (e.g. REGISTER_MARKET_ACCOUNTS_BASE_TOKEN_PROGRAM_POS)
    with auto-generated assembly comments from variant names
  4. Add input and input_shifted fields to RegisterMarketFrame
    for stack-based pointer persistence across syscalls, replacing
    the Store(input) register-only pattern
  5. Add pubkey_offsets! constants for BASE_OWNER and QUOTE_OWNER
    enabling direct per-chunk memory access without intermediate
    pointer registers
  6. Add pinocchio-token and pinocchio-token-2022 as workspace
    dependencies, re-exporting TOKEN_PROGRAM_ID and
    TOKEN_2022_PROGRAM_ID from the interface
  7. Add pubkey! constant form (renamed from address!) for
    splitting known pubkeys into chunk/lo/hi assembly constants
  8. Derive CHUNK_{0..3}_OFF from size_of::<u64>() instead of
    hardcoded values
  9. Add 7 new error codes: BaseTokenProgramIsDuplicate,
    BaseTokenProgramNotBaseMintOwner,
    BaseTokenProgramNotTokenProgram,
    InvalidQuoteTokenProgramDuplicate,
    DupQuoteTokenProgramNotQuoteMintOwner,
    NonDupQuoteTokenProgramNotQuoteMintOwner,
    QuoteTokenProgramNotTokenProgram
  10. Add 25 new integration tests with per-chunk coverage for all
    pubkey comparisons and dynamic column-width formatting in
    test output
  11. Update REGISTER-MARKET pseudocode with full token program
    validation flow, frame store/retrieve operations, and
    rent-to-base-token-program advance before CPI
  12. Fix pseudocode comment indentation in Algorithm.vue and
    widen .ps-linenum for triple-digit line numbers
  13. Update #[instruction_accounts] docs in build-scaffolding
    and rename make docs-dev to make docs in CLAUDE.md
  14. Fix sbpf CLI install on CI by pinning blake3 <1.8.4 to
    avoid digest 0.10/0.11 conflict
    (blueshift-gg/sbpf#109)
  15. Suppress clippy::erasing_op and clippy::identity_op in
    macro-generated immediate constants

@linear
Copy link
Copy Markdown

linear bot commented Mar 30, 2026

ENG-269

@alnoki alnoki changed the title ENG-269 feat(ENG-269): Token program validation for base and quote mints Mar 31, 2026
@alnoki alnoki marked this pull request as ready for review March 31, 2026 00:24
@alnoki alnoki merged commit 44f99d2 into main Mar 31, 2026
5 of 6 checks passed
@alnoki alnoki deleted the eng-269 branch March 31, 2026 00:41
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