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

bump slinky & forwarding module dependencies #238

Merged
merged 3 commits into from
Jul 31, 2024
Merged

Conversation

beer-1
Copy link
Member

@beer-1 beer-1 commented Jul 30, 2024

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

@beer-1 beer-1 requested a review from a team as a code owner July 30, 2024 10:03
Copy link

coderabbitai bot commented Jul 30, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

Walkthrough

Recent updates to the application enhance oracle data integration and vote extension handling. Key improvements include the introduction of an aggregator strategy for oracle data, updated event handling, and a new method for market map queries. These changes streamline functionality, improve error handling, and enhance overall performance, making the application more robust in processing oracle-related data.

Changes

File Change Summary
app/app.go Enhanced InitiaApp with aggregator integration and improved event handling; refactored oracle pre-block logic and simplified PreBlocker method.
app/oracle/client.go Added MarketMap method to GRPCClient for handling market map queries with thread safety and metrics tracking; modified createConnection to use slinkygrpc.NewClient.

Poem

In the meadow, changes hop,
With aggregators, data won't stop.
Votes now dance with a brand new sway,
Oracle whispers brighten the day.
Let's celebrate with a joyful cheer,
For the future's bright, the updates are here! 🐇✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 46.51163% with 46 lines in your changes missing coverage. Please review.

Project coverage is 39.85%. Comparing base (b3a48d6) to head (600a594).
Report is 1 commits behind head on main.

Files Patch % Lines
app/oracle/client.go 0.00% 46 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #238   +/-   ##
=======================================
  Coverage   39.85%   39.85%           
=======================================
  Files         259      259           
  Lines       24885    24952   +67     
=======================================
+ Hits         9917     9945   +28     
- Misses      13423    13463   +40     
+ Partials     1545     1544    -1     
Files Coverage Δ
app/app.go 87.77% <100.00%> (+0.59%) ⬆️
app/oracle/client.go 2.68% <0.00%> (-1.06%) ⬇️

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9a9c055 and 70a4d77.

Files ignored due to path filters (2)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
Files selected for processing (2)
  • app/app.go (5 hunks)
  • app/oracle/client.go (1 hunks)
Additional context used
GitHub Check: codecov/patch
app/oracle/client.go

[warning] 213-222: app/oracle/client.go#L213-L222
Added lines #L213 - L222 were not covered by tests


[warning] 225-230: app/oracle/client.go#L225-L230
Added lines #L225 - L230 were not covered by tests


[warning] 232-232: app/oracle/client.go#L232
Added line #L232 was not covered by tests

Additional comments not posted (7)
app/oracle/client.go (2)

225-230: Ensure the client is initialized before making the request.

The method correctly checks if the client is initialized before proceeding. This is crucial to avoid nil pointer dereferences.

Tools
GitHub Check: codecov/patch

[warning] 225-230: app/oracle/client.go#L225-L230
Added lines #L225 - L230 were not covered by tests


232-232: LGTM!

The code changes are approved. The method correctly handles market map queries and incorporates metrics tracking and error handling.

Tools
GitHub Check: codecov/patch

[warning] 232-232: app/oracle/client.go#L232
Added line #L232 was not covered by tests

app/app.go (5)

1155-1161: LGTM!

The introduction of the aggregatorFn improves code readability and maintainability by encapsulating the median aggregation logic.


Line range hint 1162-1181:
LGTM!

The initialization of the oraclePreBlockHandler with the new aggregatorFn and other dependencies enhances the handling of oracle data.


1182-1213: LGTM!

The introduction of the new vote extensions handler for extending and verifying vote extensions integrates the new aggregatorFn and other dependencies effectively.


1306-1306: LGTM!

The update to the PreBlocker method simplifies the flow of pre-block processing and improves error handling.


586-586: LGTM!

The update to the ForwardingKeeper initialization to include the runtime.ProvideEventService() enhances the app's event handling capabilities.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 70a4d77 and 600a594.

Files ignored due to path filters (2)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
Files selected for processing (1)
  • app/oracle/client.go (4 hunks)
Additional context used
GitHub Check: codecov/patch
app/oracle/client.go

[warning] 185-194: app/oracle/client.go#L185-L194
Added lines #L185 - L194 were not covered by tests


[warning] 209-209: app/oracle/client.go#L209
Added line #L209 was not covered by tests


[warning] 212-212: app/oracle/client.go#L212
Added line #L212 was not covered by tests


[warning] 223-232: app/oracle/client.go#L223-L232
Added lines #L223 - L232 were not covered by tests


[warning] 235-240: app/oracle/client.go#L235-L240
Added lines #L235 - L240 were not covered by tests


[warning] 242-242: app/oracle/client.go#L242
Added line #L242 was not covered by tests


[warning] 246-255: app/oracle/client.go#L246-L255
Added lines #L246 - L255 were not covered by tests


[warning] 258-263: app/oracle/client.go#L258-L263
Added lines #L258 - L263 were not covered by tests


[warning] 265-265: app/oracle/client.go#L265
Added line #L265 was not covered by tests

Additional comments not posted (1)
app/oracle/client.go (1)

219-243: Add tests for the MarketMap method.

The MarketMap method is not covered by tests. Ensure that unit tests are added to verify its functionality.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 223-232: app/oracle/client.go#L223-L232
Added lines #L223 - L232 were not covered by tests


[warning] 235-240: app/oracle/client.go#L235-L240
Added lines #L235 - L240 were not covered by tests


[warning] 242-242: app/oracle/client.go#L242
Added line #L242 was not covered by tests

Comment on lines +185 to +195
conn, err = slinkygrpc.NewClient(c.addr, opts...)

// attempt to connect + wait for change in connection state
if c.blockingDial {
// connect
conn.Connect()

if err == nil {
conn.WaitForStateChange(ctx, connectivity.Ready)
}
}
Copy link

Choose a reason for hiding this comment

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

Add tests for the createConnection method.

The changes to the createConnection method are not covered by tests. Ensure that unit tests are added to verify its functionality.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 185-194: app/oracle/client.go#L185-L194
Added lines #L185 - L194 were not covered by tests

Comment on lines +246 to +266
func (c *GRPCClient) Version(ctx context.Context, req *oracleservertypes.QueryVersionRequest, _ ...grpc.CallOption) (res *oracleservertypes.QueryVersionResponse, err error) {
c.mutex.Lock()
defer c.mutex.Unlock()

start := time.Now()
defer func() {
// Observe the duration of the call as well as the error.
c.metrics.ObserveOracleResponseLatency(time.Since(start))
c.metrics.AddOracleResponse(metrics.StatusFromError(err))
}()

// set deadline on the context
ctx, cancel := context.WithTimeout(ctx, c.timeout)
defer cancel()

if c.client == nil {
return nil, fmt.Errorf("oracle client not started")
}

return c.client.Version(ctx, req, grpc.WaitForReady(true))
}
Copy link

Choose a reason for hiding this comment

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

Add tests for the Version method.

The Version method is not covered by tests. Ensure that unit tests are added to verify its functionality.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?

Tools
GitHub Check: codecov/patch

[warning] 246-255: app/oracle/client.go#L246-L255
Added lines #L246 - L255 were not covered by tests


[warning] 258-263: app/oracle/client.go#L258-L263
Added lines #L258 - L263 were not covered by tests


[warning] 265-265: app/oracle/client.go#L265
Added line #L265 was not covered by tests

@beer-1 beer-1 requested a review from Eric-Warehime July 31, 2024 03:45
Copy link
Contributor

@Eric-Warehime Eric-Warehime left a comment

Choose a reason for hiding this comment

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

👍

@beer-1 beer-1 merged commit 40e2a41 into main Jul 31, 2024
5 checks passed
@beer-1 beer-1 deleted the bump/dependencies branch July 31, 2024 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants