p-ata: remove bump hints#237
Conversation
| /// The standard `Create` instruction, which can optionally include a bump seed and account length. | ||
| Create { | ||
| bump: Option<u8>, | ||
| account_len: Option<u16>, |
There was a problem hiding this comment.
Removing account_len too for now. Going to revisit later after we've done the token-2022 known extension len optimization.
I don't think this is the case -- we save 1 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. |
A bug in my local implementation! Need to fix and get the real benchmarks. Moving to draft. |
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:
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.