-
Notifications
You must be signed in to change notification settings - Fork 12
chore: chain and prices repository hash tag fix #606
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
Conversation
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.
Hello @olgakonsta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
Hello team, gemini-code-assist here to provide a summary of this pull request. This PR, authored by olgakonsta, focuses on a maintenance task (chore) related to the chain and prices repositories. The primary goal appears to be adjusting the Redis key prefixes used within these repositories to incorporate Redis hash tags ({...}). This change is typically made to ensure that related keys are grouped together on the same hash slot in a Redis Cluster environment, which is crucial for operations involving multiple keys within a single command (like transactions or Lua scripts). By adding the {chain} and {price} tags, the PR ensures that all keys starting with these prefixes will hash to the same slot, preventing potential cross-slot errors in a clustered setup.
Highlights
- Redis Key Prefixing: The main change involves modifying the constant string prefixes used for generating Redis keys in the
ChainRepositoryandPriceRepositoryclasses. The prefixes are updated to include Redis hash tags, specifically{chain}:and{price}:. - Redis Cluster Compatibility: The addition of hash tags suggests an effort to make the application more compatible with or optimized for a Redis Cluster environment, ensuring related data resides on the same node.
Changelog
- stash/src/repository/ChainRepository.ts
- Updated the
PREFIXconstant on line 8 from'chain:'to'{chain}:'to include a Redis hash tag.
- Updated the
- stash/src/repository/PriceRepository.ts
- Updated the
PREFIXconstant on line 9 from'price:asset:'to'{price}:asset:'to include a Redis hash tag. - Updated the
PREFIX_LATESTconstant on line 10 from'price:pool:latest:'to'{price}:pool:latest:'to include a Redis hash tag.
- Updated the
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request introduces Redis hash tags ({chain} and {price}) to key prefixes in ChainRepository.ts and PriceRepository.ts. This is a standard and beneficial practice for ensuring key co-location in a Redis Cluster environment, which is crucial for multi-key operations like transactions.
The implementation of the hash tags themselves appears correct. My main concern, detailed in the comments, revolves around the potential impact on existing data if this is deployed against a Redis instance already populated with keys using the old naming scheme. Clarification on data migration or the context of deployment (e.g., new setup) would be helpful.
Summary of Findings
- Impact on Existing Redis Data: The introduction of Redis hash tags changes key naming patterns (e.g.,
chain:footo{chain}:foo). This is correct for Redis Cluster but means existing data under old key names will be orphaned unless migrated or intentionally superseded. This potential impact needs clarification.
Merge Readiness
The code changes correctly implement Redis hash tags, which is a positive step for Redis Cluster compatibility. However, due to the potential impact on existing data (as keys will be renamed), I recommend clarifying the data migration strategy or confirming that this is for a new deployment where old data is not a concern. Addressing this point is important before the pull request is merged. I am not authorized to approve pull requests, but based on this review, these changes should be addressed or clarified before merging.
Run report for aab1b9bf
|
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟩 | SyncWorkspace |
44.6ms | Passed | |
| 🟩 | SetupToolchain(node:22.14.0) |
6.5s | Passed | |
| 🟩 | SyncProject(node, stash) |
0.4ms | Passed | |
| 🟩 | InstallProjectDeps(node:22.14.0, stash) |
29.5s | Passed | |
| 🟦 | RunTask(stash:format) |
44.3ms | Cached | |
| 🟦 | RunTask(stash:lint) |
44.9ms | Cached | |
| 🟦 | RunTask(stash:test) |
45.4ms | Cached |
Environment
OS: Linux
Matrix:
prefix = format-lint-test
name = Format, lint and test
runner = beast-gke
buildkit-enable = false
buildkit-replicas = 1
command = moon ci :format :lint :test :benchmark-tests-gasp-node
Variables:
MOON_COLOR = 2
MOON_DEBUG_PROTO_INSTALL = false
MOON_CACHE = read-write
MOON_VERSION = 1.34.0
Touched files
stash/app-frontend.yaml
stash/app-holesky.yaml
stash/app-prod.yaml
stash/app-staging.yaml
stash/compose.yml
stash/src/repository/ChainRepository.ts
stash/src/repository/PriceRepository.ts
stash/src/service/SyncBlockService.ts
Run report for aab1b9bf
|
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟩 | SyncWorkspace |
369.1ms | Passed | |
| 🟩 | SetupToolchain(node:22.14.0) |
6.1s | Passed | |
| 🟩 | SyncProject(node, stash) |
0.8ms | Passed | |
| 🟦 | RunTask(stash:buildkit-build-and-push-image-digests) |
454.4ms | Cached | |
| 🟩 | SetupToolchain(node:18.20.7) |
9.1s | Passed | |
| ⬛️ | SetupToolchain(system) |
9.1s | Skipped | |
| 🟩 | SyncProject(node, ferry-deposit) |
0.5ms | Passed | |
| 🟩 | SyncProject(system, sequencer) |
0.9ms | Passed | |
| 🟩 | SyncProject(node, ferry-withdrawal) |
1.7ms | Passed | |
| 🟩 | SyncProject(system, gasp-avs) |
4.8ms | Passed | |
| 🟩 | SyncProject(system, contracts) |
4.7ms | Passed | |
| 🟩 | SyncProject(system, gasp-node) |
4.1ms | Passed | |
| 🟩 | SyncProject(system, updater) |
0.7ms | Passed | |
| 🟩 | SyncProject(system, avs-aggregator) |
0.5ms | Passed | |
| 🟦 | RunTask(ferry-withdrawal:buildkit-build-and-push-image-digests) |
734.2ms | Cached | |
| 🟦 | RunTask(ferry-deposit:buildkit-build-and-push-image-digests) |
734.8ms | Cached | |
| 🟦 | RunTask(sequencer:buildkit-build-and-push-image-digests) |
875.2ms | Cached | |
| 🟦 | RunTask(contracts:buildkit-build-and-push-image-digests) |
316.5ms | Cached | |
| 🟦 | RunTask(gasp-avs:buildkit-build-and-push-image-digests) |
330.3ms | Cached | |
| 🟦 | RunTask(gasp-node:buildkit-build-and-push-image-digests-fast-runtime) |
482.2ms | Cached | |
| And 12 more... |
Expanded report
| Action | Time | Status | Info | |
|---|---|---|---|---|
| 🟦 | RunTask(updater:buildkit-build-and-push-image-digests) |
435.6ms | Cached | |
| 🟦 | RunTask(gasp-node:buildkit-build-and-push-image-digests-standard-runtime) |
461.1ms | Cached | |
| 🟦 | RunTask(avs-aggregator:buildkit-build-and-push-image-digests) |
371.9ms | Cached | |
| 🟩 | RunTask(stash:build-image-ci) |
10.1s | Passed | |
| 🟩 | RunTask(sequencer:build-image-ci) |
10.2s | Passed | |
| 🟩 | RunTask(ferry-withdrawal:build-image-ci) |
11s | Passed | |
| 🟩 | RunTask(ferry-deposit:build-image-ci) |
11.1s | Passed | |
| 🟩 | RunTask(contracts:build-image-ci) |
9.4s | Passed | |
| 🟩 | RunTask(updater:build-image-ci) |
9.7s | Passed | |
| 🟩 | RunTask(gasp-avs:build-image-ci) |
10.7s | Passed | |
| 🟩 | RunTask(avs-aggregator:build-image-ci) |
7.4s | Passed | |
| 🟩 | RunTask(gasp-node:build-image-ci) |
20.9s | Passed |
Environment
OS: Linux
Matrix:
prefix = build-docker-images
name = Build docker images
runner = ubuntu-24.04
buildkit-enable = true
buildkit-replicas = 5
command = moon :build-image-ci
Variables:
MOON_COLOR = 2
MOON_DEBUG_PROTO_INSTALL = false
MOON_CACHE = read-write
MOON_VERSION = 1.34.0
Touched files
stash/app-frontend.yaml
stash/app-holesky.yaml
stash/app-prod.yaml
stash/app-staging.yaml
stash/compose.yml
stash/src/repository/ChainRepository.ts
stash/src/repository/PriceRepository.ts
stash/src/service/SyncBlockService.ts
|
🎉 This PR is included in version stash-v1.1.0-rc.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
No description provided.