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.
Fix hermes construct_update_data to support generating update_data
for more than 255 messages. This is very unlikely to happen in normal
cases but the way WS <> store interact can cause this to happen when
a WS client subscribes to all price feeds.
Some WS clients were receiving "Abnormal Connection Closure" errors.
This commit fixes the issue by sending specific close message upon
receiving close message from client. This commit also refactors the
ws.rs code by making it simpler and using tokio::time::Interval
instead of a manually implemented interval. Lastly, it updates the
axum package to include newer patches.
- Remove Storage trait and LocalStorage and implement everything on Storage struct
- Remove update_accumulator_state and break it down to accumulator_messages and
wormhole_merkle_state
feat: use pythnet serialization in hermes
Fix vaa validation
Clippy
Update config names
Wrap Store with Arc
Store works perfectly without Arc as all it's elements are behind an Arc
or something similar to that, however a developer might make
mistake to add a field and missing it.
Improve error handling
Update metadata struct
Add metadata
Update Eth listener
Pin wormhole to a version
Fix ws dispatcher
fix: blocking in go recv corrupts tokio runtime
Make network <> store message passing non-blocking
Update logs and revert debug changes
* Format p2p.go
* Pass Wormhole arguments from command line or env. vars
* Remove forget calls and let memory be freed (also remove confusing comment)
* Use proper types on command line arguments
* [hermes] Improve latest feeds rest api
This change adds verbose and binary option to latest_price_feeds
endpoint. Unfortunately it exposes many internal information which
required touching different components to expose batch_vaa specific
information. The code is now coupled to batch_vaa and we need to
refactor it when we add other proof types (and eventually remove it when
it get deprecated).
* Update hermes/src/network/rpc/rest.rs
Co-authored-by: Reisen <Reisen@users.noreply.github.com>
* Update hermes/src/network/rpc/rest.rs
Co-authored-by: Reisen <Reisen@users.noreply.github.com>
* Fix merge
---------
Co-authored-by: Reisen <Reisen@users.noreply.github.com>
* [hermes] Add more rest api methods
Add many of the price service apis. Per David suggestion, we do
validation in parsing instead of doing it later. I didn't find
any suitable library to deserialize our hex format so I created
a macro to implement it because we use it in a couple of places.
I tried making a generic HexInput but couldn't make it working
(and I need other crates like generic_array for it which makes
the code more complex)
* Address feedbacks