Skip to content

fix(compute-unit): reserve the default CUs for Stake, Config and ALT - #1517

Open
Iamsohungrynow wants to merge 2 commits into
solana-foundation:masterfrom
Iamsohungrynow:fix/core-bpf-builtins-cu
Open

Iamsohungrynow wants to merge 2 commits into
solana-foundation:masterfrom
Iamsohungrynow:fix/core-bpf-builtins-cu

Conversation

@Iamsohungrynow

@Iamsohungrynow Iamsohungrynow commented Nov 26, 2026 •

Copy link
Copy Markdown

Description

Stake, Config and ALT run as Core BPF programs now, so the runtime reserves the default 200k for them, but they were still in the 3k builtin list. a plain delegate tx (5PjwEDEdNSLv7uYTe3cjoyRcqDA7PGVnGXq1LoH1LDEy17ymV4ePvPfZy3Gz8CLnS3LiPdyu9LhAUQUqkY45NRgf) logs consumed 16053 of 200000 and the tx page shows 16,053 / 3,000. same fix #1076 did for Vote

Type of change

  • Bug fix
  • New feature
  • Protocol integration
  • Documentation update
  • Other (please describe):

Screenshots

N/A, the CU limit for that tx goes from 3,000 to 200,000

Testing

12 new cases in compute-units-schedule.spec.ts (the 3 programs now, ALT and Stake before and at their migration epoch on each cluster, Config at 759, a Stake tx without a compute budget, and the real parsed 5PjwEDEd instruction) fail on master and pass after, 37/37. eslint, prettier and tsc --noEmit clean

Related Issues

N/A

Checklist

  • My code follows the project's style guidelines
  • I have added tests that prove my fix/feature works
  • All checks pass locally (pnpm test, pnpm lint, pnpm typecheck)
  • I have updated documentation as needed
  • I have run build:info script to update build information
  • CI/CD checks pass on the PR
  • Screenshots included — required for protocol screens, recommended for other UI changes
  • For security-related features, I have included links to related information

Additional Notes

alt and stake keep 3k until their core bpf migration epochs (from feature-gates.json), config was already core bpf on every cluster when the 3k feature activated

@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

@Iamsohungrynow is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Updates compute-unit estimates for Stake, Config, and Address Lookup Table programs.

  • Migrated programs get the default compute-unit reserve.

Reviews (2) · Last reviewed commit: "fix(compute-unit): use the migration epo..." · Reviewed by Greptile

*/
const BUILTIN_PROGRAMS_3K: readonly string[] = [
'11111111111111111111111111111111', // System Program
'Stake11111111111111111111111111111111111111', // Stake Program

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question/issue: Removing Stake and ALT from BUILTIN_PROGRAMS_3K changes the reserve for every epoch, so transactions from before each migration show 200,000 where master shows the correct 3,000. I think it's an issue and we should take epoch into account. What do you think @Woody4618 ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ahh good point, i added an entry for each migration, so alt keeps 3k until epoch 762 and stake until 823 on mainnet (devnet 849/917, testnet 756/813). config was already core bpf before the 3k change on every cluster, now it stays out of the list

This branch has not been deployed

No deployments
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.

2 participants