Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sol decompression #567

Merged
merged 2 commits into from
Apr 2, 2024
Merged

feat: sol decompression #567

merged 2 commits into from
Apr 2, 2024

Conversation

ananas-block
Copy link
Contributor

@ananas-block ananas-block commented Mar 29, 2024

Changes:

  • add sol compression and decompression

@ananas-block ananas-block force-pushed the jorrit/feat-de-compress-sol branch from 22d4a03 to aa57979 Compare March 29, 2024 01:43
@ananas-block ananas-block marked this pull request as draft March 29, 2024 01:44
@ananas-block ananas-block force-pushed the jorrit/feat-de-compress-sol branch from aa57979 to fdb9fff Compare March 29, 2024 01:45
@ananas-block ananas-block marked this pull request as ready for review March 29, 2024 01:49
@ananas-block ananas-block force-pushed the jorrit/feat-de-compress-sol branch from fdb9fff to 2a95c92 Compare March 29, 2024 02:21
@vadorovsky vadorovsky changed the title feat: sol de compression feat: sol decompression Apr 1, 2024
Copy link
Contributor

@SwenSchaeferjohann SwenSchaeferjohann left a comment

Choose a reason for hiding this comment

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

lgtm. should we find an alternative for de_compress right away?
suggestions:
compress_decompress_lamports and
fn compress_decompress_lamports()
and so forth.

yet another alternative may be
compress_or_decompress_lamports

@SwenSchaeferjohann
Copy link
Contributor

shouldn't CI for the JS tests fail here since other nullable values ought to be encoded and decoded on the client? or does anchor auto-fill for appended nullable properties? @ananas-block

* JS: added ixs + tests: compress, decompress lamports

* fix event count on full test run statelessjs

* ci debug js

* rm paths ci

* fix js workflow file

* rm comments, assert  uncompressed sbalances, fix js ci

* rm only in conversion.ts
Comment on lines +232 to +249
// #[cfg(feature = "psp_compressed_pda")]
// {
// let compressed_sol_pda = psp_compressed_pda::de_compression::get_compressed_sol_pda();
// let instruction_data = psp_compressed_pda::instruction::InitCompressSolPda {};
// let accounts = psp_compressed_pda::accounts::InitializeCompressedSolPda {
// fee_payer: payer.pubkey(),
// compressed_sol_pda: compressed_sol_pda,
// system_program: anchor_lang::solana_program::system_program::ID,
// };
// let instruction = Instruction {
// program_id: psp_compressed_pda::ID,
// accounts: accounts.to_account_metas(Some(true)),
// data: instruction_data.data(),
// };
// create_and_send_transaction(&mut context, &[instruction], &payer.pubkey(), &[&payer])
// .await
// .unwrap();
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a comment/todo above here?

@ananas-block ananas-block merged commit 2380564 into main Apr 2, 2024
7 checks passed
@ananas-block ananas-block deleted the jorrit/feat-de-compress-sol branch April 2, 2024 15:11
SwenSchaeferjohann pushed a commit that referenced this pull request Apr 8, 2024
feat: sol decompression (#567)

* feat: sol de compression

* feat: JS compress and decompress lamports (#572)

---------

Co-authored-by: Swen Schäferjohann <[email protected]>

ci: add github ci syntax linter (#574)

chore: Remove patched arkworks crates (#575)

We are using only upstream 0.4.0 arkworks crates now, there is no need
to point to patched 0.3.0 crates.

feat: gnark circuits inclusion + non-inclusion 2-in-1 (#569)

* feat: inclusion + non-inclusion gnark circuits

* Refactor gnark server spawning and killing process.

add actions for initSolOmnibusAccount, compressLamports, decompressLamports + happy path tests (#578)

refactor: rename gnark proof inputs to plural form (#579)

* refactor: rename gnark proof inputs to plural form

* formatting

feat: add SOL compression and decompression cli commands (#580)

* Add SOL compression and decompression commands

* Use getTestRpc instead of Connection in decompress and compress cli cmds.

sync interface
SwenSchaeferjohann pushed a commit that referenced this pull request Apr 11, 2024
feat: sol decompression (#567)

* feat: sol de compression

* feat: JS compress and decompress lamports (#572)

---------

Co-authored-by: Swen Schäferjohann <[email protected]>

ci: add github ci syntax linter (#574)

chore: Remove patched arkworks crates (#575)

We are using only upstream 0.4.0 arkworks crates now, there is no need
to point to patched 0.3.0 crates.

feat: gnark circuits inclusion + non-inclusion 2-in-1 (#569)

* feat: inclusion + non-inclusion gnark circuits

* Refactor gnark server spawning and killing process.

add actions for initSolOmnibusAccount, compressLamports, decompressLamports + happy path tests (#578)

refactor: rename gnark proof inputs to plural form (#579)

* refactor: rename gnark proof inputs to plural form

* formatting

feat: add SOL compression and decompression cli commands (#580)

* Add SOL compression and decompression commands

* Use getTestRpc instead of Connection in decompress and compress cli cmds.

sync interface

rpc-interface coerce from photon response. open: tests

all endpoints except token

wip: debug delay in photon indexing

wip: RPC tests working. debug: merkleproof, notest: token

wip: add sleep

wip: fix cli build

fresh install changes gnark-prover

merkleproof confirmed for 2 consecutive leaves

wip
SwenSchaeferjohann pushed a commit that referenced this pull request Apr 11, 2024
feat: sol decompression (#567)

* feat: sol de compression

* feat: JS compress and decompress lamports (#572)

---------

Co-authored-by: Swen Schäferjohann <[email protected]>

ci: add github ci syntax linter (#574)

chore: Remove patched arkworks crates (#575)

We are using only upstream 0.4.0 arkworks crates now, there is no need
to point to patched 0.3.0 crates.

feat: gnark circuits inclusion + non-inclusion 2-in-1 (#569)

* feat: inclusion + non-inclusion gnark circuits

* Refactor gnark server spawning and killing process.

add actions for initSolOmnibusAccount, compressLamports, decompressLamports + happy path tests (#578)

refactor: rename gnark proof inputs to plural form (#579)

* refactor: rename gnark proof inputs to plural form

* formatting

feat: add SOL compression and decompression cli commands (#580)

* Add SOL compression and decompression commands

* Use getTestRpc instead of Connection in decompress and compress cli cmds.

sync interface

rpc-interface coerce from photon response. open: tests

all endpoints except token

wip: debug delay in photon indexing

wip: RPC tests working. debug: merkleproof, notest: token

wip: add sleep

wip: fix cli build

fresh install changes gnark-prover

merkleproof confirmed for 2 consecutive leaves

wip
SwenSchaeferjohann pushed a commit that referenced this pull request Apr 11, 2024
feat: sol decompression (#567)

* feat: sol de compression

* feat: JS compress and decompress lamports (#572)

---------

Co-authored-by: Swen Schäferjohann <[email protected]>

ci: add github ci syntax linter (#574)

chore: Remove patched arkworks crates (#575)

We are using only upstream 0.4.0 arkworks crates now, there is no need
to point to patched 0.3.0 crates.

feat: gnark circuits inclusion + non-inclusion 2-in-1 (#569)

* feat: inclusion + non-inclusion gnark circuits

* Refactor gnark server spawning and killing process.

add actions for initSolOmnibusAccount, compressLamports, decompressLamports + happy path tests (#578)

refactor: rename gnark proof inputs to plural form (#579)

* refactor: rename gnark proof inputs to plural form

* formatting

feat: add SOL compression and decompression cli commands (#580)

* Add SOL compression and decompression commands

* Use getTestRpc instead of Connection in decompress and compress cli cmds.

sync interface

rpc-interface coerce from photon response. open: tests

all endpoints except token

wip: debug delay in photon indexing

wip: RPC tests working. debug: merkleproof, notest: token

wip: add sleep

wip: fix cli build

fresh install changes gnark-prover

merkleproof confirmed for 2 consecutive leaves

wip

wip: built

rm compress test dupe
SwenSchaeferjohann pushed a commit that referenced this pull request Apr 11, 2024
feat: sol decompression (#567)

* feat: sol de compression

* feat: JS compress and decompress lamports (#572)

---------

Co-authored-by: Swen Schäferjohann <[email protected]>

ci: add github ci syntax linter (#574)

chore: Remove patched arkworks crates (#575)

We are using only upstream 0.4.0 arkworks crates now, there is no need
to point to patched 0.3.0 crates.

feat: gnark circuits inclusion + non-inclusion 2-in-1 (#569)

* feat: inclusion + non-inclusion gnark circuits

* Refactor gnark server spawning and killing process.

add actions for initSolOmnibusAccount, compressLamports, decompressLamports + happy path tests (#578)

refactor: rename gnark proof inputs to plural form (#579)

* refactor: rename gnark proof inputs to plural form

* formatting

feat: add SOL compression and decompression cli commands (#580)

* Add SOL compression and decompression commands

* Use getTestRpc instead of Connection in decompress and compress cli cmds.

sync interface

rpc-interface coerce from photon response. open: tests

all endpoints except token

wip: debug delay in photon indexing

wip: RPC tests working. debug: merkleproof, notest: token

wip: add sleep

wip: fix cli build

fresh install changes gnark-prover

merkleproof confirmed for 2 consecutive leaves

wip

wip: built

rm compress test dupe
sergeytimoshin added a commit that referenced this pull request Apr 12, 2024
feat: sol decompression (#567)

* feat: sol de compression

* feat: JS compress and decompress lamports (#572)

---------

Co-authored-by: Swen Schäferjohann <[email protected]>

ci: add github ci syntax linter (#574)

chore: Remove patched arkworks crates (#575)

We are using only upstream 0.4.0 arkworks crates now, there is no need
to point to patched 0.3.0 crates.

feat: gnark circuits inclusion + non-inclusion 2-in-1 (#569)

* feat: inclusion + non-inclusion gnark circuits

* Refactor gnark server spawning and killing process.

add actions for initSolOmnibusAccount, compressLamports, decompressLamports + happy path tests (#578)

refactor: rename gnark proof inputs to plural form (#579)

* refactor: rename gnark proof inputs to plural form

* formatting

feat: add SOL compression and decompression cli commands (#580)

* Add SOL compression and decompression commands

* Use getTestRpc instead of Connection in decompress and compress cli cmds.

sync interface

rpc-interface coerce from photon response. open: tests

all endpoints except token

wip: debug delay in photon indexing

wip: RPC tests working. debug: merkleproof, notest: token

wip: add sleep

wip: fix cli build

fresh install changes gnark-prover

merkleproof confirmed for 2 consecutive leaves

wip

wip: built

rm compress test dupe
SwenSchaeferjohann added a commit that referenced this pull request Apr 12, 2024
* feat: non-inclusion gnark circuits (#559)

feat: sol decompression (#567)

* feat: sol de compression

* feat: JS compress and decompress lamports (#572)

---------

Co-authored-by: Swen Schäferjohann <[email protected]>

ci: add github ci syntax linter (#574)

chore: Remove patched arkworks crates (#575)

We are using only upstream 0.4.0 arkworks crates now, there is no need
to point to patched 0.3.0 crates.

feat: gnark circuits inclusion + non-inclusion 2-in-1 (#569)

* feat: inclusion + non-inclusion gnark circuits

* Refactor gnark server spawning and killing process.

add actions for initSolOmnibusAccount, compressLamports, decompressLamports + happy path tests (#578)

refactor: rename gnark proof inputs to plural form (#579)

* refactor: rename gnark proof inputs to plural form

* formatting

feat: add SOL compression and decompression cli commands (#580)

* Add SOL compression and decompression commands

* Use getTestRpc instead of Connection in decompress and compress cli cmds.

sync interface

rpc-interface coerce from photon response. open: tests

all endpoints except token

wip: debug delay in photon indexing

wip: RPC tests working. debug: merkleproof, notest: token

wip: add sleep

wip: fix cli build

fresh install changes gnark-prover

merkleproof confirmed for 2 consecutive leaves

wip

wip: built

rm compress test dupe

* cli, stateless.js, ctoken working with photon

* lint

* stdout

* cleanup logs

* initTestEnvIfNeeded with prover and indexer

* cli cmds: create-mint and mint-to working (happy path)

* transfer cli command works

* cli tests working: createmint, mint-to, transfer, balance

* compress, decompress, initsolpool working.

* linted

* cleanup

* disable vitest:browser for prover.js

* update readme: add usage instructions

* upd cli readme

* fix typo

* Update key loading logic and add test-validator options

* fix cli tests + update oclif

* Replace Connection with getTestRpc in cli command

* fix create-mint

* new cli + photon rpc

* remove manual prover.sh invocation in compressed-token/package.json

* clean up

* Add CLI test to light-sdk-tests.yml workflow

* Update cli/README.md

Co-authored-by: Michal Rostecki <[email protected]>

* fix cli prove test

* add "build @lightprotocol/programs" step to setup-and-build action

* Update cli/test/commands/config/index.test.ts

Co-authored-by: Swen Schäferjohann <[email protected]>

* Update test script in package.json

The `test` script in the package.json file was updated to include `test-prove` and `test-init-sol-pool`.

* Enable in-browser tests for prover.js package

* Update test command in cli/package.json

* rm commented code, address review

---------

Co-authored-by: Swen <[email protected]>
Co-authored-by: Michal Rostecki <[email protected]>
Co-authored-by: Swen Schäferjohann <[email protected]>
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