-
Notifications
You must be signed in to change notification settings - Fork 115
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
Wl/t3 #1758
Conversation
WalkthroughThese updates enhance the GitHub workflows to trigger on a new branch, add a new function for market tickers, refactor test setups, introduce dependencies, and improve message handling and async task processing. Additionally, a new logger-based worker function and thread pool configuration have been added. Collectively, these changes improve workflow flexibility, code maintainability, and performance. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- indexer/services/socks/src/lib/message-forwarder.ts (5 hunks)
- indexer/services/socks/src/lib/workers/blank-worker.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- indexer/services/socks/src/lib/message-forwarder.ts
- indexer/services/socks/src/lib/workers/blank-worker.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
indexer/services/socks/src/lib/message-forwarder.ts (2)
1-3
: Remove commented-out import.The commented-out import statement for
Worker
fromworker_threads
should be removed if it is not needed.
185-186
: Commented-out code.The code for
perpetualMarketRefresher.updatePerpetualMarkets()
is commented out. If it's not needed, consider removing it.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- indexer/services/socks/tests/lib/message-forwarder.test.ts (1 hunks)
- indexer/services/socks/src/lib/message-forwarder.ts (8 hunks)
Files skipped from review due to trivial changes (1)
- indexer/services/socks/tests/lib/message-forwarder.test.ts
Additional comments not posted (6)
indexer/services/socks/src/lib/message-forwarder.ts (6)
4-6
: Reordering imports.Reordering imports can improve readability. Ensure that this change is consistent with the project's import style guidelines.
9-9
: ImportingPiscina
.The import for
Piscina
is added. Ensure thatPiscina
is correctly configured and utilized in the file.
20-20
: Reordered and refactored imports.The import statement for
getMessagesToForward
andgetChannels
has been refactored to import from./workers/from-kafka-helpers
. This change is consistent with the new file structure.
22-26
: ConfiguringPiscina
instance.The
Piscina
instance is configured with afilename
,minThreads
, andmaxThreads
. Ensure that these configurations align with the expected workload and performance requirements.
215-217
: UsinggetClobPairIdToTickerMap
.The new function
getClobPairIdToTickerMap
is used to get a mapping ofclobPairId
toticker
. Ensure that the function returns the correct data and handles errors appropriately.
226-226
: RunningPiscina
task.The
piscina.run({})
call is made. Ensure that the task being run byPiscina
is correctly defined and that the empty object passed as an argument is intentional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- indexer/services/socks/src/lib/message-forwarder.ts (8 hunks)
- indexer/services/socks/src/threadpool.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- indexer/services/socks/src/threadpool.ts
Files skipped from review as they are similar to previous changes (1)
- indexer/services/socks/src/lib/message-forwarder.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- .github/workflows/indexer-build-and-push-mainnet.yml (1 hunks)
- indexer/services/socks/src/lib/message-forwarder.ts (7 hunks)
- indexer/services/socks/src/lib/workers/from-kafka-helpers.ts (8 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/indexer-build-and-push-mainnet.yml
Files skipped from review as they are similar to previous changes (1)
- indexer/services/socks/src/lib/message-forwarder.ts
Additional comments not posted (5)
indexer/services/socks/src/lib/workers/from-kafka-helpers.ts (5)
19-21
: Reorganized and new imports look good.The reorganization of imports and addition of new imports are appropriate and support the refactored functions.
Line range hint
33-48
:
Review the commented-out line.The line
await perpetualMarketRefresher.updatePerpetualMarkets();
is commented out. Ensure this is intentional and does not affect the functionality.
Line range hint
33-48
:
Refactored function logic looks good.The changes to the function
getMessagesToForward
are appropriate and enhance its functionality.
113-117
: FunctiongetTickerOrThrow
looks good.The function correctly retrieves a ticker from the map and throws an error if the ticker is not found.
136-140
: FunctiongetCandleMessageId
looks good.The function correctly generates an ID for a candle message and includes error handling for unrecognized resolutions.
Changelist
[Describe or list the changes made in this PR]
Test Plan
[Describe how this PR was tested (if applicable)]
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
New Features
wl/t3
branch in workflow triggers for development, staging, and mainnet environments.clobPairId
toticker
values in market refresh logic.Enhancements
Piscina
library.Bug Fixes
Refactor
Dependencies
piscina
package to manage concurrent processing tasks.