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

estimate and set CU budget and priortiy fee #44

Merged
merged 11 commits into from
Apr 1, 2024
Merged

Conversation

nonergodic
Copy link
Contributor

@nonergodic nonergodic commented Mar 26, 2024

  • dynamically sets compute budget based on
    • whether the ATA already exists
    • what the ATA and recipt PDA bumps are
    • what ecosystem is being claimed for
  • the cu costs are based on a model and some parameters were established empirically
    • claim_sdk/cu_estimate.ts.txt contains the data/calculations that were used to fit the model/parameters
  • also sets the priority fee (somewhat arbitrarily) to 1 lamport (i.e. 1 million micro lamports)
  • now generates the ATA in a standalone instruction (rather than relying on Anchor's init_if_needed which is less cu efficient)

@nonergodic nonergodic requested a review from nik-suri March 26, 2024 09:22
Copy link

cloudflare-workers-and-pages bot commented Mar 26, 2024

Deploying example-grant-program with  Cloudflare Pages  Cloudflare Pages

Latest commit: a4bf741
Status: ✅  Deploy successful!
Preview URL: https://4fbbc624.da02926816b3ed667ca0bac0bdca27102783e4a491d9fbeef750151b19.pages.dev
Branch Preview URL: https://calc-compute-budget.da02926816b3ed667ca0bac0bdca27102783e4a491d9fbeef750151b19.pages.dev

View logs

@nonergodic nonergodic changed the title first stab at better CU cost calculation estimate and set CU budget and priortiy fee Mar 31, 2024
@nonergodic nonergodic force-pushed the calc-compute-budget branch from 48d2b21 to 601bafb Compare March 31, 2024 22:31
@nonergodic nonergodic marked this pull request as ready for review March 31, 2024 22:31
@nonergodic nonergodic requested a review from chase-45 March 31, 2024 22:49
solanoepalacio
solanoepalacio previously approved these changes Apr 1, 2024
@M-Picco M-Picco force-pushed the calc-compute-budget branch from fc3cc96 to 34eb000 Compare April 1, 2024 21:36
@M-Picco M-Picco force-pushed the calc-compute-budget branch from 34eb000 to a4bf741 Compare April 1, 2024 21:38
@nonergodic nonergodic merged commit b47300b into main Apr 1, 2024
4 checks passed
@abhidtu2014 abhidtu2014 deleted the calc-compute-budget branch April 2, 2024 03:57
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

Successfully merging this pull request may close these issues.

5 participants