chore(pblock-list): remove duplicate pino subtree#18
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pblock-list/program/Cargo.tomllistspinocchiodeps (notanchor-lang), confirming the parent is the Pinocchio implementation. There is no Anchor counterpart to differentiate from.Cargo.tomlworkspace; each contains a self-contained workspace, but CI does not build either.transfer-hook/isanchor/+quasar/(7 examples). The convention for Pinocchio-only examples elsewhere is the directory namepinocchio/(13 examples). The namepino/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/pinocopy 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 canonicalpblock-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.