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

LocalCluster - rename, refactor consts, verify initial transfers #4437

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

apfitzge
Copy link

@apfitzge apfitzge commented Jan 13, 2025

Problem

  • Local cluster tests have some misleading names
  • consts are in weird places
  • we don't make sure we have enough for transfers we attempt

Additional context: #4394 - I'm removing the special-casing in our fee-calculation for zero fees in tests. This requires some changes in several places, including local-cluster tests. Splitting these changes out to make the fee-related changes simpler to do.

Summary of Changes

  • cluster_lamports is not the total cluster lamports...its' the mint_lamports. Change the name
  • Move default mint lamports constant to the config and actually use it as the default
  • Add an assert to make sure mint has at least enough lamports for the setup transfers

@apfitzge apfitzge changed the title LocalCluster - refactor consts, LocalCluster - rename, refactor consts, verify initial transfers Jan 13, 2025
@@ -1432,7 +1432,7 @@ pub mod test {
initialize_and_add_secondary_indexes(&mut validator_config);
let num_nodes = 1;
let mut config = ClusterConfig {
cluster_lamports: 10_000_000,
Copy link
Author

Choose a reason for hiding this comment

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

could probably get rid of all these lower values as well...I can't imagine there's anything special about these that require lower mint lamports

Copy link
Author

Choose a reason for hiding this comment

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

could either do them in this PR, or just up them if these tests fail once fees are added.

@@ -278,10 +280,18 @@ impl LocalCluster {
stake,
))
} else {
required_mint_lamports += Self::required_validator_funding(*stake);
Copy link
Author

Choose a reason for hiding this comment

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

working on making local cluster tests (and all tests) have fees.
This line will change as we need to add additional lamports to pay for fees.

@apfitzge apfitzge marked this pull request as ready for review January 13, 2025 19:37
@apfitzge apfitzge requested a review from brooksprumo January 13, 2025 19:37
Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

local-cluster/src/local_cluster.rs Outdated Show resolved Hide resolved
local-cluster/src/local_cluster.rs Show resolved Hide resolved
Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

:shipit:

@apfitzge apfitzge added the automerge automerge Merge this Pull Request automatically once CI passes label Jan 13, 2025
@mergify mergify bot merged commit 9861e66 into anza-xyz:master Jan 13, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants