Skip to content

Commit

Permalink
remove implementation-specific bits
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Nov 10, 2023
1 parent b6646ea commit aa16c8d
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions proposals/enable-core-bpf-programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,33 +115,9 @@ This process must adhere to the following steps:
An additional optional field could be added to feature gate issues for the
**target program** being upgraded.

The necessary code to perform a feature-gated core program upgrade shall be
entirely contained within a single function, stemming from a helper module used
by the bank.

This function shall:

- Be specific to only replacing **non-upgradeable** BPF programs with
**non-upgradeable** BPF programs
- Ensure maximally safe usage in feature gates
- Including, but not limited to, guarding against mistaken parameters
- Have extensive test coverage within the runtime source code


Here is an example of such a function:

```rust
enum TargetProgram {
System,
Stake,
Vote,
/* ... */
}

fn upgrade_core_program(target_program: TargetProgram, source: Pubkey) {
/* replacement logic */
}
```
A hard-coded list of all supported core BPF programs should be used to conduct
all migrations or upgrades with the above outlined process. This provides an
additional for explicitly denoting which program is the target.

Migrating a native program to a core BPF program shall use much of the same
functionality described above, with added checks specific to native programs,
Expand Down

0 comments on commit aa16c8d

Please sign in to comment.