add BPF version of address lookup table #3
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the BPF version of the Address Lookup Table program.
For now, I felt like this was a good place to kill two birds with one stone:
Address Lookup Table (BPF)
This BPF implementation essentially replaces the following crates in
github.com:solana-labs/solana/programs
:address-lookup-table
address-lookup-table-tests
Biggest changes for BPF migration:
Errors
Errors are now inside of the program crate, not
solana_sdk
.This was necessary for the following reasons:
bincode::serialize(..)
does not return an error that maps to aProgramError
InstructionError
variants that do not have aProgramError
counterpart, such asInstructionError::Immutable
We should discuss whether or not to remove the original errors from the SDK and lean on the newly defined ones, or add the new ones necessary to the existing SDK module. Regardless, they will need to be modified to be able to map to
ProgramError
.PACKET_DATA_SIZE
andlimited_deserialize(..)
In this implementation, I added a temporary hack for
limited_deserialize
until we decide if and how to update the SDK.We can decide to export this if we want, if other programs also need it and it's useful to on-chain program developers.