Skip to content

chore(pblock-list): remove duplicate pino subtree#18

Merged
mikemaccana merged 1 commit into
mainfrom
chore/remove-pblock-list-pino-duplicate
May 13, 2026
Merged

chore(pblock-list): remove duplicate pino subtree#18
mikemaccana merged 1 commit into
mainfrom
chore/remove-pblock-list-pino-duplicate

Conversation

@mikemaccana
Copy link
Copy Markdown
Collaborator

@mikemaccana mikemaccana commented May 13, 2026

The `tokens/token-extensions/transfer-hook/pblock-list/pino/` directory is a byte-for-byte duplicate of its parent's `program/`, `sdk/`, and `cli/` subdirectories. It was introduced by an accidental `cp -r` in #398 and later renamed from `pinocchio/` to `pino/` in #461.

Evidence

  • diff -rq pblock-list/{program,sdk,cli} pblock-list/pino/{program,sdk,cli} — zero differences.
  • The parent pblock-list/program/Cargo.toml lists pinocchio deps (not anchor-lang), confirming the parent is the Pinocchio implementation. There is no Anchor counterpart to differentiate from.
  • Neither copy appears in the root Cargo.toml workspace; each contains a self-contained workspace, but CI does not build either.
  • The repo-wide convention for dual implementations elsewhere in transfer-hook/ is anchor/ + quasar/ (7 examples). The convention for Pinocchio-only examples elsewhere is the directory name pinocchio/ (13 examples). The name pino/ exists only here, and only because of the add pinocchio account data example solana-developers/program-examples#461 rename.

What this PR does

git rm -r tokens/token-extensions/transfer-hook/pblock-list/pino/ — drops the 52-file duplicate subtree (~5.7K lines).

Risk

Low. CI runs zero builds on the deleted paths; nothing else in the repo references them.


Note

Low Risk
Low risk housekeeping change that deletes a duplicated pblock-list/pino copy of the program/SDK/CLI sources, with no functional logic changes to the remaining implementation.

Overview
Removes the duplicated tokens/token-extensions/transfer-hook/pblock-list/pino/ subtree (workspace, Pinocchio program, Rust CLI, and generated Rust/TS SDKs plus Codama config/docs), leaving the canonical pblock-list/{program,cli,sdk} sources as the only copy.

This is a pure cleanup via file deletions to reduce repo size and maintenance surface; no runtime behavior is changed outside the removed duplicate.

Reviewed by Cursor Bugbot for commit 34b0174. Bugbot is set up for automated code reviews on this repo. Configure here.

The pblock-list/pino/ directory was a byte-for-byte duplicate of its parent's
program/, sdk/, and cli/ subdirectories. It was introduced by an accidental
cp -r in solana-developers#398 and later renamed from pinocchio/ to pino/ in solana-developers#461. Neither
copy was built by CI.

The parent pblock-list/program/ is the canonical Pinocchio implementation.
Deleting the duplicate subtree to remove ~5.7K lines of redundant files.
@mikemaccana mikemaccana merged commit 7f67385 into main May 13, 2026
19 checks passed
mikemaccana pushed a commit that referenced this pull request May 15, 2026
The transfer-hook/block-list/pinocchio project was added with a program,
SDK, and a `package.json` test script pointing at `./tests/test.spec.ts`,
but the test file was never written. The project also had several latent
bugs that prevented it from working end-to-end. This change writes the
missing test harness and fixes the bugs the tests surfaced.

What this PR adds
- `tests/test.spec.ts` (litesvm + mocha) covering the full lifecycle:
  init, create Token Extensions mint with TransferHook, setup_extra_metas
  (empty + source-dependency), ATA creation, mint, transfer when the
  source wallet is not blocked, block_wallet, transfer fails with
  AccountBlocked, unblock_wallet, transfer succeeds again.
- `tests/run-mocha-with-retry.mjs` (CI test entry point) that wraps
  ts-mocha. litesvm's prebuilt native binding intermittently aborts with
  `std::bad_alloc` (SIGABRT) inside the addon when Token Extensions
  invokes the block-list hook. The crash is in the .node binary, not in
  our program, and a fresh Node process avoids it. The wrapper retries
  until it gets a clean run (or hits the retry budget) and bails for
  non-bad_alloc failures.
- `tests/tsconfig.test.json`.
- `pnpm-lock.yaml` regenerated with all required test deps.

Program bugs the tests caught and this PR fixes
- `Config` struct field order corrected (alignment-driven Rust layout was
  silently corrupting state on read; reordered fields so `Pubkey` comes
  before the `u8` flags).
- `tx_hook` had a dead pre-flight guard that consumed accounts the runtime
  no longer provides; removed.
- `token2022_utils` had stale buffer-offset math that misread newer mint
  extensions; corrected.
- `setup_extra_metas` instruction handler corrected to match the layout
  Token Extensions expects when discovering hook accounts.

Test output
```
  block-list pinocchio transfer hook
    init: initialises config PDA
    setup_extra_metas: writes the extra-account-metas account
    creates a Token Extensions mint with TransferHook -> block-list, plus extra metas
    transfer succeeds when source wallet is not blocked
    block_wallet: blocks wallet A, blocked_wallets_count increments
    transfer from blocked source wallet fails with AccountBlocked
    unblock_wallet: unblocks wallet A, blocked_wallets_count decrements, transfers work again
  7 passing
[run-mocha-with-retry] clean pass on attempt 2
```

References
- #18 (removed duplicate `pino/` subtree)
- #19 (moved program into `pinocchio/` subdir)
- #20 (renamed `pblock-list` -> `block-list`)
- #23 (CI logic fix that exposed missing tests)
- #24 (quasar-spl regression fix)

This PR makes block-list/pinocchio a real first-class example with
passing tests for the first time.
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.

2 participants