Repository navigation
Conversation
|
@askov is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
askov
force-pushed
the
fix/cu-profiling-precompile
branch
from
November 20, 2026 08:53
9aa3f13 to
137e7e6
Compare
askov
force-pushed
the
fix/cu-profiling-precompile
branch
from
November 20, 2026 14:53
37bcf4c to
95ce25a
Compare
askov
marked this pull request as ready for review
November 23, 2026 07:38
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryThe PR gives Logs, CU profiling, and Anchor events one rule for pairing logs with instructions.
Reviews (11) · Last reviewed commit: "fix(program-logs): skip every block of l..." · Reviewed by Greptile |
askov
force-pushed
the
fix/cu-profiling-precompile
branch
4 times, most recently
from
November 27, 2026 07:40
b74bbfa to
22e87e6
Compare
…tity The Logs card paired logs with instructions inline. `pairLogsWithInstructions` holds that rule, so another card can call it.
A precompile logs nothing, so pairing by index gave each later instruction the CU figure of the next one. An instruction with no figure showed the 200,000 CU reserve. The card now shows `Unknown` for it.
An export of `ProgramLogsCardBody` from the entity index adds `@coral-xyz/anchor` to every route that imports the index.
The Logs card, the CU card, the block page and Anchor events each read the log lines by their own rule. One parser returns a tree, one rule pairs it with the instructions, and one card shows it on the transaction page, the inspector and the IDL page. A ZK ElGamal Proof row takes its cost from the instruction data.
… run An instruction after the one that failed has no invocation in the logs, and it took the fixed cost of its program: 200,000 CU for a ZK ElGamal range proof. It shows Unknown. A precompile shows 0.
One transaction with no CU figure hides the column for the whole block. The parser does not read the transaction error, so a failed transaction with no logs had no figure. It counts as 0.
The sum of the logs left out the cost of each builtin, and a failed transaction with no logs counted as 0. The logged sum stays the source for a block with no recorded figure.
A row took the fixed cost of its program when the logs had no figure. That cost is false for an instruction that did not run, and for Stake or Address Lookup Table in truncated logs, because both programs log a figure since a feature gate moved them on chain. The costs of the two older loaders were also swapped.
…n card The link held the pathname and the cluster params only, so a click on the inspector dropped `message` and cleared the transaction. A fragment-only href keeps the query string.
… lint rules The rebase onto master added security/detect-object-injection, which reports an index read by a variable. Refreshes bench/BUILD.md for the new base.
askov
force-pushed
the
fix/cu-profiling-precompile
branch
from
November 27, 2026 07:46
22e87e6 to
792f9bb
Compare
… on chain Config is a builtin that a feature gate moved on chain, as Stake and Address Lookup Table are. A Config instruction from before the move logs no figure, so it takes the fixed cost of 450.
C0mberry
reviewed
Nov 27, 2026
The pairing skipped at most one block of lines with no `invoke` line. Two such blocks in a row left each later instruction with no invocation.
C0mberry
approved these changes
Nov 27, 2026
rogaldh
requested changes
Nov 27, 2026
| const ran = invocation !== undefined || execution === 'completed'; | ||
| if (!ran) return undefined; | ||
|
|
||
| return logsTruncated ? getNonMigratingBuiltinComputeUnits(programId) : getDefaultComputeUnits(programId, data); |
Collaborator
There was a problem hiding this comment.
nit: when the logs are truncated, a migrated builtin (ALT, Stake, Config) shows Unknown instead of its fixed cost. I think that we may not fix this. Let's just add an acknowledgement comment on the logsTruncated branch.
rogaldh
approved these changes
Nov 27, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the CU figure of each instruction on the CU profiling card, and replaces the log parser and the two Logs cards with one parser and one card. A transaction with a precompile instruction showed each later figure one row early, and an instruction with no CU figure in the logs showed
~200,000.Changes
parseProgramLogswith a parser that returns an invocation tree and accepts any lines without an error.pairLogsWithInstructions, so the Logs card, the CU profiling card and Anchor events pair logs with instructions by one rule.ProgramLogsCardBodyand the log list of the IDL page with oneProgramLogscard.useResolvedInstructionNames, so the card no longer decodes Anchor instructions itself.defaultUnitsandscheduledUnitsinInstructionCUDatawith onecomputeUnitsfield.formatInstructionLogstotoInstructionCUDataand removes its epoch argument, sosimulateTransactionno longer callsgetEpochInfo.Behavior Changes
0on the CU profiling card, and each later instruction shows its own figure.~200,000.Unknownotherwise, instead of~200,000.Not executed.Token Transfer Checkedinstead ofToken Instruction.Runtime error: …on the instruction that the transaction error names, also when a precompile instruction precedes it.Program logstab of the IDL page now shows logs with the same card as the inspector.CUs Consumedcolumn of the block page now shows the compute units that the transaction recorded, also when a transaction in the block has no logs.Type of change
app/entities/program-logsScreenshots
Testing
Bug fixes
CU profilingcard. Expect0on rows 1, 3, 5, 7 and 9, and42,835on row 2. Production shows42,835on row 1.Cause: production pairs logs with instructions by index, and a precompile instruction writes no logs.
CU profilingcard. Expect0on row 4 and176,292on row 5. Production shows176,292on row 4.Cause: the same pairing by index.
CU profilingcard. Expect6,400on row 2,16,400on row 4,200,000on row 6,3,300on rows 8, 9 and 10, and a full bar underTotal: 247,852 CU. The ten rows add up to the total. Production shows~200,000on those six rows.Cause: production shows the 200,000 CU reserve for an instruction with no CU figure in the logs.
Simulate, and click the title of row#1on theLogscard. Expect the page to scroll to instruction card#1, with the transaction and the simulation result still shown. Production dropsmessagefrom the URL and shows the empty inspector.Cause: production builds the link from the pathname and the cluster only.
CUs Consumedcolumn, with150on row 6. Production shows noCUs Consumedcolumn.Cause: production reads the figure from the logs and hides the column when a transaction has none, and ten transactions in the block have no logs.
Changed behavior
Logssection with the legend of theCU profilingcard. Expect each Logs row title to end with the instruction name of the same row in the legend, and the same log lines as production. Production showsInstructionin the title of a row whose program has no Anchor IDL.Regression checks
Upgraded programline under the BPF Upgradeable Loader row of theLogssection, as on production.Related Issues
Closes HOO-2022
Closes HOO-2481
Closes HOO-1515
Checklist
pnpm test,pnpm lint,pnpm typecheck)build:infoscript to update build informationAdditional Notes