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

Add limit to looping in banking-stage #35342

Merged
merged 2 commits into from
Feb 29, 2024
Merged

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented Feb 28, 2024

Problem

Forward port of da2078d is missing on master branch.

Summary of Changes

The code has diverged. So manually imported the commit to master branch.

Fixes #

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 81.7%. Comparing base (6ee3bb9) to head (8717c0a).
Report is 15 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #35342   +/-   ##
=======================================
  Coverage    81.7%    81.7%           
=======================================
  Files         834      834           
  Lines      224299   224309   +10     
=======================================
+ Hits       183361   183379   +18     
+ Misses      40938    40930    -8     

@pgarg66 pgarg66 marked this pull request as ready for review February 28, 2024 13:24
sakridge
sakridge previously approved these changes Feb 28, 2024
@pgarg66
Copy link
Contributor Author

pgarg66 commented Feb 28, 2024

@Lichtso, @alessandrod , could you review the changes in the LoadedPrograms? I made these manually, since the code on v1.17 is different.

.finish_cooperative_loading_task(self.slot, key, program)
&& limit_to_load_programs
{
let mut ret = LoadedProgramsForTxBatch::default();
Copy link
Contributor

Choose a reason for hiding this comment

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

We should return the existing loaded_programs_for_txs here instead of a Default one. Otherwise it is not initialized with a slot and environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied this from here: da2078d#diff-ed47b4a0198313377e091bb3957bbbc63d937805426d1b2b6de39d0a50d32a0cR5103
Do you think it's a problem, that should be fixed there as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, existing loaded_programs_for_txs might have some programs that could've gotten loaded in previous iterations of the loop. So it's not guaranteed to be empty. Maybe we should create a new instance with the correct slot and environment, instead of using default.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be cleaner to return the existing one in case something later reads these fields. Can be done in a separate PR if this shall stay a clean forward port.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Separate PR would be better. Also, maybe setting the correct slot and environment is better than using the existing instance (https://github.com/solana-labs/solana/pull/35342/files#r1506511480).

@pgarg66 pgarg66 requested a review from Lichtso February 28, 2024 22:56
Lichtso
Lichtso previously approved these changes Feb 28, 2024
t-nelson
t-nelson previously approved these changes Feb 28, 2024
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.

lgtm. optional consistency nit

program-runtime/src/loaded_programs.rs Outdated Show resolved Hide resolved
Co-authored-by: Trent Nelson <490004+t-nelson@users.noreply.github.com>
@pgarg66 pgarg66 dismissed stale reviews from Lichtso and sakridge via 8717c0a February 28, 2024 23:26
@pgarg66 pgarg66 requested review from t-nelson and sakridge February 28, 2024 23:27
@pgarg66
Copy link
Contributor Author

pgarg66 commented Feb 28, 2024

Thanks for the review. Just committed @t-nelson nit suggestion.
Need just one approval and I'll merge once CI is green.

@pgarg66 pgarg66 added the v1.18 PRs that should be backported to v1.18 label Feb 28, 2024
Copy link
Contributor

mergify bot commented Feb 28, 2024

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

@pgarg66 pgarg66 merged commit 990ca1d into solana-labs:master Feb 29, 2024
36 checks passed
@pgarg66 pgarg66 deleted the limit-loops branch February 29, 2024 01:36
mergify bot pushed a commit that referenced this pull request Feb 29, 2024
(cherry picked from commit 990ca1d)

# Conflicts:
#	runtime/src/bank.rs
#	svm/src/transaction_processor.rs
pgarg66 added a commit that referenced this pull request Feb 29, 2024
gregcusack pushed a commit to gregcusack/solana that referenced this pull request Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.18 PRs that should be backported to v1.18
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants