Search code examples
rustblockchainsolana

Add simple line "Pubkey::new_unique()" breaks my Solana Program


does anyone know why introducing a simple line like "Pubkey::new_unique()" inside https://github.com/solana-labs/example-helloworld/blob/master/src/program-rust/src/lib.rs#L22 will make the program fail?


Solution

  • The implementation of that function uses global data. Programs cannot use global data