Skip to content

Conversation

@olgakonsta
Copy link
Collaborator

No description provided.

@olgakonsta olgakonsta requested a review from tenequm June 5, 2025 14:23
Copy link

@gemini-code-assist gemini-code-assist bot left a 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! Gemini here, providing a summary of this pull request to help everyone get up to speed quickly.

The intent of this pull request, based on the title and the changes, appears to be a fix related to how keys are generated for Redis in the PoolRatesRepository. Specifically, it looks like the change is adding a Redis hash tag to the key prefix. This is typically done to ensure that related keys are stored on the same node in a Redis Cluster, which is necessary for certain multi-key operations or for efficient data co-location.

The core change involves modifying a single constant in one file to include the hash tag in the Redis key prefix.

Highlights

  • Redis Key Prefix Fix: The pull request updates the constant used for generating Redis keys within the PoolRatesRepository to include a hash tag ({rates}). This change is crucial for correct key distribution and co-location when using Redis in a clustered environment, ensuring that keys with the same hash tag are managed by the same node.

Changelog

  • stash/src/repository/PoolRatesRepository.ts
    • Updated the PREFIX constant on line 14 from 'rates:' to {rates}:' to incorporate a Redis hash tag for improved key management in a clustered setup.
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.


A key without a tag,
Across the cluster it may lag.
Add the curly brace,
Data finds its place,
No more a scattered rag.

Footnotes

  1. 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 aims to introduce Redis hash tags for pool rates keys by modifying the PREFIX constant. While this is a good initiative for ensuring proper key distribution in a Redis Cluster environment, the current change has a subtle side effect on keys generated by the keyPair function, leading to an unexpected hash tag. More details are in the specific comment.

Summary of Findings

  • Inconsistent Redis Hash Tag for keyPair: The change to PREFIX = '{rates}:' on line 14 of stash/src/repository/PoolRatesRepository.ts correctly applies the rates hash tag for keys using PREFIX_LATEST. However, due to the existing definition of keyPair on line 18, keys generated by keyPair will result in a format like {rates}::some:key, leading to an effective hash tag of rates}. This inconsistency means keyLatest and keyPair keys will use different hash tags (rates vs rates}), potentially causing issues in a Redis Cluster environment if these keys are expected to be co-located. This should be clarified and potentially fixed by adjusting the keyPair function.

Merge Readiness

The pull request addresses an important aspect of Redis usage in a clustered environment by introducing hash tags. However, a high-severity issue has been identified where the current change leads to inconsistent hash tags for different types of rate keys. It is recommended that this issue be addressed before merging to ensure correct and predictable behavior in a Redis Cluster. I am unable to approve pull requests, but I advise further review and changes based on the feedback provided.

@mangatafinance
Copy link

mangatafinance commented Jun 5, 2025

Run report for c79987ff (format-lint-test, Format, lint and test, beast-gke, false, 1, moon ci :format :lint :test :benchmark-tests-gasp-node)

Total time: 30.6s | Comparison time: 31.6s | Estimated savings: 972.5ms (3.1% faster)

Action Time Status Info
🟩 SyncWorkspace 43.4ms Passed
🟩 SetupToolchain(node:22.14.0) 6.2s Passed
🟩 SyncProject(node, stash) 0.5ms Passed
🟩 InstallProjectDeps(node:22.14.0, stash) 24.4s Passed
🟦 RunTask(stash:lint) 40.2ms Cached
🟦 RunTask(stash:format) 41.9ms Cached
🟦 RunTask(stash:test) 42.7ms 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/src/repository/PoolRatesRepository.ts

@mangatafinance
Copy link

mangatafinance commented Jun 5, 2025

Run report for c79987ff (build-docker-images, Build docker images, ubuntu-24.04, true, 5, moon :build-image-ci)

Total time: 4m 58s | Comparison time: 9m 11s | Estimated savings: 4m 12s (45.8% faster)

Action Time Status Info
🟩 SyncWorkspace 285.1ms Passed
⬛️ SetupToolchain(system) 0.2ms Skipped
🟩 SyncProject(system, avs-aggregator) 0.7ms Passed
🟩 SyncProject(system, contracts) 1.8ms Passed
🟩 SyncProject(system, gasp-node) 5.2ms Passed
🟩 SyncProject(system, updater) 0.6ms Passed
🟦 RunTask(contracts:buildkit-build-and-push-image-digests) 277.7ms Cached
🟩 SyncProject(system, sequencer) 0.9ms Passed
🟦 RunTask(avs-aggregator:buildkit-build-and-push-image-digests) 299.6ms Cached
🟩 SyncProject(system, gasp-avs) 2ms Passed
🟦 RunTask(gasp-node:buildkit-build-and-push-image-digests-standard-runtime) 574.2ms Cached
🟦 RunTask(gasp-node:buildkit-build-and-push-image-digests-fast-runtime) 636.5ms Cached
🟦 RunTask(updater:buildkit-build-and-push-image-digests) 241.1ms Cached
🟦 RunTask(sequencer:buildkit-build-and-push-image-digests) 275.8ms Cached
🟩 SetupToolchain(node:22.14.0) 5.5s Passed
🟩 RunTask(contracts:build-image-ci) 5.7s Passed
🟩 RunTask(avs-aggregator:build-image-ci) 6.9s Passed
🟩 SetupToolchain(node:18.20.7) 8.4s Passed
🟩 SyncProject(node, stash) 0.7ms Passed
🟩 SyncProject(node, ferry-deposit) 0.4ms Passed
And 13 more...
Expanded report
Action Time Status Info
🟩 SyncProject(node, ferry-withdrawal) 0.4ms Passed
🟦 RunTask(stash:buildkit-build-and-push-image-digests) 298.6ms Cached
🟦 RunTask(ferry-deposit:buildkit-build-and-push-image-digests) 201.2ms Cached
🟦 RunTask(ferry-withdrawal:buildkit-build-and-push-image-digests) 199.6ms Cached
🟩 RunTask(updater:build-image-ci) 7s Passed
🟩 RunTask(sequencer:build-image-ci) 7.8s Passed
🟩 RunTask(stash:build-image-ci) 7.5s Passed
🟩 RunTask(gasp-node:build-image-ci) 14.1s Passed
🟩 RunTask(ferry-deposit:build-image-ci) 7.6s Passed
🟩 RunTask(ferry-withdrawal:build-image-ci) 6.9s Passed
🟩 RunTask(gasp-avs:buildkit-build-and-push-image-digests-standard-runtime) 4m 19s Passed SLOW
🟩 RunTask(gasp-avs:buildkit-build-and-push-image-digests-fast-runtime) 4m 19s Passed SLOW
🟩 RunTask(gasp-avs:build-image-ci) 19.3s 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/src/repository/PoolRatesRepository.ts

@olgakonsta olgakonsta merged commit c79987f into develop Jun 5, 2025
71 checks passed
@github-actions
Copy link

🎉 This PR is included in version stash-v1.1.0-rc.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants