## Program Deployments

Program deployments are done by invoking the BPF Loader program.

This is a special builtin program that allows the program to access additional computational resources like verifying the program that is being deployed.

To deploy a program you use the `solana` CLI:

```
solana program deploy .
```

When you run this, the CLI is going to send a set of transactions.

First, it allocates a buffer account where it writes the program's ELF file. These can be quite large, so it happens over several transactions that chunk it in.

Once this process finishes, a final `deploy` instruction is given which will verify the ELF stored in the buffer account. Then it moves the ELF into a real program account and marks it as executable.

This verification is handled by:

1. Loading the program as an eBPF executable with a strict runtime environment
2. Verify the loaded executor (usually `rBPF`) against the ISA.
3. Reload the program with the current runtime environment

This is all done so we can get a nice `executable` boolean on programs, discarding the invalid ones, which allows the runtime not to have to recheck whether the program is valid or not.
