fix: fetch DripGovernor::config once per batch in create_batch_streams - #477
Open
mysteriousskater wants to merge 1 commit into
Conversation
|
@mysteriousskater Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR removes the redundant per-stream
DripGovernor::configcross-contract calls increate_batch_streams. Instead of letting each stream in a batch independently fetch the same governor config, the batch path now fetches the config once and threads it through an internal helper.The public
create_streampath is preserved and still fetches its own config, so single-stream callers retain existing behavior.Related Issue
Changes
⚙️ Batch Config Fetch
contracts/factory/src/lib.rscreate_streaminto a public wrapper that fetchesGovernorConfigviagovernance::configand delegates stream creation to a new internal helper.create_stream_with_config(&config, ...)so both the single-stream and batch paths share the same bounds enforcement and stream creation logic.create_batch_streamsto fetch theDripGovernor::configonce before the stream loop and pass&configintocreate_stream_with_configfor each stream in the batch.create_streambehavior unchanged for single-stream callers.Verification Results
create_batch_streamsfetchesDripGovernor::configonce per batchcreate_streamstill fetches config for the single-stream pathcreate_stream_with_configcallsenforce_boundsfor each streamMAX_BATCH_SIZE = 10Closes #422