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

Program Struct V2 #12

Open
amilz opened this issue Jan 14, 2023 · 0 comments
Open

Program Struct V2 #12

amilz opened this issue Jan 14, 2023 · 0 comments

Comments

@amilz
Copy link
Owner

amilz commented Jan 14, 2023

Issue

Program struct for burn accounts is:

pub struct BurnScore {
    pub burned_tokens: u64,
    pub pyro_key: Pubkey,
    pub num_burns: u64,
    pub user_name: String,
    pub mint: Pubkey
}

Unfortunately the way mmecp filters work, I can't filter on mint b/c it's after a variable byte-length string. So each program query looks up all accounts and then we filter for mint on front end. Fine now but won't scale if we get more users.

Proposed Solution

Create a new struct, e.g..:

pub struct BurnScore {
    pub acct_version: u8,
    pub mint: Pubkey,
    pub pyro_key: Pubkey,
    pub burned_tokens: u64,
    pub num_burns: u64,
    pub user_name: String,
}

Create a migration function.

Note: if we start to get higher volume of users before we implement a fix, we may want to useLocalStorage for our account query and store the results rather than calling it each page (only really an issue if somebody is navigating around multiple mints)

Resources:

amilz added a commit that referenced this issue Jan 14, 2023
known issue is a blocker for pushing this to production. will re-evaluate if we scale.
#12
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

1 participant