Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Make PublicKey.createWithSeed (js) same as create_with_seed in runtime to avoid confusion #999

Closed
mcf-rocks opened this issue Nov 11, 2020 · 8 comments · Fixed by #1563
Closed
Labels
1.x Pertains to the v1.x line on the maintenance/v1.x branch

Comments

@mcf-rocks
Copy link

mcf-rocks commented Nov 11, 2020

SystemProgram CreateAccountWithSeed instruction was failing sometimes, because seed too long.

Here ./sdk/src/pubkey.rs which is used here ./runtime/src/system_instruction_processor.rs

Javascript func doesn't care about seed length https://solana-labs.github.io/solana-web3.js/file/src/publickey.js.html#lineNumber82

So you think it's good, but then the runtime does nothing (nothing reported in logs either)

Suggest: make js function same as runtime, with error if seed too long.

@steveluscher steveluscher added the good first issue Good for newcomers label Feb 1, 2023
@Lioncat2002
Copy link

I would like to work on this
Unless someone is already working on this?

@buffalojoec buffalojoec removed the good first issue Good for newcomers label Aug 23, 2023
@buffalojoec
Copy link
Contributor

As per @steveluscher's comments on the linked PR #1286 I think this is going to have to get solved in the new API, which will be laced into the existing API under the hood, effectively solving this problem upon incremental release.

It's possible we can either close this and create a new issue for the new API

@Lioncat2002
Copy link

Ah
I had been a little confused since it seemed to link to another issue.
But thanks for answering!

@Lioncat2002
Copy link

Is there any other issues that I can try my hands on? 👀

@buffalojoec
Copy link
Contributor

Is there any other issues that I can try my hands on? 👀

There should be a few in the issues that are geared towards the new API you might want to take a stab at!

Check out the somewhat recent ones

@Lioncat2002
Copy link

Is there any other issues that I can try my hands on? 👀

There should be a few in the issues that are geared towards the new API you might want to take a stab at!

Check out the somewhat recent ones

Ahhh thanks!
I will have a look

@steveluscher steveluscher added the 1.x Pertains to the v1.x line on the maintenance/v1.x branch label Aug 1, 2024
@steveluscher
Copy link
Contributor

This is now createAddressWithSeed() in @solana/web3.js 2.0, and seed length is enforced there.

if (seedBytes.byteLength > MAX_SEED_LENGTH) {
throw new SolanaError(SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED, {
actual: seedBytes.byteLength,
index: 0,
maxSeedLength: MAX_SEED_LENGTH,
});
}

Copy link
Contributor

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.x Pertains to the v1.x line on the maintenance/v1.x branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants