* dereplicode address alignment check
* Uses `checked_div` and `checked_rem` in built-in loaders.
* Uses `checked_div` and `checked_rem`.
* sdk: replace sub() with saturating_sub()
* eliminate `String` "arithmetic"
* allow arithmetic side-effects in tests and benches and on types we don't control
---------
Co-authored-by: Trent Nelson <trent@solana.com>
* sdk: Add concurrent support for rand 0.7 and 0.8
* Update rand, rand_chacha, and getrandom versions
* Run command to replace `gen_range`
Run `git grep -l gen_range | xargs sed -i'' -e 's/gen_range(\(\S*\), /gen_range(\1../'
* sdk: Fix users of older `gen_range`
* Replace `hash::new_rand` with `hash::new_with_thread_rng`
Run:
```
git grep -l hash::new_rand | xargs sed -i'' -e 's/hash::new_rand([^)]*/hash::new_with_thread_rng(/'
```
* perf: Use `Keypair::new()` instead of `generate`
* Use older rand version in zk-token-sdk
* program-runtime: Inline random key generation
* bloom: Fix clippy warnings in tests
* streamer: Scope rng usage correctly
* perf: Fix clippy warning
* accounts-db: Map to char to generate a random string
* Remove `from_secret_key_bytes`, it's just `keypair_from_seed`
* ledger: Generate keypairs by hand
* ed25519-tests: Use new rand
* runtime: Use new rand in all tests
* gossip: Clean up clippy and inline keypair generators
* core: Inline keypair generation for tests
* Push sbf lockfile change
* sdk: Sort dependencies correctly
* Remove `hash::new_with_thread_rng`, use `Hash::new_unique()`
* Use Keypair::new where chacha isn't used
* sdk: Fix build by marking rand 0.7 optional
* Hardcode secret key length, add static assertion
* Unify `getrandom` crate usage to fix linking errors
* bloom: Fix tests that require a random hash
* Remove some dependencies, try to unify others
* Remove unnecessary uses of rand and rand_core
* Update lockfiles
* Add back some dependencies to reduce rebuilds
* Increase max rebuilds from 14 to 15
* frozen-abi: Remove `getrandom`
* Bump rebuilds to 17
* Remove getrandom from zk-token-proof
* make `ElGamalKeypair` fields private
* update the rest of `zk-token-sdk` for the visibility update
* update `zk-token-proof-tests` for the visibility update
* update `zk-keygen` for the visibility update
* update `zk-token-proof` benches for the updated visibility
* cargo fmt
* rename `ElGamalKeypair::new` to `ElGamalKeypair::new_for_tests`
* add bench test for `VerifyPubkeyValidity`
* add bench test for `VerifyRangeProofU64`
* add bench test for `VerifyWithdraw`
* add bench test for `VerifyZeroBalance`
* add bench test for `VerifyGroupedCiphertextValidity`
* add bench test for `VerifyCiphertextCommitmentEquality`
* add bench test for `VerifyCiphertextCiphertextEquality`
* add bench test for `VerifyBatchedGroupedCiphertextValidity`
* add bench test for `VerifyBatchedRangeProofu64`, `VerifyBatchedRangeProofU128`, `VerifyBatchedRangeProofU256`
* add bench test for `VerifyTransfer` and `VerifyTransferWithFee`
* use add `criterion` to workspace cargo
* add bench to ci
* add aggregate range proof instructions data
* add aggregate range proof instruction
* update proof program processor for aggregate range proof instructions
* cargo fmt
* Update zk-token-sdk/src/instruction/aggregate_range_proof/aggregate_range_proof_256.rs
Co-authored-by: mvines <mvines@gmail.com>
* add remark in instruction description that context state account must be pre-allocated
* use `u64::BITS` and `u128::BITS`
* add proof description in `zk_token_proof_instruction.rs`
* rename instruction names to `VerifyBatchedRangeProofU{N}`
* rename module names from `aggregate` to `batched`
* add `tokio::test` that was lost in rebase
---------
Co-authored-by: mvines <mvines@gmail.com>
* add `VerifyRangeProof` instruction
* update proof program processor for `VerifyRangeProof64`
* specify target arch for `RANGEPROOF64_BIT_LENGTH
* rename `transcript_new` to `new_transcript`
* add constructor for `VerifyRangeProof64`
* add remark in the instruction description that context state account must be pre-allocated
* add proof description in `zk_token_proof_instruction.rs`
* rename `VerifyRangeProof64` to `VerifyRangeProofU64`
* use `u64::BITS`
* Update zk-token-sdk/src/zk_token_proof_instruction.rs
Co-authored-by: Tyera <teulberg@gmail.com>
* Apply suggestions from code review
Co-authored-by: Tyera <teulberg@gmail.com>
* fix range proof test
---------
Co-authored-by: Tyera <teulberg@gmail.com>
* rename and restruct ProofInstruction::VerifyCloseAccount to ProofInstruction::VerifyZeroBalance
* rename `PubkeySigmaProof` to `PubkeyValidityProof`
* refactor equality proofs into separate modules
* rename and restructure ProofInstruction::VerifyWithdrawWithheld to ProofInstruction::VerifyCiphertextCiphertextEquality
* add and reorg documentation for the proof instructions
* generalize ciphertext-ciphertext equality proof data constructor
* Update zk-token-sdk/src/instruction/ctxt_ctxt_equality.rs
Co-authored-by: Jon Cinque <joncinque@pm.me>
---------
Co-authored-by: Jon Cinque <joncinque@pm.me>
* Uses declare_process_instruction!() in all tests.
* Adds post_adjustments to mock_process_instruction().
Removes "solana_sbf_rust_external_spend" from assert_instruction_count() as it panics.
* Moves stable_log::program_invoke(), stable_log::program_success() and stable_log::program_failure() calls from bpf_loader into InvokeContext::process_executable_chain().
* Turns result of ProcessInstructionWithContext from InstructionError into Box<dyn std::error::Error>.
* Bump to solana_rbpf v0.3.0
* Removes Result from return type of EbpfVm::new().
* Turns EbpfError into Box<dyn std::error::Error>.
* Removes BpfError.
* Removes SyscallError::InstructionError.
* Adds a type alias for Box<dyn std::error::Error> in syscalls.
* add feature gate
* builtins consume statically defined units at beginning of process_instruction()
* Add new instructionError; return error if builtin did not consume units to enforce builtin to consume units;
* updated related tests
* updated ProgramTest with deactivated native_programs_consume_cu feature to continue support existing mock/test programs that do not consume units
* introduce workspace.package
* introduce workspace.dependencies
* read version from root cargo.toml
* pass check when version = { workspace = true }
* don't bump version when version = { workspace = true }
* including workspace Cargo.toml when bump version
* programs/sbf use workspace inheritance
* fix increasing cargo version ignore program/sbf/Cargo.toml
* introduce workspace.package
* introduce workspace.dependencies
* read version from root cargo.toml
* pass check when version = { workspace = true }
* don't bump version when version = { workspace = true }
* including workspace Cargo.toml when bump version
* programs/sbf use workspace inheritance
* fix increasing cargo version ignore program/sbf/Cargo.toml
* Bumps solana_rbpf to v0.2.36
* Removes ThisInstructionMeter.
* Removes one "unsafe" expression.
* Removes redundant call to solana_rbpf:🧝:register_bpf_function().
* Adjusts SyscallFunction and SyscallRegistry.
* Inlines ProgramEnvironment into EbpfVm.
* Refactors trait SyscallConsume into fn consume_compute_meter().
* Inlines ComputeMeter into InvokeContext.
* Removes solana-metrics dependency from bpf_loader.
* Replaces RBPF tracer functionality by the debugger.
* Take compute_units_consumed from execute_program().
* Merges execute_program_interpreted() and execute_program_jit().
* Adds transaction_context and instruction_context where invoke_context.get_keyed_accounts() is used.
* Use instruction_context.get_instruction_data() instead of an explicit parameter.
* Removes instruction_data parameter from Executor::execute().
* Removes instruction_data parameter from ProcessInstructionWithContext.