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

fix: transaction account dedupe and roles #29

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Conversation

buffalojoec
Copy link
Owner

Problem

Currently, if the same account is used twice in an instruction, and twice in the accounts list, Mollusk will not unify the roles of the accounts. For example, consider the following instruction:

1. [ writable ] Account 1
2. [  signer  ] Account 2

If the same key was provided for both accounts 1 & 2, they would be serialized into the VM as separate accounts with the following roles:

{
    account_1: { is_signer: false, is_writable: true }
    account_2: { is_signer: true, is_writable: false }
}

Instead they should both be writable and both be signer.

Summary of Changes

Partially reimplement the transaction compilation used in Message::new_with_blockhash to build out the transaction context for Mollusk invokes.

@buffalojoec buffalojoec merged commit dfad1af into main Oct 18, 2024
4 checks passed
@buffalojoec buffalojoec deleted the tx-key-dedupe branch October 18, 2024 06:36
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.

1 participant