Skip to content

p-ata: remove bump hints#237

Draft
grod220 wants to merge 1 commit into
mainfrom
hint-removal
Draft

p-ata: remove bump hints#237
grod220 wants to merge 1 commit into
mainfrom
hint-removal

Conversation

@grod220
Copy link
Copy Markdown
Member

@grod220 grod220 commented Apr 13, 2026

This PR removes the bump hints from the test harness. The intent is to remove plumbing for a feature that (if approved) we will not use.

Background

#102 explored a number of ATA optimizations, one of which included bump hints.

The idea was if the client already knows the bump, the program could avoid recomputing it. But, it only helps if the program is willing to trust the supplied bump. In practice, the program still needs to validate the input and verify there is not better valid bump above the hinted one. Doing the computation for that verification removes the expected CU savings.

Local Bench Work

Re-implemented the bump hint work from the reference PR and got these results:

Scenario main branch (no hint) branch (with hint) no hint vs main with hint vs main
create (spl-token) 3222 3258 3248 +36 +26
create (token-2022) 5266 5301 5291 +35 +25
create_idempotent (new, spl-token) 4317 4351 4357 +34 +40
create_idempotent (new, token-2022) 5637 5671 5667 +34 +30
create (prefunded, spl-token) 3222 3258 3248 +36 +26
create (prefunded, token-2022) 5266 5301 5291 +35 +25

Across the board, the CUs increased. Also, It was a feature that had a decent amount of complexity. In short, the results don't justify it.

/// The standard `Create` instruction, which can optionally include a bump seed and account length.
Create {
bump: Option<u8>,
account_len: Option<u16>,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removing account_len too for now. Going to revisit later after we've done the token-2022 known extension len optimization.

@grod220 grod220 mentioned this pull request Apr 13, 2026
36 tasks
@grod220 grod220 requested review from febo and joncinque April 13, 2026 14:52
@joncinque
Copy link
Copy Markdown
Contributor

Doing the computation for that verification removes the expected CU savings.

I don't think this is the case -- we save 1 is_on_curve check with the bump hint, which isn't nothing!

The idea is that the program is provided a hint, and we make sure that everything above that hint isn't a valid PDA. After that, we trust the runtime to make sure that the PDA is valid during creation with the provided bump.

On the flipside, a curve point check costs 159 CUs, so maybe the savings aren't worth the complexity.

I don't dislike the feature though, so I would lean towards keeping it.

@grod220
Copy link
Copy Markdown
Member Author

grod220 commented Apr 13, 2026

I don't think this is the case -- we save 1 is_on_curve check with the bump hint, which isn't nothing!

A bug in my local implementation! Need to fix and get the real benchmarks. Moving to draft.

@grod220 grod220 removed request for febo and joncinque April 13, 2026 18:27
@grod220 grod220 marked this pull request as draft April 13, 2026 18:27
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