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

fix pending queue #2954

Merged
merged 4 commits into from
Jul 29, 2024
Merged

fix pending queue #2954

merged 4 commits into from
Jul 29, 2024

Conversation

trajan0x
Copy link
Contributor

@trajan0x trajan0x commented Jul 29, 2024

Description

prevent nonce overwrite:

https://github.com/synapsecns/sanguine/pull/2954/files#diff-0582778f84e9cb035d76b3d723832dd4fb9fff5ee4ed686ee42728172bf0a11aR56

Summary by CodeRabbit

  • New Features

    • Introduced a new options-based approach for transaction retrieval, allowing enhanced configurability with options like statuses and maximum results.
  • Bug Fixes

    • Improved control flow in the listener's polling method for better attribute handling.
  • Tests

    • Updated test cases to utilize the new options-based parameters for transaction queries, enhancing clarity and maintainability.
  • Chores

    • Cleaned up unnecessary linting directives to improve code readability.

Copy link
Contributor

coderabbitai bot commented Jul 29, 2024

Walkthrough

The recent changes encompass a significant redesign of the transaction retrieval mechanisms in the ethergo project. By transitioning from specific status parameters to a more flexible options-based approach, the modifications introduce greater configurability and clarity in code handling. New helper functions streamline the management of transaction statuses and result limits, enhancing overall usability and testing efficiency.

Changes

Files Change Summary
.../mocks/service.go, .../service.go, .../txdb/store.go Updated function signatures to replace variadic Status parameters with variadic Option, enhancing flexibility in transaction queries. Introduced Option type and related helper functions for structured parameter management.
.../db_test.go, .../submitter_test.go, .../queue.go Refactored test implementations and transaction processing logic to utilize new WithStatuses and WithMaxResults functions, improving code readability and maintainability.
.../metrics.go Clarified the stopping condition for counting pending transactions in the metrics, changing from MaxResultsPerChain to DefaultMaxResultsPerChain.
.../listener/listener.go Improved the deferred execution of setting the didPoll attribute in the doPoll method for better readability and control flow.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Service
    participant Store
    Client->>Service: GetTXS(options...)
    Service->>Store: GetTXS(options...)
    Store-->>Service: Return Transactions
    Service-->>Client: Return Transactions
Loading

🐰 "In the garden where options bloom,
With statuses wrapped, there's more room.
No more limits set in stone,
Just flexible paths for us to roam.
Oh, how fun to hop and play,
With every change, a brighter day!" 🌸


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.

@github-actions github-actions bot added go Pull requests that update Go code size/s labels Jul 29, 2024
@trajan0x trajan0x force-pushed the fixes-pending-queue branch from ec8306d to 405c5a6 Compare July 29, 2024 15:00
Copy link

cloudflare-workers-and-pages bot commented Jul 29, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: b742103
Status: ✅  Deploy successful!
Preview URL: https://abdac88c.sanguine-fe.pages.dev
Branch Preview URL: https://fixes-pending-queue.sanguine-fe.pages.dev

View logs

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

The pull request introduces flexible transaction querying by implementing the Option pattern, enhancing the handling of pending queues.

  • Flexible Querying: Updated ethergo/submitter/db/service.go to use Option parameters for GetTXS and GetAllTXAttemptByStatus, allowing dynamic query options.
  • Mock Service Alignment: Modified ethergo/submitter/db/mocks/service.go to align with the new Option pattern.
  • Dynamic Max Results: Removed MaxResultsPerChain constant in ethergo/submitter/db/txdb/store.go, replaced with runtime options.
  • Test Updates: Adjusted ethergo/submitter/db_test.go and submitter_test.go to use the new WithStatuses option.
  • Documentation Update: Updated comment in ethergo/submitter/metrics.go to reflect the new constant name DefaultMaxResultsPerChain.

7 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 13.15789% with 33 lines in your changes missing coverage. Please review.

Project coverage is 25.33941%. Comparing base (683fb3e) to head (b742103).
Report is 14 commits behind head on master.

Files Patch % Lines
ethergo/submitter/db/service.go 0.00000% 22 Missing ⚠️
ethergo/submitter/db/txdb/store.go 0.00000% 11 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##              master       #2954         +/-   ##
===================================================
+ Coverage   25.31904%   25.33941%   +0.02036%     
===================================================
  Files            790         790                 
  Lines          56732       56789         +57     
  Branches          80          80                 
===================================================
+ Hits           14364       14390         +26     
- Misses         40881       40912         +31     
  Partials        1487        1487                 
Flag Coverage Δ
cctp-relayer 31.97848% <ø> (ø)
ethergo 47.93443% <13.15789%> (-0.17953%) ⬇️
explorer 4.97877% <ø> (ø)
omnirpc 33.23904% <ø> (ø)
opbot 0.48900% <ø> (ø)
promexporter 7.66551% <ø> (-0.00668%) ⬇️
rfq 24.90672% <ø> (+0.20285%) ⬆️
scribe 18.24614% <ø> (+0.06432%) ⬆️
tools 30.55118% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

No major changes found since the last review.

7 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 50bec51 and 405c5a6.

Files selected for processing (7)
  • ethergo/submitter/db/mocks/service.go (2 hunks)
  • ethergo/submitter/db/service.go (2 hunks)
  • ethergo/submitter/db/txdb/store.go (5 hunks)
  • ethergo/submitter/db_test.go (5 hunks)
  • ethergo/submitter/metrics.go (1 hunks)
  • ethergo/submitter/queue.go (2 hunks)
  • ethergo/submitter/submitter_test.go (3 hunks)
Additional comments not posted (27)
ethergo/submitter/db/service.go (8)

47-53: LGTM!

The introduction of the Option type and options struct enhances configurability and maintainability.


55-61: LGTM!

The OptionsFetcher interface provides a clear contract for fetching options, improving code clarity.


63-69: LGTM!

The methods MaxResults and Statuses provide access to the encapsulated parameters, enhancing usability.


71-75: LGTM!

The DefaultMaxResultsPerChain constant establishes a default limit for the maximum number of transactions, improving resiliency.


77-89: LGTM!

The ParseOptions function enhances flexibility by allowing dynamic configuration of options.


91-96: LGTM!

The WithStatuses function improves code readability and maintainability by using a structured approach.


98-103: LGTM!

The WithMaxResults function enhances configurability by allowing users to set result limits.


26-26: LGTM! But verify the function usage in the codebase.

The changes to the method signatures improve flexibility and configurability.

However, ensure that all calls to GetTXS and GetAllTXAttemptByStatus match the new signature.

Also applies to: 34-34

Verification successful

Function usage verified successfully.

All calls to GetTXS and GetAllTXAttemptByStatus in the codebase match the new signature using Option instead of Status.

  • Instances in ethergo/submitter/db/mocks/service.go, ethergo/submitter/db/service.go, ethergo/submitter/submitter_test.go, ethergo/submitter/db_test.go, ethergo/submitter/db/txdb/store.go, and ethergo/submitter/queue.go confirm the correct usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `GetTXS` and `GetAllTXAttemptByStatus` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'GetTXS'
rg --type go -A 5 $'GetAllTXAttemptByStatus'

Length of output: 8841

ethergo/submitter/queue.go (2)

86-86: LGTM!

The update to use db.WithStatuses(...) improves readability and maintainability by grouping status parameters.


156-156: LGTM!

The update to include db.WithMaxResults(100) enhances performance by limiting the number of results returned.

ethergo/submitter/db/mocks/service.go (2)

58-80: LGTM!

The update to use db.Option instead of db.Status broadens the flexibility of the GetAllTXAttemptByStatus method.


213-235: LGTM!

The update to use db.Option instead of db.Status broadens the flexibility of the GetTXS method.

ethergo/submitter/db_test.go (5)

96-96: LGTM!

The use of db.WithStatuses(db.Pending) improves code readability and maintainability.


100-100: LGTM!

Updating the expected maximum results per chain to db.DefaultMaxResultsPerChain aligns with the new standards.


120-122: LGTM!

The use of db.WithStatuses(allStatuses...) enhances consistency in status handling.


240-240: LGTM!

The use of db.WithStatuses(allStatuses...) enhances consistency in status handling.


249-249: LGTM!

The use of db.WithStatuses(allStatuses...) enhances consistency in status handling.

ethergo/submitter/metrics.go (1)

44-44: LGTM!

Updating the comment to DefaultMaxResultsPerChain clarifies the stopping condition for counting pending transactions.

ethergo/submitter/db/txdb/store.go (6)

120-120: LGTM!

The transition to an options-based approach enhances flexibility and configurability.


123-124: LGTM!

The use of db.ParseOptions and madeOptions.Statuses() improves code readability and maintainability.


145-145: LGTM!

Using madeOptions.MaxResults() for limiting results aligns with the new options-based approach.


178-178: LGTM!

The transition to an options-based approach enhances flexibility and configurability.


181-182: LGTM!

The use of db.ParseOptions and madeOptions.Statuses() improves code readability and maintainability.


200-203: LGTM!

Using madeOptions.MaxResults() for limiting results aligns with the new options-based approach.

ethergo/submitter/submitter_test.go (3)

302-302: LGTM!

The update to use db.WithStatuses(db.Stored) enhances clarity and maintainability.


359-359: LGTM!

The update to use db.WithStatuses(db.ReplacedOrConfirmed, db.Confirmed, db.Replaced) enhances clarity and maintainability.


401-401: LGTM!

The update to use db.WithStatuses(db.ReplacedOrConfirmed, db.Confirmed, db.Replaced) enhances clarity and maintainability.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

The pull request focuses on increasing the chain pending queue count and includes several enhancements and fixes.

  • Refactored listener.go: Improved readability and maintainability by encapsulating the span.SetAttributes(attribute.Bool("did_poll", didPoll)) call within an anonymous deferred function.
  • Enhanced chainPendingQueue in ethergo/submitter/chain_queue.go: Improved transaction handling by adding new functions to manage transaction statuses and maximum result limits.
  • Updated processQueue in ethergo/submitter/queue.go: Enhanced configurability and resilience by removing hardcoded limits and allowing for more customizable queries.
  • Documentation and Tests: Updated documentation and test cases to reflect changes, improving code clarity and maintainability.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 405c5a6 and cb84021.

Files selected for processing (1)
  • ethergo/listener/listener.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • ethergo/listener/listener.go

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Increased the maximum number of transaction attempts retrieved by the GetAllTXAttemptByStatus method to handle a larger volume of transactions in the pending queue.

  • File Modified: ethergo/submitter/queue.go
  • Change: Increased max transaction attempts from 100 to 1000 in GetAllTXAttemptByStatus.
  • Impact: Potential for higher memory usage and longer processing times under heavy load.
  • Consideration: Ensure system performance is not degraded with the increased load.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cb84021 and 4a41f4b.

Files selected for processing (1)
  • ethergo/submitter/queue.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • ethergo/submitter/queue.go

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Enhanced transaction status accuracy and control flow improvements in the pending queue.

  • File Modified: ethergo/submitter/db/txdb/store.go

    • Change: Added condition to MarkAllBeforeNonceReplacedOrConfirmed to exclude already confirmed transactions.
    • Impact: Prevents unnecessary updates to confirmed transactions.
  • File Modified: ethergo/submitter/chain_queue.go

    • Change: Improved control flow in the listener's polling method.
    • Impact: Better attribute handling and enhanced configurability.
  • File Modified: ethergo/submitter/queue.go

    • Change: Updated test cases to utilize new options-based parameters.
    • Impact: Enhanced clarity and maintainability of transaction queries.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@trajan0x trajan0x force-pushed the fixes-pending-queue branch from 59a52c3 to b742103 Compare July 29, 2024 15:30
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

The pull request focuses on enhancing the pending queue management by increasing the chain pending queue count and improving transaction status accuracy.

  • File Modified: ethergo/submitter/db/txdb/store.go

    • Change: Added condition to MarkAllBeforeNonceReplacedOrConfirmed to exclude already confirmed transactions.
    • Impact: Prevents unnecessary updates to confirmed transactions.
  • File Modified: ethergo/submitter/chain_queue.go

    • Change: Improved control flow in the listener's polling method.
    • Impact: Better attribute handling and enhanced configurability.
  • File Modified: ethergo/submitter/queue.go

    • Change: Updated test cases to utilize new options-based parameters.
    • Impact: Enhanced clarity and maintainability of transaction queries.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@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: 5

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4a41f4b and b742103.

Files selected for processing (1)
  • ethergo/submitter/db/txdb/store.go (6 hunks)
Additional context used
GitHub Check: codecov/patch
ethergo/submitter/db/txdb/store.go

[warning] 121-121: ethergo/submitter/db/txdb/store.go#L121
Added line #L121 was not covered by tests


[warning] 124-125: ethergo/submitter/db/txdb/store.go#L124-L125
Added lines #L124 - L125 were not covered by tests


[warning] 146-146: ethergo/submitter/db/txdb/store.go#L146
Added line #L146 was not covered by tests


[warning] 179-179: ethergo/submitter/db/txdb/store.go#L179
Added line #L179 was not covered by tests


[warning] 182-184: ethergo/submitter/db/txdb/store.go#L182-L184
Added lines #L182 - L184 were not covered by tests


[warning] 201-201: ethergo/submitter/db/txdb/store.go#L201
Added line #L201 was not covered by tests


[warning] 204-204: ethergo/submitter/db/txdb/store.go#L204
Added line #L204 was not covered by tests

Additional comments not posted (2)
ethergo/submitter/db/txdb/store.go (2)

124-125: Ensure correctness of the helper function usage.

The usage of db.ParseOptions and madeOptions.Statuses should be verified to ensure it correctly parses and handles the options.

Verification successful

Helper function usage is correct.

The ParseOptions function correctly initializes the options struct, and the Statuses method on the options struct returns the expected statuses. The usage of db.ParseOptions and madeOptions.Statuses in the code snippet is appropriate.

  • ParseOptions implementation: ethergo/submitter/db/service.go
  • Option type definition: ethergo/submitter/db/service.go
  • options struct definition: ethergo/submitter/db/service.go
  • OptionsFetcher interface: ethergo/submitter/db/service.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the `db.ParseOptions` function and its usage.

# Test: Search for the function implementation. Expect: Ensure it handles options correctly.
ast-grep --lang go --pattern $'func ParseOptions(options ...Option) Options {
  $$$
}'

Length of output: 87


Script:

#!/bin/bash
# Description: Locate the implementation of the `ParseOptions` function in the Go codebase.

# Search for any function named `ParseOptions` in Go files.
rg 'func ParseOptions' -t go -A 10

Length of output: 624


Script:

#!/bin/bash
# Description: Locate the definitions of `Option`, `options`, and `OptionsFetcher` in the Go codebase.

# Search for the definition of `Option`.
rg 'type Option' -t go -A 10

# Search for the definition of `options`.
rg 'type options' -t go -A 10

# Search for the definition of `OptionsFetcher`.
rg 'type OptionsFetcher' -t go -A 10

Length of output: 8243

Tools
GitHub Check: codecov/patch

[warning] 124-125: ethergo/submitter/db/txdb/store.go#L124-L125
Added lines #L124 - L125 were not covered by tests


182-184: Ensure correctness of the helper function usage.

The usage of db.ParseOptions and madeOptions.Statuses should be verified to ensure it correctly parses and handles the options.

Tools
GitHub Check: codecov/patch

[warning] 182-184: ethergo/submitter/db/txdb/store.go#L182-L184
Added lines #L182 - L184 were not covered by tests

@@ -123,10 +118,11 @@
// GetTXS returns all transactions for a given address on a given (or any) chain id that match a given status.
// there is a limit of 50 transactions per chain id. The limit does not make any guarantees about the number of nonces per chain.
// the submitter will get only the most recent tx submitted for each chain so this can be used for gas pricing.
func (s *Store) GetTXS(ctx context.Context, fromAddress common.Address, chainID *big.Int, matchStatuses ...db.Status) (txs []db.TX, err error) {
func (s *Store) GetTXS(ctx context.Context, fromAddress common.Address, chainID *big.Int, options ...db.Option) (txs []db.TX, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: Add tests.

The new implementation of the GetTXS function is not covered by tests.

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] 121-121: ethergo/submitter/db/txdb/store.go#L121
Added line #L121 was not covered by tests

@@ -147,7 +143,7 @@
Where(fmt.Sprintf("%s IN ?", statusFieldName), inArgs).
Group(fmt.Sprintf("%s, %s", nonceFieldName, chainIDFieldName)).
Order(fmt.Sprintf("%s asc", nonceFieldName)).
Limit(MaxResultsPerChain)
Limit(madeOptions.MaxResults())
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: Add tests.

The limit on the number of results returned by the query should be covered by tests.

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] 146-146: ethergo/submitter/db/txdb/store.go#L146
Added line #L146 was not covered by tests

@@ -180,9 +176,12 @@
}

// GetAllTXAttemptByStatus returns all transactions for a given address on a given (or any) chain id that match a given status.
func (s *Store) GetAllTXAttemptByStatus(ctx context.Context, fromAddress common.Address, chainID *big.Int, matchStatuses ...db.Status) (txs []db.TX, err error) {
func (s *Store) GetAllTXAttemptByStatus(ctx context.Context, fromAddress common.Address, chainID *big.Int, options ...db.Option) (txs []db.TX, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: Add tests.

The new implementation of the GetAllTXAttemptByStatus function is not covered by tests.

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] 179-179: ethergo/submitter/db/txdb/store.go#L179
Added line #L179 was not covered by tests

@@ -199,10 +198,10 @@
subQuery := s.DB().Model(&ETHTX{}).
Select(fmt.Sprintf("MAX(%s) as %s, %s, %s", idFieldName, idFieldName, nonceFieldName, chainIDFieldName)).
Where(query).
Where(fmt.Sprintf("%s IN ?", statusFieldName), statusToArgs(matchStatuses...)).
Where(fmt.Sprintf("%s IN ?", statusFieldName), inArgs).
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: Add tests.

The limit on the number of results returned by the query should be covered by tests.

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] 201-201: ethergo/submitter/db/txdb/store.go#L201
Added line #L201 was not covered by tests

Group(fmt.Sprintf("%s, %s", nonceFieldName, chainIDFieldName)).
Order(fmt.Sprintf("%s asc", nonceFieldName)).
Limit(MaxResultsPerChain)
Limit(madeOptions.MaxResults())
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder: Add tests.

The limit on the number of results returned by the query should be covered by tests.

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] 204-204: ethergo/submitter/db/txdb/store.go#L204
Added line #L204 was not covered by tests

@trajan0x trajan0x merged commit d1c13fe into master Jul 29, 2024
54 of 55 checks passed
@trajan0x trajan0x deleted the fixes-pending-queue branch July 29, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants