diff --git a/.github/workflows/light-system-programs-tests.yml b/.github/workflows/light-system-programs-tests.yml index 6dae664742..1459f3848d 100644 --- a/.github/workflows/light-system-programs-tests.yml +++ b/.github/workflows/light-system-programs-tests.yml @@ -74,7 +74,6 @@ jobs: run: | source ./scripts/devenv.sh anchor build - anchor build --program-name light_system_program -- --features cpi-context - name: ${{ matrix.program }} run: | @@ -83,10 +82,6 @@ jobs: IFS=',' read -r -a sub_tests <<< "${{ join(fromJSON(matrix['sub-tests']), ', ') }}" for subtest in "${sub_tests[@]}" do - if [ "$subtest" == "cargo-test-sbf --features cpi-context -p token-escrow -- --test-threads=1" ]; then - anchor build --program-name light_system_program -- --features cpi-context - anchor build --program-name light_compressed_token -- --features cpi-context - fi echo "$subtest" eval "RUSTFLAGS=\"-D warnings\" $subtest" done diff --git a/examples/token-escrow/programs/token-escrow/Cargo.toml b/examples/token-escrow/programs/token-escrow/Cargo.toml index b480f13dc4..87af75ffa2 100644 --- a/examples/token-escrow/programs/token-escrow/Cargo.toml +++ b/examples/token-escrow/programs/token-escrow/Cargo.toml @@ -15,7 +15,7 @@ no-entrypoint = [] no-log-ix-name = [] cpi = ["no-entrypoint"] custom-heap = [] -default = ["custom-heap", "idl-build"] +default = ["custom-heap", "idl-build", "cpi-context"] test-sbf = [] cpi-context = [] idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"] diff --git a/js/compressed-token/src/idl/light_compressed_token.ts b/js/compressed-token/src/idl/light_compressed_token.ts index d8ba40d3ff..1a6712c7c3 100644 --- a/js/compressed-token/src/idl/light_compressed_token.ts +++ b/js/compressed-token/src/idl/light_compressed_token.ts @@ -1360,23 +1360,103 @@ export type LightCompressedToken = { errors: [ { code: 6000; - name: 'SignerCheckFailed'; - msg: 'Signer check failed'; + name: 'PublicKeyAmountMissmatch'; + msg: 'public keys and amounts must be of same length'; }, { code: 6001; - name: 'CreateTransferInstructionFailed'; - msg: 'Create transfer instruction failed'; + name: 'SignerCheckFailed'; + msg: 'SignerCheckFailed'; }, { code: 6002; - name: 'AccountNotFound'; - msg: 'Account not found'; + name: 'ComputeInputSumFailed'; + msg: 'ComputeInputSumFailed'; }, { code: 6003; - name: 'SerializationError'; - msg: 'Serialization error'; + name: 'ComputeOutputSumFailed'; + msg: 'ComputeOutputSumFailed'; + }, + { + code: 6004; + name: 'ComputeCompressSumFailed'; + msg: 'ComputeCompressSumFailed'; + }, + { + code: 6005; + name: 'ComputeDecompressSumFailed'; + msg: 'ComputeDecompressSumFailed'; + }, + { + code: 6006; + name: 'SumCheckFailed'; + msg: 'SumCheckFailed'; + }, + { + code: 6007; + name: 'DecompressRecipientUndefinedForDecompress'; + msg: 'DecompressRecipientUndefinedForDecompress'; + }, + { + code: 6008; + name: 'CompressedPdaUndefinedForDecompress'; + msg: 'CompressedPdaUndefinedForDecompress'; + }, + { + code: 6009; + name: 'DeCompressAmountUndefinedForDecompress'; + msg: 'DeCompressAmountUndefinedForDecompress'; + }, + { + code: 6010; + name: 'CompressedPdaUndefinedForCompress'; + msg: 'CompressedPdaUndefinedForCompress'; + }, + { + code: 6011; + name: 'DeCompressAmountUndefinedForCompress'; + msg: 'DeCompressAmountUndefinedForCompress'; + }, + { + code: 6012; + name: 'DelegateUndefined'; + msg: 'DelegateUndefined while delegated amount is defined'; + }, + { + code: 6013; + name: 'DelegateSignerCheckFailed'; + msg: 'DelegateSignerCheckFailed'; + }, + { + code: 6014; + name: 'SplTokenSupplyMismatch'; + msg: 'SplTokenSupplyMismatch'; + }, + { + code: 6015; + name: 'HeapMemoryCheckFailed'; + msg: 'HeapMemoryCheckFailed'; + }, + { + code: 6016; + name: 'InstructionNotCallable'; + msg: 'The instruction is not callable'; + }, + { + code: 6017; + name: 'ArithmeticUnderflow'; + msg: 'ArithmeticUnderflow'; + }, + { + code: 6018; + name: 'InvalidDelegate'; + msg: 'InvalidDelegate'; + }, + { + code: 6019; + name: 'HashToFieldError'; + msg: 'HashToFieldError'; }, ]; }; @@ -2747,23 +2827,103 @@ export const IDL: LightCompressedToken = { errors: [ { code: 6000, - name: 'SignerCheckFailed', - msg: 'Signer check failed', + name: 'PublicKeyAmountMissmatch', + msg: 'public keys and amounts must be of same length', }, { code: 6001, - name: 'CreateTransferInstructionFailed', - msg: 'Create transfer instruction failed', + name: 'SignerCheckFailed', + msg: 'SignerCheckFailed', }, { code: 6002, - name: 'AccountNotFound', - msg: 'Account not found', + name: 'ComputeInputSumFailed', + msg: 'ComputeInputSumFailed', }, { code: 6003, - name: 'SerializationError', - msg: 'Serialization error', + name: 'ComputeOutputSumFailed', + msg: 'ComputeOutputSumFailed', + }, + { + code: 6004, + name: 'ComputeCompressSumFailed', + msg: 'ComputeCompressSumFailed', + }, + { + code: 6005, + name: 'ComputeDecompressSumFailed', + msg: 'ComputeDecompressSumFailed', + }, + { + code: 6006, + name: 'SumCheckFailed', + msg: 'SumCheckFailed', + }, + { + code: 6007, + name: 'DecompressRecipientUndefinedForDecompress', + msg: 'DecompressRecipientUndefinedForDecompress', + }, + { + code: 6008, + name: 'CompressedPdaUndefinedForDecompress', + msg: 'CompressedPdaUndefinedForDecompress', + }, + { + code: 6009, + name: 'DeCompressAmountUndefinedForDecompress', + msg: 'DeCompressAmountUndefinedForDecompress', + }, + { + code: 6010, + name: 'CompressedPdaUndefinedForCompress', + msg: 'CompressedPdaUndefinedForCompress', + }, + { + code: 6011, + name: 'DeCompressAmountUndefinedForCompress', + msg: 'DeCompressAmountUndefinedForCompress', + }, + { + code: 6012, + name: 'DelegateUndefined', + msg: 'DelegateUndefined while delegated amount is defined', + }, + { + code: 6013, + name: 'DelegateSignerCheckFailed', + msg: 'DelegateSignerCheckFailed', + }, + { + code: 6014, + name: 'SplTokenSupplyMismatch', + msg: 'SplTokenSupplyMismatch', + }, + { + code: 6015, + name: 'HeapMemoryCheckFailed', + msg: 'HeapMemoryCheckFailed', + }, + { + code: 6016, + name: 'InstructionNotCallable', + msg: 'The instruction is not callable', + }, + { + code: 6017, + name: 'ArithmeticUnderflow', + msg: 'ArithmeticUnderflow', + }, + { + code: 6018, + name: 'InvalidDelegate', + msg: 'InvalidDelegate', + }, + { + code: 6019, + name: 'HashToFieldError', + msg: 'HashToFieldError', }, ], }; diff --git a/js/stateless.js/src/idls/light_compressed_token.ts b/js/stateless.js/src/idls/light_compressed_token.ts index d8ba40d3ff..1a6712c7c3 100644 --- a/js/stateless.js/src/idls/light_compressed_token.ts +++ b/js/stateless.js/src/idls/light_compressed_token.ts @@ -1360,23 +1360,103 @@ export type LightCompressedToken = { errors: [ { code: 6000; - name: 'SignerCheckFailed'; - msg: 'Signer check failed'; + name: 'PublicKeyAmountMissmatch'; + msg: 'public keys and amounts must be of same length'; }, { code: 6001; - name: 'CreateTransferInstructionFailed'; - msg: 'Create transfer instruction failed'; + name: 'SignerCheckFailed'; + msg: 'SignerCheckFailed'; }, { code: 6002; - name: 'AccountNotFound'; - msg: 'Account not found'; + name: 'ComputeInputSumFailed'; + msg: 'ComputeInputSumFailed'; }, { code: 6003; - name: 'SerializationError'; - msg: 'Serialization error'; + name: 'ComputeOutputSumFailed'; + msg: 'ComputeOutputSumFailed'; + }, + { + code: 6004; + name: 'ComputeCompressSumFailed'; + msg: 'ComputeCompressSumFailed'; + }, + { + code: 6005; + name: 'ComputeDecompressSumFailed'; + msg: 'ComputeDecompressSumFailed'; + }, + { + code: 6006; + name: 'SumCheckFailed'; + msg: 'SumCheckFailed'; + }, + { + code: 6007; + name: 'DecompressRecipientUndefinedForDecompress'; + msg: 'DecompressRecipientUndefinedForDecompress'; + }, + { + code: 6008; + name: 'CompressedPdaUndefinedForDecompress'; + msg: 'CompressedPdaUndefinedForDecompress'; + }, + { + code: 6009; + name: 'DeCompressAmountUndefinedForDecompress'; + msg: 'DeCompressAmountUndefinedForDecompress'; + }, + { + code: 6010; + name: 'CompressedPdaUndefinedForCompress'; + msg: 'CompressedPdaUndefinedForCompress'; + }, + { + code: 6011; + name: 'DeCompressAmountUndefinedForCompress'; + msg: 'DeCompressAmountUndefinedForCompress'; + }, + { + code: 6012; + name: 'DelegateUndefined'; + msg: 'DelegateUndefined while delegated amount is defined'; + }, + { + code: 6013; + name: 'DelegateSignerCheckFailed'; + msg: 'DelegateSignerCheckFailed'; + }, + { + code: 6014; + name: 'SplTokenSupplyMismatch'; + msg: 'SplTokenSupplyMismatch'; + }, + { + code: 6015; + name: 'HeapMemoryCheckFailed'; + msg: 'HeapMemoryCheckFailed'; + }, + { + code: 6016; + name: 'InstructionNotCallable'; + msg: 'The instruction is not callable'; + }, + { + code: 6017; + name: 'ArithmeticUnderflow'; + msg: 'ArithmeticUnderflow'; + }, + { + code: 6018; + name: 'InvalidDelegate'; + msg: 'InvalidDelegate'; + }, + { + code: 6019; + name: 'HashToFieldError'; + msg: 'HashToFieldError'; }, ]; }; @@ -2747,23 +2827,103 @@ export const IDL: LightCompressedToken = { errors: [ { code: 6000, - name: 'SignerCheckFailed', - msg: 'Signer check failed', + name: 'PublicKeyAmountMissmatch', + msg: 'public keys and amounts must be of same length', }, { code: 6001, - name: 'CreateTransferInstructionFailed', - msg: 'Create transfer instruction failed', + name: 'SignerCheckFailed', + msg: 'SignerCheckFailed', }, { code: 6002, - name: 'AccountNotFound', - msg: 'Account not found', + name: 'ComputeInputSumFailed', + msg: 'ComputeInputSumFailed', }, { code: 6003, - name: 'SerializationError', - msg: 'Serialization error', + name: 'ComputeOutputSumFailed', + msg: 'ComputeOutputSumFailed', + }, + { + code: 6004, + name: 'ComputeCompressSumFailed', + msg: 'ComputeCompressSumFailed', + }, + { + code: 6005, + name: 'ComputeDecompressSumFailed', + msg: 'ComputeDecompressSumFailed', + }, + { + code: 6006, + name: 'SumCheckFailed', + msg: 'SumCheckFailed', + }, + { + code: 6007, + name: 'DecompressRecipientUndefinedForDecompress', + msg: 'DecompressRecipientUndefinedForDecompress', + }, + { + code: 6008, + name: 'CompressedPdaUndefinedForDecompress', + msg: 'CompressedPdaUndefinedForDecompress', + }, + { + code: 6009, + name: 'DeCompressAmountUndefinedForDecompress', + msg: 'DeCompressAmountUndefinedForDecompress', + }, + { + code: 6010, + name: 'CompressedPdaUndefinedForCompress', + msg: 'CompressedPdaUndefinedForCompress', + }, + { + code: 6011, + name: 'DeCompressAmountUndefinedForCompress', + msg: 'DeCompressAmountUndefinedForCompress', + }, + { + code: 6012, + name: 'DelegateUndefined', + msg: 'DelegateUndefined while delegated amount is defined', + }, + { + code: 6013, + name: 'DelegateSignerCheckFailed', + msg: 'DelegateSignerCheckFailed', + }, + { + code: 6014, + name: 'SplTokenSupplyMismatch', + msg: 'SplTokenSupplyMismatch', + }, + { + code: 6015, + name: 'HeapMemoryCheckFailed', + msg: 'HeapMemoryCheckFailed', + }, + { + code: 6016, + name: 'InstructionNotCallable', + msg: 'The instruction is not callable', + }, + { + code: 6017, + name: 'ArithmeticUnderflow', + msg: 'ArithmeticUnderflow', + }, + { + code: 6018, + name: 'InvalidDelegate', + msg: 'InvalidDelegate', + }, + { + code: 6019, + name: 'HashToFieldError', + msg: 'HashToFieldError', }, ], }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3dcd6f88d..d5a206909d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -506,6 +506,10 @@ importers: specifier: ^1.6.0 version: 1.6.0(@types/node@20.12.11)(@vitest/browser@1.6.0)(terser@5.31.0) + hasher.rs/src/main/wasm: {} + + hasher.rs/src/main/wasm-simd: {} + js/compressed-token: dependencies: '@coral-xyz/anchor': diff --git a/programs/compressed-token/Cargo.toml b/programs/compressed-token/Cargo.toml index 95bad0b3a0..02794194ac 100644 --- a/programs/compressed-token/Cargo.toml +++ b/programs/compressed-token/Cargo.toml @@ -16,7 +16,7 @@ no-log-ix-name = [] cpi = ["no-entrypoint"] custom-heap = ["light-heap"] mem-profiling = [] -default = ["custom-heap", "idl-build"] +default = ["custom-heap", "idl-build", "cpi-context"] test-sbf = [] bench-sbf = [] cpi-context = [] diff --git a/programs/system/Cargo.toml b/programs/system/Cargo.toml index ca1440a860..012357793d 100644 --- a/programs/system/Cargo.toml +++ b/programs/system/Cargo.toml @@ -15,7 +15,7 @@ no-log-ix-name = [] cpi = ["no-entrypoint"] custom-heap = ["light-heap"] mem-profiling = [] -default = ["custom-heap", "idl-build"] +default = ["custom-heap", "idl-build", "cpi-context"] test-sbf = [] bench-sbf = [] idl-build = ["anchor-lang/idl-build"]