Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Relax authority signer check for lookup table creation #27248

Merged
merged 4 commits into from
Aug 22, 2022

Conversation

jstarry
Copy link
Contributor

@jstarry jstarry commented Aug 19, 2022

Problem

Since lookup tables are derived from a recent slot, it's difficult to time a transaction that creates an address lookup table account controlled by a multisig or governance program. This is due to the create lookup table instruction requiring the authority to be a signer.

Summary of Changes

  • Allow address lookup tables to be created for an authority without requiring the signer to sign
  • Make lookup table creation idempotent so that lookup table creation can't be failed from front-running

Feature Gate Issue: #27205

@jstarry jstarry added the feature-gate Pull Request adds or modifies a runtime feature gate label Aug 19, 2022
@jstarry jstarry requested a review from joncinque August 19, 2022 13:15
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The program logic looks good, just a few questions on the client-side bits to facilitate deprecation

Comment on lines +76 to +82
.arg(
Arg::with_name("authority_signer")
.long("authority-signer")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To facilitate the migration process away from signing these, do you want to have this flag hidden and print a message saying it's deprecated as of 1.12 if it's used? Or do you plan to do that once the feature is enabled on all clusters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually ok to use this option after the feature is activated. The bigger issue is if folks try using --authority before the feature is activated so I added a warning to that option. We can add authority-signer as an alias to authority once the feature is activated everywhere

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok great, aliasing later makes sense to me

@@ -84,6 +84,7 @@ pub fn create_lookup_table(
authority_address: Pubkey,
payer_address: Pubkey,
recent_slot: Slot,
authority_is_signer: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to remove this argument once the feature is enabled on all clusters? If so, it'll be easier for clients on the transition if there are two functions, one that declares the authority as a signer, and one that doesn't. You could have the existing create_lookup_table_signed require the signature, mark it as deprecated, and also have create_lookup_table which doesn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, added

@jstarry jstarry force-pushed the lut/create-idempotent branch from 7bf2a2d to 5a5a1e6 Compare August 22, 2022 08:56
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jstarry jstarry merged commit b79abb4 into solana-labs:master Aug 22, 2022
@jstarry jstarry deleted the lut/create-idempotent branch August 22, 2022 22:39
xiangzhu70 pushed a commit to xiangzhu70/solana that referenced this pull request Aug 23, 2022
…7248)

* Relax authority signer check for lookup table creation

* cli: support creating lookup tables without authority signer

* add another create lookup table ix function

* improve help message
kirksgithub added a commit to kirksgithub/solana-web3.js that referenced this pull request Oct 14, 2023
@kirksgithub
Copy link

kirksgithub commented Oct 14, 2023

Has this functionality been pushed to Web3, from what I see the authority is still required using Web3 but I may be wrong Github - Solana Web3

@CriesofCarrots
Copy link
Contributor

Has this functionality been pushed to Web3, from what I see the authority is still required using Web3 but I may be wrong Github - Solana Web3

If you have an issue with solana-web3.js, please open it there

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-gate Pull Request adds or modifies a runtime feature gate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants