- Make sure you have installed XCode from the App store
- Select xcode version from appstore:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer - Confirm by running
xcodebuild -version - Install GCC 12
brew install gcc@12 - Create a symlink to your usr/local/include folder to make includes discoverable:
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/
To make Rust analyzer target target_os="solana" try the following:
- Find
active_release_dirfrom your config file withcat ~/.config/solana/install/config.yml(or whatever your config directory is) - Create a
.vscode/settings.jsonfile in your project workspace and add the following:
{
"rust-analyzer.cargo.target": "sbf-solana-solana",
"rust-analyzer.cargo.extraEnv": {
"CARGO": "<your_active_release_directory>/bin/sdk/sbf/dependencies/platform-tools/rust/bin/cargo",
"RUSTC": "/bin/sdk/sbf/dependencies/platform-tools/rust/bin/rustc"| #!/bin/bash | |
| # Check if program ID and name are provided | |
| if [ "$#" -ne 2 ]; then | |
| echo "Usage: ./mollusk_generate.sh <ProgramID> <name>" | |
| exit 1 | |
| fi | |
| PROGRAM_ID="$1" | |
| NAME="$2" |
| /******************* | |
| * UNLOCKING SCRIPT * | |
| *******************/ | |
| // Reverse-ordered Winternitz signature scalar and hash offset pairs | |
| <0x6a1e8e25ac52d4073e6e6792deae3dd16d12580130e8fb1338629cf09cde415f> <0x08> | |
| <0x171582236c86aacab7a0bdfde1d841bed34a4c712748b46a141bd9a743cb965a> <0x0a> | |
| <0xc42ebffb891ff91b5cd75c0b2cfa1b1658eb3586bad9a4aaea05a34846765491> <0xf0> | |
| <0x7faa84fe7faa005ebc37f02b15aa8db41c9ed7c63d8480573471533a0c942096> <0xb0> | |
| <0xe7bbce18cacf2dbc2ae36122365462a07850e873e961ec4ea318dc6506498790> <0x15> |
For this deconstruction, we will be researching fib.so, a hand-rolled sBPF assembly program that calculates the fibonacci number based upon a u8 input.
The structure of an sBPF program has 4 sections:
The starting point of the file, describing the overall file format, target environment, and offsets for program and section headers.
Define the memory segments and their attributes (readable, writable, executable) for runtime execution.
For this deconstruction, we will be researching fib.so, a hand-rolled sBPF assembly program that calculates the fibonacci number based upon a u8 input.
The structure of an sBPF program has 4 sections:
The starting point of the file, describing the overall file format, target environment, and offsets for program and section headers.
Define the memory segments and their attributes (readable, writable, executable) for runtime execution.
Below is a guide to feature gate activations, outlining the requirements and expectations for those holding the feature gate activation keypair.
Holding the keypair for a feature gate isn’t just “having the magic button.” It comes with both technical and process responsibilities, along with a tiny bit of ceremonial paranoia, to make sure the activation goes smoothly and safely.
Here’s what’s expected of you:
You’re expected to participate in the audit process for any change related to the gated feature.
| use core::{mem::MaybeUninit, ptr}; | |
| pub trait MerkleHash<const N: usize> { | |
| fn hash(bytes: &[u8]) -> [u8;N]; | |
| fn merkle_hashv(l: &[u8], r: &[u8], swap: bool) -> [u8;N]; | |
| } | |
| #[inline(always)] | |
| unsafe fn trunc32_to_n<const N: usize>(src32: *const u8) -> [u8; N] { |
| . . . . . . | |
| : - - - . . . . . . * * * * + + + | |
| - - - - : : : - - . . * * * * * + + | |
| . - - - - - - - : . . * * * * * + + | |
| . - - - - - - : : . . * * * * * * * | |
| . - - - - - : : : . . * * * * * * * | |
| . - - - - : : : : . . * * * * * * * . | |
| . - - - : : : : : . . * * * * * * * . | |
| : - - : : : : : : . . . . . . . * * * * * * * : . | |
| # - : : : : : : : # + + + + * * * . . & [ & [ & [ u 8 ] ] ] * * # # : |