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

remove fee_calculator from nonce data #34959

Conversation

tao-stones
Copy link
Contributor

Problem

Nonce has FeeCalculator that is not used anymore.

Summary of Changes

  • remove fee_calculator from Nonce account
  • update call sites

Requires #34943

Fixes #34864

@tao-stones tao-stones force-pushed the remove-fee-calculator-from-nonce branch from c80c38c to 264b7b2 Compare January 25, 2024 20:42
Copy link
Contributor Author

@tao-stones tao-stones left a comment

Choose a reason for hiding this comment

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

@t-nelson this is a draft of removing fee_calculator from Nonce account. While waiting for #34943 to be landed first, would like to ask if you see issues with removing, mainly if it'd break something else I have not thought about? And your thoughts on below comments. 🙇🏼

@@ -87,18 +87,16 @@ pub struct TransactionExecutionDetails {
pub accounts_data_len_delta: i64,
}

// TODO - remove `DurableNonceFee` as it'd always be Invalid.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should have a prequel PR to remove DurableNonceFee first? Will that break something else?

nonce_account.lamports_per_signature = Some(data.fee_calculator.lamports_per_signature);
// TODO - shoudl also nonce_account's lamports_per_signature in this PR? or do it in
// separate one.
nonce_account.lamports_per_signature = None;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can remove optional lamports_per_signature from CliNonceAccount in separate PR, but should we keep it for now as deprecated if that's break cli client?

Ok((data.blockhash(), data.fee_calculator))
Self::NonceAccount(ref _pubkey) => {
// Note - to break or to gut entire deprecated function?
Err("Deprecated, NonceAccount no longer support fee_calculator".into())
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it time to remove deprecated get_blockhash_and_fee_calculator() function, (and one more below)? Or changes here to return Err is acceptable?

@@ -21,21 +20,17 @@ pub struct Data {
pub authority: Pubkey,
/// Durable nonce value derived from a valid previous blockhash.
pub durable_nonce: DurableNonce,
/// The fee calculator associated with the blockhash.
pub fee_calculator: FeeCalculator,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main change, everything else are the consequences

Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

removing the field breaks consensus. all of the pub symbol removals in sdk break semver.

if we want to do this, it has to be done under a new version variant and support for the older version(s) lives until all older accounts have been upgraded (read: forever). i think i'd just leave the bytes. we can mark all of the accessors deprecated so they can be removed in 2.0

@jstarry
Copy link
Member

jstarry commented Jan 29, 2024

I'd be in favor of a change that stores the fee_structure.lamports_per_signature in the blockhash queue and nonce data. It would require a feature gate but it would allow us to remove the FeeRateGovernor completely

@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Feb 13, 2024
@github-actions github-actions bot closed this Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lamports_per_signature in nonce account is not used
3 participants