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

TransactionView: Static Account Keys Meta #2410

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

apfitzge
Copy link

@apfitzge apfitzge commented Aug 2, 2024

Problem

Summary of Changes

  • Parse static accounts
  • Additional checks that number of static accounts is valid

Fixes #

@apfitzge apfitzge mentioned this pull request Aug 2, 2024
14 tasks
@apfitzge apfitzge marked this pull request as ready for review August 2, 2024 16:39
@apfitzge apfitzge self-assigned this Aug 2, 2024
Comment on lines 24 to 25
const MAX_STATIC_ACCOUNTS_PER_PACKET: u16 =
(PACKET_DATA_SIZE / core::mem::size_of::<Pubkey>()) as u16;
Copy link

Choose a reason for hiding this comment

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

Is StaticAccountMeta going to represent AccountMeta?

pub struct AccountMeta {
/// An account's public key.
pub pubkey: Pubkey,
/// True if an `Instruction` requires a `Transaction` signature matching `pubkey`.
pub is_signer: bool,
/// True if the account data or metadata may be mutated during program execution.
pub is_writable: bool,
}

I was wondering if you should account for the two booleans in addition to the public key.

Copy link
Author

Choose a reason for hiding this comment

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

no unrelated to that struct. Have just been naming all my internal transaction view structs holding offsets/sizes with Meta suffixes.

The is_signer and is_writable are not part of the actual packet and are implied by combination of account index and information from the header.
So these will be functions on the wrapping transaction_view once I add the accessor functions.

Copy link

Choose a reason for hiding this comment

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

I mixed up the names and thought they were related. How about calling the struct StaticAccountKeyMeta?

Copy link
Author

Choose a reason for hiding this comment

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

@apfitzge apfitzge force-pushed the static_accounts_meta branch from a76a7cb to b76362e Compare August 5, 2024 15:39
@apfitzge
Copy link
Author

apfitzge commented Aug 5, 2024

@LucasSte I rebased with #2408 to rename the functions

@apfitzge apfitzge changed the title TransactionView: Static Accounts Meta TransactionView: Static Account Keys Meta Aug 7, 2024
@apfitzge apfitzge merged commit 9d4867e into anza-xyz:master Aug 7, 2024
40 checks passed
@apfitzge apfitzge deleted the static_accounts_meta branch August 7, 2024 18:07
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
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