Commit Graph

105 Commits

Author SHA1 Message Date
Amin Moghaddam 89e67be9af
Check output of build command and panic if not successful (#1278) 2024-02-08 12:31:18 +01:00
Daniel Chew 2d1324e350
[hermes] add /v2/updates/price/<timestamp> endpoint (#1269)
* add /v2/updates/price/<timestamp> endpoint

* refactor

* refactor imports

* address comments

* address comments
2024-02-02 17:46:38 +09:00
Daniel Chew 69e4fee501
add /v2/updates/price/latest endpoint (#1225)
* add /v2/updates/price/latest endpoint

* Update data type in BinaryPriceUpdate struct

* support compressed update data

* Update API endpoint in index.rs

* Update hermes/src/api/types.rs

Co-authored-by: Ali Behjati <bahjatia@gmail.com>

* move to v2 module and address comments

* address more comments

* address more comments

---------

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2024-01-19 11:53:19 +00:00
Dev Kalra 009c5cdabe
[audit] Secrets appear in environment variables and command line arguments (#1201)
* accept secret as a file too

* run pre-commit

* address feedback
2024-01-04 14:47:33 +05:30
Ali Behjati 245cc231fd refactor(hermes): improve logging 2023-12-11 18:54:55 +01:00
Ali Behjati 93e9c49b60 fix(hermes): handle price feed removal properly 2023-12-07 18:20:31 +00:00
Ali Behjati d07579e0a6 feat(hermes): only return unique price updates on get_* methods 2023-10-27 17:01:42 +02:00
Ali Behjati 8bee2e8e12 chore(hermes): change level of some logs 2023-10-27 17:01:42 +02:00
Ali Behjati 6215460613 fix(hermes): fix metrics content-type
Openmetrics specification expects its own content-type instead of plain
text. I didn't set it before as Prometheus still accepts text format but
apparently there are some scrapers (like datadog) that decide
dynamically what format to use for parsing based on the content type and
our format follows Openmetrics specification. Prometheus should be able
to parse it but weirdly it didn't work in our situation. An example of
inconsistency is how counters are represented. In Openmetrics
specification the metric name is appended by `_total` whereas normal
prometheus just uses the metric name.
2023-10-20 13:16:11 +02:00
Ali Behjati 6db59ff6d1 fix(hermes): correct the metrics server env var 2023-10-19 12:46:38 +02:00
Ali Behjati 8075d0704e refactor(hermes): move metrics endpoint to a separate metrics server 2023-10-19 11:59:10 +02:00
Ali Behjati 29dc1082dd fix(hermes): handle ws notifier shut down properly 2023-10-19 11:59:10 +02:00
Ali Behjati cefdd84483 refactor(hermes): move docs_examples inside api 2023-10-19 11:59:10 +02:00
Ali Behjati 9da64103db feat(hermes): add metrics
Co-authored-by: Reisen <Reisen@users.noreply.github.com>
2023-10-18 15:04:10 +02:00
Ali Behjati d11216f309 feat(hermes): use ip from request headers for ratelimiting 2023-10-13 13:26:48 +02:00
Ali Behjati eb2fd83e61 fix(hermes): fix ip whitelisting logic 2023-10-11 19:02:25 +02:00
Ali Behjati bb922c3a17 fix(hermes): add lock for the entire message state
Before this change, there was a lock for each message and it could
cause the updateData for multiple ids have 2 updates (because of the
race with the thread updating the states). This change adds a RwLock
which makes sure that when the entire message state is updating,
no one can read from it while allowing concurrent reads in other
occasions.
2023-10-11 19:01:42 +02:00
Ali Behjati 0c25fccce5 chore(hermes): update wormhole config 2023-10-09 18:39:53 +02:00
Reisen 71307a1baa chore(hermes): bump to version 0.3.0, backwards incompatible CLI features/run mode 2023-10-09 09:14:12 +01:00
Reisen 2c0413dce4 feat(hermes): move to wormhole gRPC from p2p 2023-10-09 08:56:59 +01:00
Ali Behjati 1a64d58834 patch(hermes): improve ws reliability
- Add max message size for incoming messages
- Add sent message rate limit and ip whitelisting
2023-10-05 16:00:48 +02:00
Ali Behjati 916d9463b2 chore(hermes): bump major version 2023-09-28 17:16:54 +02:00
Ali Behjati 9714a851eb feat(hermes): Check price ids exist before each request
This check will make rejects faster (and block invalid requests
to benchmarks). The other benefit is that we can log the
errors from the get_price_feeds_with_update_data since it should
not fail anymore.
2023-09-28 11:10:51 +02:00
Reisen 80fe023174 refactor(hermes): wrap hex::serde for deserializing 2023-09-25 13:22:26 +01:00
Reisen 26b8dcdea9 refactor(hermes): move to clap_derive 2023-09-25 13:22:10 +01:00
Reisen 7ee97ce03c refactor(hermes): break up configuration 2023-09-25 13:22:10 +01:00
Ali Behjati f41cf822ff feat(hermes): drop additional signatures from VAAs
Co-authored-by: Reisen <Reisen@users.noreply.github.com>
2023-09-22 18:17:10 +02:00
Ali Behjati f533106100 feat(hermes): add prev_publish_time metadata 2023-09-22 13:30:30 +02:00
Ali Behjati 6d3579ea7d feat(hermes): add xlabs bootstrap 2023-09-21 14:01:57 +02:00
Reisen 4ce04a2abf feat(hermes): print libp2p peer addresses 2023-09-21 14:01:28 +02:00
Ali Behjati 272dbef9b3 fix(hermes): fix slot metadata bug 2023-09-20 11:37:05 +02:00
Ali Behjati 5e45146acb feat(hermes): add out of order subscription
Also improve the readiness probe

Co-authored-by: Reisen <Reisen@users.noreply.github.com>
2023-09-19 15:54:33 +02:00
Ali Behjati 7d7e09fe3a refactor(hermes): update tests 2023-09-19 13:08:11 +02:00
Ali Behjati 3a9df67ef2 refactor(hermes): move wormhole out of aggregate 2023-09-19 13:08:11 +02:00
Ali Behjati 09e2b17d1c refactor(hermes): rename store to aggregate 2023-09-19 13:08:11 +02:00
Reisen cbeada6c6d refactor(hermes): introduce Benchmarks trait 2023-09-19 13:08:11 +02:00
Reisen 263b80b1f7 refactor(hermes): introduce CacheStore 2023-09-19 13:08:11 +02:00
Reisen e144dd2bd0 refactor(hermes): removed `impl Store` 2023-09-19 13:08:11 +02:00
Ali Behjati 28f9b39444 doc(hermes): update readme 2023-09-13 10:31:32 +02:00
Ali Behjati 518ab13e03 refactor(hermes): use tokio sync primitives in p2p 2023-09-08 16:17:06 +02:00
Ali Behjati 7dc0cb80bf feat(hermes): add benchmarks for histroical data 2023-09-08 15:35:58 +02:00
Ali Behjati ed505d9e53 fix(hermes): improve tracing logs
- Add EnvFilter to respect RUST_LOG
- Disable ANSI if stderr is not a terminal
2023-09-05 19:12:14 +02:00
Reisen 860178f057 feat(hermes): add tracing 2023-09-05 13:50:20 +01:00
Reisen 0559b45936 feat(hermes): add datadog profiling 2023-09-01 11:58:43 +01:00
Reisen 85d5170ddb chore(hermes): visual clean up of Cargo.toml 2023-08-30 11:37:44 +01:00
Reisen ac8895cada ci: bump hermes version 2023-08-28 12:18:43 +02:00
Reisen 98f8ccb614 feat(hermes): add global info level logging for libp2p 2023-08-28 11:15:21 +01:00
Reisen 5edcce4530 refactor(hermes): clean exit 2023-08-26 12:02:28 +01:00
Reisen 71ce45698b refactor(hermes): move rpc endpoints into submodules 2023-08-21 15:06:43 +01:00
Reisen b74df4ff17 refactor(hermes): pass run args as struct, add docstrings
In some cases arguments are passed and renamed (see `api_addr -> rpc_addr`) or
are unnecesarily converted (see `api_addr.to_string()` -> `api_addr.parse()`.
In the future, we are likely to add many more arguments to Hermes as well, so
this commit moves them into a separate struct which is forwarded throughout the
application instead.

The struct's are cloned, but only happens during launch of a hermes service
component so the cost doesn't matter.
2023-08-21 13:43:44 +01:00