Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token3: ensure the wrapped SOL mint is owned by the token program #374

Closed
mvines opened this issue Sep 1, 2020 · 4 comments
Closed

token3: ensure the wrapped SOL mint is owned by the token program #374

mvines opened this issue Sep 1, 2020 · 4 comments
Assignees
Milestone

Comments

@mvines
Copy link
Member

mvines commented Sep 1, 2020

The native mint for token 2:

solana_sdk::declare_id!("So11111111111111111111111111111111111111112");

has a bug in that it's an account that is not owned by the token program, and doesn't have account data that looks like every other mint account.

This requires special case handling within the token program itself and any user of SPL Token that wants to support wrapped SOL.

Instead we should make wrapped SOL mint look like any other mint account to avoid special casing (which is exactly the reason why wrapped SOL exists).

The supply for the native mint would represent the current amount of Wrapped SOL (instead of the total native SOL supply)

@mvines mvines added this to the Token 3 milestone Sep 1, 2020
@mvines mvines changed the title token3: ensure the wrapped SOL mint is owned by the token program token: ensure the wrapped SOL mint is owned by the token program Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
@mvines mvines changed the title token: ensure the wrapped SOL mint is owned by the token program token3: ensure the wrapped SOL mint is owned by the token program Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mvines added a commit to mvines/solana that referenced this issue Sep 1, 2020
mergify bot pushed a commit to solana-labs/solana that referenced this issue Sep 1, 2020
mergify bot pushed a commit to solana-labs/solana that referenced this issue Sep 1, 2020
…oken 2 program.

Workaround for solana-labs/solana-program-library#374 until spl-token 3 is shipped

(cherry picked from commit 7341e60)

# Conflicts:
#	core/src/rpc_service.rs
#	runtime/src/bank.rs
mergify bot pushed a commit to solana-labs/solana that referenced this issue Sep 1, 2020
…oken 2 program.

Workaround for solana-labs/solana-program-library#374 until spl-token 3 is shipped

(cherry picked from commit 7341e60)
mvines added a commit to solana-labs/solana that referenced this issue Sep 1, 2020
…oken 2 program.

Workaround for solana-labs/solana-program-library#374 until spl-token 3 is shipped

(cherry picked from commit 7341e60)
mvines added a commit to solana-labs/solana that referenced this issue Sep 1, 2020
…oken 2 program.

Workaround for solana-labs/solana-program-library#374 until spl-token 3 is shipped

(cherry picked from commit 7341e60)
mergify bot added a commit to solana-labs/solana that referenced this issue Sep 1, 2020
…oken 2 program. (#11974)

Workaround for solana-labs/solana-program-library#374 until spl-token 3 is shipped

(cherry picked from commit 7341e60)

Co-authored-by: Michael Vines <[email protected]>
mvines added a commit to solana-labs/solana that referenced this issue Sep 1, 2020
…oken 2 program.

Workaround for solana-labs/solana-program-library#374 until spl-token 3 is shipped

(cherry picked from commit 7341e60)
mergify bot added a commit to solana-labs/solana that referenced this issue Sep 1, 2020
…oken 2 program. (#11973)

Workaround for solana-labs/solana-program-library#374 until spl-token 3 is shipped

(cherry picked from commit 7341e60)

Co-authored-by: Michael Vines <[email protected]>
@mvines
Copy link
Member Author

mvines commented Sep 19, 2020

This will require RELEASE.md updates to describe how to create the native mint whenever a new version of SPL Token is deployed

@mvines
Copy link
Member Author

mvines commented Jan 29, 2021

This is probably now obsolete since we made this so via a bank.rs change

@t-nelson
Copy link
Contributor

It kinda sucks that this requires core support though 😕

The alternatives kinda suck also. I've been thinking on it

@mvines
Copy link
Member Author

mvines commented Jan 29, 2021

I'm sold on keeping the special case for SPL Token. It's weird and we wouldn't do it if we could rewind back six months, but it works and is in prod

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

No branches or pull requests

3 participants