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

Avoid unnecessary calculations in propose_batch #3265

Conversation

elderhammer
Copy link
Contributor

Determine in advance whether the proposal has expired.
If it expires, return directly and skip the subsequent process.

Copy link
Contributor

@vicsn vicsn left a comment

Choose a reason for hiding this comment

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

Interesting find. Perhaps the following should also be moved up for consistency:

// Ditto if the batch had already been proposed and not expired.
ensure!(round > 0, "Round 0 cannot have transaction batches");

@vicsn vicsn requested a review from mdelle1 May 21, 2024 07:41
@elderhammer
Copy link
Contributor Author

Interesting find. Perhaps the following should also be moved up for consistency:

// Ditto if the batch had already been proposed and not expired.
ensure!(round > 0, "Round 0 cannot have transaction batches");

Done.

node/bft/src/primary.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@raychu86 raychu86 left a comment

Choose a reason for hiding this comment

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

LGTM

@howardwu howardwu merged commit 5010207 into AleoNet:mainnet May 23, 2024
@elderhammer elderhammer deleted the perf/unnecessary_calculations_in_propose_batch branch May 24, 2024 15:51
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.

4 participants