Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't extract invoked keys from a message when using a lookup table #25065

Merged
merged 2 commits into from
May 13, 2022

Conversation

jstarry
Copy link
Member

@jstarry jstarry commented May 7, 2022

Problem

Once the feature for #25034 is activated, program ids will no longer be allowed to be loaded from a lookup table. However, the client message building api still extracts program ids using lookup tables.

Summary of Changes

  • Refactor CompiledKeys to allow for filtering out invoked keys
  • Prevent invoked keys from being extracted by lookup tables

Fixes #

@jstarry jstarry force-pushed the lut/prohibit-dynamic-program-ids branch from bf8ffff to 361f461 Compare May 7, 2022 09:55
@jstarry jstarry requested a review from t-nelson May 7, 2022 09:59
@jstarry jstarry force-pushed the lut/prohibit-dynamic-program-ids branch from 361f461 to 7f3680b Compare May 7, 2022 10:36
@codecov
Copy link

codecov bot commented May 7, 2022

Codecov Report

Merging #25065 (7f3680b) into master (69a0ff9) will increase coverage by 0.0%.
The diff coverage is 89.8%.

@@           Coverage Diff            @@
##           master   #25065    +/-   ##
========================================
  Coverage    82.0%    82.0%            
========================================
  Files         598      598            
  Lines      165882   166224   +342     
========================================
+ Hits       136125   136463   +338     
- Misses      29757    29761     +4     

@jstarry jstarry requested a review from joncinque May 11, 2022 04:07
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!

Comment on lines +189 to +195
bitflags! {
pub struct KeyFlags: u8 {
const SIGNER = 0b00000001;
const WRITABLE = 0b00000010;
const INVOKED = 0b00000100;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Very slick, too bad it's only for testing!

Copy link
Member Author

Choose a reason for hiding this comment

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

Haha, I did try to incorporate it into the compilation code but booleans proved to be easier to work with. Happy I was able to work them in somehow though :)

@jstarry jstarry changed the title Prohibit invoked keys from being extracted by lookup table Don't extract invoked keys from a message when using a lookup table May 13, 2022
@jstarry jstarry merged commit d8a8393 into solana-labs:master May 13, 2022
@jstarry jstarry deleted the lut/prohibit-dynamic-program-ids branch May 13, 2022 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants