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

RPC-456 filtering out all the non writable accounts #10

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Conversation

dmitriy-helius
Copy link
Collaborator

Overview

  • The transaction has readable and writable accounts. The fees are paid to lock the writable account. We must ensure we do not miscalculate the fee by including readable accounts. This change will
  1. only store feest for writable accounts on the transaction
  2. only calculate fees for accounts that are writable on provided transactions.

Testing

  • Unit tests, local instance tests.

}
}

fn extract_from_meta(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the method that extracts the writable accounts from Metadata

budget.process_instructions(instructions_for_processing.into_iter(), true, true)
}

pub(crate) fn construct_writable_accounts<T>(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Method that constructs the writable accounts.
If header not there all accounts will be returned
Otherwise the logic will be applied

@@ -232,12 +234,26 @@ fn validate_get_priority_fee_estimate_request(

/// returns account keys from transaction
fn get_from_account_keys(transaction: &VersionedTransaction) -> Vec<String> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The second part, where we extract the writable keys from transaction on request

@dmitriy-helius dmitriy-helius merged commit 8445b6f into main Sep 11, 2024
2 checks passed
@dmitriy-helius dmitriy-helius deleted the 456 branch September 11, 2024 01:00
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