Skip to content

Swen dev v4 cli pt 1/x#15

Merged
ananas-block merged 62 commits intomainfrom
swen-dev_v4-cli
Feb 18, 2023
Merged

Swen dev v4 cli pt 1/x#15
ananas-block merged 62 commits intomainfrom
swen-dev_v4-cli

Conversation

@SwenSchaeferjohann
Copy link
Contributor

@SwenSchaeferjohann SwenSchaeferjohann commented Feb 12, 2023

will open up new cli-subtask branch after this is merged ( cli needs be extended, spl,relayer etc)
tests(functional_tests) and cli (user class, all cmds) are all running.

edit:

Summary of changes

  • Added relayer dir (wie)
  • Added CLI (tested)
  • Sdk:
    • Extended user class
    • Added provider class
    • Transaction class and tx params working with node/browsercontext
    • keypair class -> account class

Qs:

  • Verifiers0,1: need check for payer/wallet still?

ananas-block and others added 30 commits June 2, 2022 00:24
@@ -19,7 +19,6 @@ import {
merkleTreeProgramId,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file impossible to review

@ananas-block
Copy link
Contributor

the js files are still in the tests folder ...

@ananas-block ananas-block merged commit 9c405a2 into main Feb 18, 2023
@vadorovsky vadorovsky deleted the swen-dev_v4-cli branch November 12, 2023 20:36
vadorovsky pushed a commit to vadorovsky/light-protocol that referenced this pull request May 1, 2024
ananas-block added a commit that referenced this pull request Feb 6, 2026
Audit issue #15 (HIGH): verify_pda used derive_address which accepts
any bump seed, allowing non-canonical bumps for ATAs. Switch to
find_program_address to derive the canonical bump and reject any
non-canonical bump with InvalidSeeds error.
ananas-block added a commit that referenced this pull request Feb 9, 2026
…on-chain

Remove client-provided bump from CreateAssociatedTokenAccountInstructionData
and all SDK/test callers. The on-chain program now derives the canonical bump
via find_program_address, preventing non-canonical bump attacks (audit #15).

- Remove bump field from instruction data structs
- Update verify_pda to derive canonical bump and return it
- Update validate_ata_derivation and decompress_mint callers
- Remove _with_bump SDK variants and ATA2 dead code
- Remove associated_token::bump from macro attribute support
- Update derive_associated_token_account to return Pubkey only
- Update all 100+ call sites across SDK, tests, and TypeScript
ananas-block added a commit that referenced this pull request Feb 11, 2026
Audit issue #15 (HIGH): verify_pda used derive_address which accepts
any bump seed, allowing non-canonical bumps for ATAs. Switch to
find_program_address to derive the canonical bump and reject any
non-canonical bump with InvalidSeeds error.
ananas-block added a commit that referenced this pull request Feb 11, 2026
…on-chain

Remove client-provided bump from CreateAssociatedTokenAccountInstructionData
and all SDK/test callers. The on-chain program now derives the canonical bump
via find_program_address, preventing non-canonical bump attacks (audit #15).

- Remove bump field from instruction data structs
- Update verify_pda to derive canonical bump and return it
- Update validate_ata_derivation and decompress_mint callers
- Remove _with_bump SDK variants and ATA2 dead code
- Remove associated_token::bump from macro attribute support
- Update derive_associated_token_account to return Pubkey only
- Update all 100+ call sites across SDK, tests, and TypeScript
ananas-block added a commit that referenced this pull request Feb 11, 2026
* fix: enforce canonical bump in PDA verification

Audit issue #15 (HIGH): verify_pda used derive_address which accepts
any bump seed, allowing non-canonical bumps for ATAs. Switch to
find_program_address to derive the canonical bump and reject any
non-canonical bump with InvalidSeeds error.

* fix: use pinocchio::pubkey::find_program_address instead of pinocchio_pubkey

* fix: remove bump from ATA instruction data and derive canonical bump on-chain

Remove client-provided bump from CreateAssociatedTokenAccountInstructionData
and all SDK/test callers. The on-chain program now derives the canonical bump
via find_program_address, preventing non-canonical bump attacks (audit #15).

- Remove bump field from instruction data structs
- Update verify_pda to derive canonical bump and return it
- Update validate_ata_derivation and decompress_mint callers
- Remove _with_bump SDK variants and ATA2 dead code
- Remove associated_token::bump from macro attribute support
- Update derive_associated_token_account to return Pubkey only
- Update all 100+ call sites across SDK, tests, and TypeScript

* fix: update wrong bump test for canonical bump derivation

With canonical bumps, the program derives the bump internally so
providing a wrong bump is no longer possible. Replace with a test
that passes a wrong ATA address to verify PDA validation.

* fix test

* fix lint
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.

3 participants