One could argue that address doesn't need to be there. When you go to compile the message, the address gets dropped in favour of its index in the LUT.
The reason that address is there is so that the compiler can do some extra tricks:
if the message already requires one of the addresses in the lookup table to be among the static addresses (eg. because it must sign) then omit the LUT entry (code)
roll all lookups into the LUT whose address has the lowest rank, until you can drop a LUT completely (code)
Problem
The problem is that the presence of this property implies that in order to decompileMessage() a message with LUTs, you need to know the addresses so that the decompiler can rehydrate the TransactionMessage.
There are some use cases for which knowing the addresses is not important though. You might want to decompile a transaction to look at something other than the account addresses. You might also just like to add an instruction and recompile it. Knowing the LUT addresses is not a prerequisite for this; you can recompile the message just fine without knowing them.
Summary
This issue considers the possibility of relaxing this type by making address optional. Alternatively we could add a type to this union like IAccountIndeterminateLookupMeta that has the indexes but not the `address.
Actually, this idea might be dead on arrival. The addresses themselves are used for deduplication – ie. to prevent the same address from showing up in the accounts list and among one of the looked-up-addresses.
Background
Consider this type:
https://github.com/solana-labs/solana-web3.js/blob/a97c34b61532157d914ca975d5c90fdd5e12468c/packages/instructions/src/accounts.ts#L21-L26
One could argue that
address
doesn't need to be there. When you go to compile the message, the address gets dropped in favour of its index in the LUT.The reason that
address
is there is so that the compiler can do some extra tricks:Problem
The problem is that the presence of this property implies that in order to
decompileMessage()
a message with LUTs, you need to know the addresses so that the decompiler can rehydrate theTransactionMessage
.There are some use cases for which knowing the addresses is not important though. You might want to decompile a transaction to look at something other than the account addresses. You might also just like to add an instruction and recompile it. Knowing the LUT addresses is not a prerequisite for this; you can recompile the message just fine without knowing them.
Summary
This issue considers the possibility of relaxing this type by making
address
optional. Alternatively we could add a type to this union likeIAccountIndeterminateLookupMeta
that has the indexes but not the `address.