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

7810 spl token gating #7833

Merged
merged 9 commits into from
May 16, 2024
Merged

7810 spl token gating #7833

merged 9 commits into from
May 16, 2024

Conversation

ianrowan
Copy link
Contributor

@ianrowan ianrowan commented May 13, 2024

Link to Issue

Closes: #7833

Description of Changes

  • Adds solana balance fetching and batching to TokenBalanceCache
  • Enables creation of solana communities(UI/platform)
  • Adds UI updates to create Solana SPL requirements on Solana communities
  • Updates schemas and models to include spl balance requirement types

Test Plan

  • run migration and yarn

  • sign-in with Phantom Wallet

  • Make yourself admin of the solana community via DB

  • create requirements with the following sample tokens(note sol isnt prefiex with 0x's) using Solana Mainnet Beta

    • Dog wif hat: EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm
    • Jupiter: JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
    • USDC: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
  • got to the members tab and note that some addresses are included in each group filter

  • Set a high value for WIF(ie 1000000) and note that some should not be in group any more

  • Additionally test other chain groups(ie evm) to ensure these changes don't create issues/regressions

Deployment Plan

  1. Run migration
  2. Manually update private url to solana chainnode

Other Considerations

  • There are not as efficient of batching methods available for solana rpcs atm. I using promise.all on single balance requests is the only current option. This should be Ok for our scale at the current moment but we should monitor for updates to Alchemy rpc to allow for better batching. The current implementation batches with rate-limit in mint but may not be as generally performant as Evm batching

@ianrowan ianrowan linked an issue May 13, 2024 that may be closed by this pull request
@ianrowan ianrowan marked this pull request as ready for review May 14, 2024 16:13
Copy link
Contributor

@masvelio masvelio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Not sure if this is the issue for this PR but I am not able to sign in with phantom wallet. Getting error in the console when I click the button in our login modal.

Generally, front end looks good to me, but would like @mzparacha to take a look at that, as he worked on the groups more closely

@ianrowan ianrowan requested a review from timolegros May 15, 2024 15:59
@masvelio
Copy link
Contributor

just noticed that I created 2 solana communities but there are not visible on explore page
image

@ianrowan
Copy link
Contributor Author

ianrowan commented May 16, 2024

@masvelio I believe this is expected behavior(which I just learned) - the active community query that creates the community list only includes communities with > 10 addresses or with community stake enabled
get_active_communities.ts
image

@ianrowan ianrowan requested a review from masvelio May 16, 2024 14:42
@masvelio
Copy link
Contributor

@masvelio I believe this is expected behavior(which I just learned) - the active community query that creates the community list only includes communities with > 10 addresses or with community stake enabled get_active_communities.ts image

ooh got ya, thanks for clarification

@jnaviask jnaviask added deployment plan (PRs only) requires manual infrastructure changes on release labels May 16, 2024
Copy link
Contributor

@ForestMars ForestMars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

G2G

@ianrowan ianrowan requested a review from jnaviask May 16, 2024 20:19
@ianrowan ianrowan merged commit b33987c into master May 16, 2024
6 of 8 checks passed
@ianrowan ianrowan deleted the 7810-spl-token-gating branch May 16, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment plan (PRs only) requires manual infrastructure changes on release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SPL Token Gating
5 participants