Allow non-UTF-8 bytes in Address::create_with_seed #378
Replies: 3 comments
-
|
based tbh, and nothing would break. |
Beta Was this translation helpful? Give feedback.
-
|
SIMD here #390 |
Beta Was this translation helpful? Give feedback.
-
|
so to elaborate an alternative route, as teased in https://x.com/trentdotsol/status/1983729288429105237 imagine a wrapper instruction whose sole purpose it is to perform the
accidentally burnt some tokens by assigning a we can relax the seed constraints to instruction probably looks something like... // Accounts
// 0. WithSeed base 0
// ...
// B. WithSeed base N. B = self.with_seed_args.len() - 1
// B+1. self.instructions[0] account 0
// B+1+X. self.instructions[0] account N. X = self.instructions[0].num_accounts - 1
// ...
InvokeSignedWithSeed {
with_seed_args: [
{
base: Option<Address>,
seed: [u8; 32],
},
...
],
instructions: [
{
num_accounts: usize,
data: [u8],
},
...
],
}so first save additional CUs by reusing WithSeed sigverify results |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Rehashing what I wrote in this draft PR that shows what would change in solana-sdk:
The
with_seedfunctions (egAddress::create_with_seed) andWithSeedinstruction variants (egSystemInstruction::CreateAccountWithSeed) all expect&strorString. But they don't do anything that requires UTF-8, and they just convert these values back to bytes.Two reasons this is bad:
Address) as a seed. Not being able to do this causes people to do inefficient things to comply with UTF-8.In Agave there would be some small changes to system_processor.rs and vote_processor.rs. Firedancer would need to remove its UTF-8 validation in the relevant places.
Beta Was this translation helpful? Give feedback.
All reactions