Skip to content

SIMD-0568: Deprecate Precompiles - #568

Open
Lichtso wants to merge 5 commits into
solana-foundation:mainfrom
Lichtso:deprecate-precompiles
Open

SIMD-0568: Deprecate Precompiles#568
Lichtso wants to merge 5 commits into
solana-foundation:mainfrom
Lichtso:deprecate-precompiles

Conversation

@Lichtso

@Lichtso Lichtso commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

In a discussion on Discord 1 consensus was reached to proceed with option
4 "Drop protocol-owned verifiers entirely and let normal programs handle this".

Footnotes

  1. https://discord.com/channels/428295358100013066/1164657208613683280/1516459607726358672

@simd-bot

simd-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

Hello Lichtso! Welcome to the SIMD process. By opening this PR you are affirming that your SIMD has been thoroughly discussed and vetted in the SIMD discussion section. The SIMD PR section should only be used to submit a final technical specification for review. If your design / idea still needs discussion, please close this PR and create a new discussion here.

This PR requires the following approvals before it can be merged:

Once all requirements are met, you can merge this PR by commenting /merge.

@Lichtso Lichtso changed the title Deprecate Precompiles SIMD-0568: Deprecate Precompiles Jun 17, 2026
@Lichtso
Lichtso force-pushed the deprecate-precompiles branch from a89775d to 97b66e7 Compare June 17, 2026 20:45
Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment on lines +77 to +82
## Impact

The community will have to develop their own on-chain replacements.
However, this is also an opportunity as solutions using crypto syscalls can be
cheaper compared to the lamports charged for signature verification at the
transaction level.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this SIMD should do the community a service and describe how the three verification methods can be completely replaced by on-chain syscalls. It should be self-evident in the proposal that alternatives are available, working, and reasonable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, question is just what level of detail is appropriate here:

  • only mention the specific syscalls
  • provide some pseudo code
  • link actual reference implementations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO just list the syscalls they can use to perform the same signature verification as the precompiles. That's probably enough.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We just also need to make sure they actually are available, working, and reasonable (CUs) 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All good here once we get secp256r1 curve ops syscalls imo.

Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment on lines +33 to +35
After the activation of the feature gate every instruction attempting to invoke
any of the following programs must fail with
`InstructionError::UnsupportedProgramId`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason why we're doing all three in one feature gate? I suppose it doesn't really matter much, but curious what the rationale is.

@Lichtso Lichtso Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We already are hitting feature gate activation queue capacity with our policy of one activation per epoch. Also, these three are related, it makes sense to disable them simultaneously.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the best rationale is that we can deprecate all 3 from fee calculation at the same time which is much less invasive than changing it 3 times.

Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment on lines +36 to +43
After the activation of the feature gate:

The three program accounts will continue to exist and be owned by the native
loader (`NativeLoader1111111111111111111111111111111`) thus they will continue
to count as programs during transaction loading and only be filtered out during
instruction execution.
- Every transaction invoking them with top-level instructions must
throw `TransactionError::InvalidProgramForExecution` during transaction
loading time.
- Every instruction invoking them with in CPI must
throw `InstructionError::UnsupportedProgramId` instead of
`CpiError::ProgramNotSupported` as they currently do.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One more bullet for "these will no longer be reserved account keys"?
#568 (comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need to say what error will occur when invoking them? Why not simply say we're unloading the programs and let the VM respond with its normal behavior?

@Lichtso Lichtso Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TransactionError::InvalidProgramForExecution happens as a natural consequence of deleting the accounts, yes. Mentioning it here explicitly makes it easier to write conformance tests, that is all.

The transition from CpiError::ProgramNotSupported to InstructionError::UnsupportedProgramId in CPI (to bring it in line with other non existing programs) is an actual change in the code because right now precompiles get special handling in CPI.

@deanmlittle deanmlittle Jun 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right, my point is, we are not implementing anything to create this error message, we are simply removing the implementation of CpiError, resulting in the default error message for a non-existent program. That's why I don't think it makes sense to write it here, as it sounds like we're adding some functionality to cause this error message to appear instead of the existing one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You at least want to call out the TransactionError, since it will be a load-error and thus a fees-only transaction, which is protocol. However, I agree, the instruction error code specifically doesn't need to be enshrined, and could just get detailed under the conformance/fixtures section towards the end of the newer template.

@deanmlittle deanmlittle Jun 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The SIMD is to document what changes must be made to the protocol. If unloading the program results in the default VM/Runtime error behavior for a program that doesn't exist, we are not making it do that, we are removing the condition that causes it to not do that today. Making statements like: "Invoking these programs must return such and such error", it implies we're adding some kind of behavior to make this the case, which is the exact opposite of what we're doing here. I think if you want to explicitly mention what would happen when invoking these programs after they're removed, you can throw that into the backwards compatibility section.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will move it to the "Conformance" section as it is mostly relevant to testing.

Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment thread proposals/0568-deprecate-precompiles.md Outdated
## Motivation

Precompiles are rigid, require special handling in validator implementations
and their cross instruction referencing (in ed25519) is hacky.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All 3 precompiles do cross-instruction referencing.

Suggested change
and their cross instruction referencing (in ed25519) is hacky.
and their inter-instruction data referencing is hacky.

Comment thread proposals/0568-deprecate-precompiles.md Outdated

### Migrating them to core programs on-chain

The ed25519 one requires top-level instruction introspection, which is not

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above, all 3 do this, not just Ed25519.

Comment thread proposals/0568-deprecate-precompiles.md Outdated
of the three precompiles before and after the feature activation, at top level
and in CPI.

The excpected results **before** the feature activation are:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
The excpected results **before** the feature activation are:
The expected results **before** the feature activation are:

Comment thread proposals/0568-deprecate-precompiles.md Outdated
Comment on lines +113 to +125
The change will be tested by twelve transactions, each transaction calling one
of the three precompiles before and after the feature activation, at top level
and in CPI.

The excpected results **before** the feature activation are:

- at top level: success
- in CPI: `CpiError::ProgramNotSupported`

The excpected results **after** the feature activation are:

- at top level: `TransactionError::InvalidProgramForExecution`
- in CPI: `InstructionError::UnsupportedProgramId`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am assuming by 12 transactions, you meant 3x:

  1. Invoke pre-activation
  2. CPI pre-activation
  3. Invoke post-activation
  4. CPI post-activation

I think you should be explicit about how you're invoking it, as different inputs could lead to a result other than the one you have written here. I would suggest to instead be explicit that we will:

  1. Invoke with valid signature pre-activation
  2. Invoke with invalid signature pre-activation
  3. CPI with valid signature pre-activation
  4. Invoke with valid signature post-activation
  5. Invoke with invalid signature post-activation
  6. CPI with valid signature post-activation

@simd-bot

simd-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

Hey @Lichtso, this PR has been inactive for 60 days and is now marked as stale.

If you're still working on this, please comment below to let us know. Otherwise, this PR will be automatically closed in 7 days.

To keep this PR active, simply leave a comment explaining the current status or any blockers you're facing.

@simd-bot simd-bot Bot added the stale Inactive PR - will be closed if no response label Aug 24, 2026
@Lichtso

Lichtso commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@deanmlittle I think I addressed everything, can you give it another review?

@simd-bot simd-bot Bot removed the stale Inactive PR - will be closed if no response label Aug 28, 2026
@simd-bot

simd-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

Thanks for the update, @Lichtso! The stale label has been removed. This PR will no longer be automatically closed.

@Lichtso
Lichtso requested a review from deanmlittle August 28, 2026 18:39
The expected results **after** the feature activation are:

- at top level with a valid signature:
`TransactionError::InvalidProgramForExecution`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this correct? seems odd that the error would change based upon program inputs for an invalid program


### Migrating them to core programs on-chain

Precompiles can use top-level instruction introspection, which is not available

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found the wording here a little confusing as it feels like it conflates instrospection from the instructions sysvar account and how it actually accesses it from the TransactionContext. Consider making this clear by saying something like:

"As they are built into the runtime, precompiles have the ability to access instruction data from other instructions from TransactionContext without having to use the SysvarInstructions account. Replicating this in a Core BPF program requires breaking changes, either to the API, or by adding this functionality to the SVM."

@deanmlittle

Copy link
Copy Markdown
Contributor

@deanmlittle I think I addressed everything, can you give it another review?

Sure. Just a few nits. Looks pretty good overall!

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.

3 participants