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

feat: validation service #724

Merged
merged 47 commits into from
Sep 10, 2024
Merged

feat: validation service #724

merged 47 commits into from
Sep 10, 2024

Conversation

aljo242
Copy link
Contributor

@aljo242 aljo242 commented Sep 4, 2024

Spins up and internal validation service that can introspect the live prices the sidecar is producing.

If any of the prices is below our configured liveness threshold (99%, perhaps this should be stricter), the process will terminate itself.

If all prices are valid after a configured amount of time, the process will gracefully tear down and end sucessfully.

This comment has been minimized.


import "net"

func IsValidAddress(address string) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to a common folder so it could be used by other code

Copy link

github-actions bot commented Sep 4, 2024

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (1)

libhttp

To accept these unrecognized words as correct, you could run the following commands

... in a clone of the git@github.com:skip-mev/connect.git repository
on the chore/debug-timeout branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/prerelease/apply.pl' |
perl - 'https://github.com/skip-mev/connect/actions/runs/10706806834/attempts/1'

OR

To have the bot accept them for you, comment in the PR quoting the following line:
@check-spelling-bot apply updates.

Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (755) from .github/actions/spelling/expect.txt and unrecognized words (1)

Dictionary Entries Covers Uniquely
cspell:python/src/python/python-lib.txt 2417 8 4
cspell:fullstack/dict/fullstack.txt 419 5 4
cspell:java/src/java.txt 2464 5 3
cspell:filetypes/filetypes.txt 264 4 3
cspell:java/src/java-terms.txt 920 4 1

Consider adding them (in .github/workflows/spell.yml) in jobs:/build: to extra_dictionaries:

          cspell:python/src/python/python-lib.txt
          cspell:fullstack/dict/fullstack.txt
          cspell:java/src/java.txt
          cspell:filetypes/filetypes.txt
          cspell:java/src/java-terms.txt

To stop checking additional dictionaries, add (in .github/workflows/spell.yml):

check_extra_dictionaries: ''
Warnings (1)

See the 📂 files view, the 📜action log, or 📝 job summary for details.

⚠️ Warnings Count
⚠️ no-newline-at-eof 3

See ⚠️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

🚂 If you're seeing this message and your PR is from a branch that doesn't have check-spelling,
please merge to your PR's base branch to get the version configured for your repository.

aljo242 added 2 commits September 4, 2024 13:44
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 12.06897% with 102 lines in your changes missing coverage. Please review.

Project coverage is 55.52%. Comparing base (fc4879a) to head (bf62b8b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
service/validation/validation.go 17.14% 58 Missing ⚠️
cmd/connect/main.go 0.00% 25 Missing ⚠️
oracle/metrics/metrics.go 0.00% 12 Missing ⚠️
pkg/http/address.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #724      +/-   ##
==========================================
- Coverage   55.97%   55.52%   -0.45%     
==========================================
  Files         206      208       +2     
  Lines       11475    11582     +107     
==========================================
+ Hits         6423     6431       +8     
- Misses       4452     4552     +100     
+ Partials      600      599       -1     

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

@@ -6354,67 +6259,6 @@ var (
}
]
},
"RNDR/USD": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the dead feeds. Validation fails when they are here and passing when they are gone

Comment on lines 214 to 215
int(validation.DefaultValidationPeriod),
"Duration to run in validation mode. Note: this flag is only used if mode == \"validate\"",
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not clear to me what the units are for this int--hours minutes days etc.

contrib/compose/docker-compose-dev.yml Outdated Show resolved Hide resolved
service/validation/validation.go Outdated Show resolved Hide resolved
cmd/connect/main.go Outdated Show resolved Hide resolved
cmd/connect/main.go Outdated Show resolved Hide resolved
cmd/connect/main.go Outdated Show resolved Hide resolved
cmd/connect/main.go Show resolved Hide resolved
@@ -44,6 +44,7 @@ services:
"--market-config-path", "/data/markets.json",
"--pprof-port", "6060",
"--run-pprof",
"-m", "validate" # uncomment to run in validation mode with default config
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be commented out? comment suggests so

service/validation/validation.go Outdated Show resolved Hide resolved
service/validation/validation.go Outdated Show resolved Hide resolved
service/validation/validation.go Show resolved Hide resolved
service/validation/validation.go Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

should we add a test for this logic?

Alex Johnson and others added 9 commits September 6, 2024 11:56
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
@aljo242 aljo242 merged commit 2c68728 into main Sep 10, 2024
15 of 17 checks passed
@aljo242 aljo242 deleted the chore/debug-timeout branch September 10, 2024 14:36
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.

3 participants