Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kevinheavey
Copy link
Contributor

The with_seed functions (eg Address::create_with_seed) and WithSeed instruction variants (eg SystemInstruction::CreateAccountWithSeed) all expect &str or String. But they don't do anything that requires UTF-8, and they just convert these values back to bytes.

Two reasons this is bad:

  1. Bincode wastes time on UTF-8 validation
  2. It would be nice to use arbitrary bytes (such as an Address) as a seed

Breaking changes:

  • Address::create_with_seed is technically a breaking change. Changing the type to &(impl AsRef<[u8]> + ?Sized), means it works as before for most people, but breaks for anyone passing create_with_seed itself to a function that expected the seed param to be &str. It's possible that nobody is doing this.
  • system-interface, vote-interface and the wasm helpers just change to &[u8] or Vec<u8>

In Agave there would be some small changes to system_processor.rs and vote_processor.rs. Firedancer would need to remove the UTF-8 check. Does this need a SIMD?

@t-nelson
Copy link
Contributor

t-nelson commented Oct 9, 2025

i don't think there is any rationale for enforcing utf8 here

Does this need a SIMD?

yes. during adoption of the change, upgraded vs not nodes would have differing execution results for non-utf8 inputs

@kevinheavey
Copy link
Contributor Author

kevinheavey commented Oct 11, 2025

Pre-SIMD discussion here solana-foundation/solana-improvement-documents#378

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