runtime: Move From<AddressLookupError>
from sdk
#141
Merged
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.
Problem
As part of the migration of the address-lookup-table program to BPF, we've had to also port over the conversion from
AddressLookupError
toAddressLoaderError
, but it's only needed in one place in the runtime.See solana-program/address-lookup-table#7 (comment) some more info
Summary of Changes
Move the error conversion function to where it's used in the runtime. The main motivation for moving it up rather than keeping it in the SDK is to avoid a circular dependency between
solana-program
and the new address-lookup-table BPF crate.Let me know if this works with your conception of address loaders. It does seem like structs implementing
AddressLoader
might want the error converter since they'll be using lookup tables, but I'm not sure of a better place to put it.Alternatively, we could create a
solana-message
crate which has all of thesdk/program/src/message
code, and re-export it insolana-sdk
. That crate could safely depend onsolana-program
and the new address-lookup-table crate.cc @buffalojoec
Fixes #