Commit Graph

154 Commits

Author SHA1 Message Date
agodnic e2195d420e
[API] Fix issue in MongoDB aggregation pipeline (#147)
### Summary

In some cases, the query parameters for a MongoDB aggregation pipeline were not being initialized.

This led to errors in `GET /api/v1/vaas/{chain}/{emitter}/{seq}`. 
Other endpoints could also have been affected.
2023-02-10 15:55:45 -03:00
agodnic c4b2e792b3
[API] Change status code for enqueued VAAs endpoint (#151)
Previously, when calling `GET /api/v1/governor/enqueued_vaas`, it returned a status code of 404 when there were no enqueued VAAs.

Now, the endpoint returns a status code of 200, and the response body contains an empty array.
2023-02-10 14:31:33 -03:00
agodnic dde87acf84
[API] Several fixes related to pagination (#144)
### Summary
* On all endpoints, fix the behavior of the `page` parameter (which was previously being ignored).
* On `GET /api/v1/vaas`, fix the behavior of the `sortBy` parameter (which wasn't working when `parsedPayload=true`).
* For all endpoints, validate the query parameters `page`, `pageNumber` and `sortOrder`.
* Return descriptive errors when pagination-related parameters happen to be invalid (`page`, `pageSize`, `sortOrder`).
* Validate guardian addresses in query params.

### Testing plan
All parameters involved were manually tested.
2023-02-09 14:28:39 -03:00
ftocal b033c04a13
fix spy and fly deploment (#140) 2023-02-06 11:12:15 -03:00
gipsh a155e6c99f add make to docker 2023-02-05 09:52:56 -03:00
walker-16 bb1fc8c3e2
feature/fix_api_v1_governor_responses_to_camelcase (#136) 2023-02-03 18:46:16 -03:00
agodnic 9018d9a51a
[API] Remove duplicated model for VAAs (#135)
The structs `VaaDoc` and `VaaWithPayload` were being used for similar purposes.

This commit merges both into the same struct.
2023-02-03 16:46:02 -03:00
ftocal 84e4fba5a1
Improve logs for health/ready endpoints (#133)
* Improve logs for health/ready endpoints in fly

* Improve logs for health/ready endpoints in spy

* Improve logs for health/ready endpoints in parser
2023-02-03 15:58:58 -03:00
agodnic 38c8e82879
[API] Remove unused path parameters (#131)
Remove unused path parameters in `GET /api/v1/vaas/{chain_id}/{emitter}/{seq}`
2023-02-03 15:44:46 -03:00
walker-16 7506ff0bf5
Add pprof all components (#134)
* Fix Config pprof in fly

* Refactor pprof explorer parser component

* Add pprof to spy component

* Add pprof to api [api/v1, /v1]
2023-02-03 15:18:44 -03:00
walker-16 6c54c8b8a1
Improves to deployment file in testing/staging (#130)
* Fix spy service deploy config

* Reduce parser pod memory

* Reduce fly replicas and change memory size

* Resize cpu & memory api [testnet]

* Fix replicas and size cpu memory componentes testnet

* delete image-name spy staging

Co-authored-by: ftocal <fert1335@gmail.com>

---------

Co-authored-by: ftocal <fert1335@gmail.com>
2023-02-02 17:31:41 -03:00
walker-16 ab0c42ed87
Update deployment config (#128) 2023-02-02 16:01:05 -03:00
agodnic 69dce95474
Build API swagger on github workflows (#123)
This will help prevent the swagger docs from breaking.
2023-02-02 15:07:09 -03:00
ftocal 7fba3537a1
Fix: fly memory leaks in sqs consumer (#126) 2023-02-02 14:51:33 -03:00
ftocal 821071086d
Fix: parser memory leaks in sqs consumer (#122)
Co-authored-by: walker-16 <agpazos85@gmail.com>
2023-02-02 14:42:23 -03:00
agodnic a6cb972eb1
[FLY] Improve VAA signature verification (#121)
### Summary

Before this PR, when validating a VAA, we were always using the latest guardian set index to verify the signatures.
With this PR, we're making the signature verification against `vaa.guardianSetIndex` instead.

Context: https://github.com/wormhole-foundation/wormhole-explorer/issues/104

### Testing plan
* Added unit test cases
* Also tested manually
2023-02-02 10:17:42 -03:00
agodnic d32405f737
[API] Update swagger docs (#120)
Co-authored-by: Agustin Godnic <agustin@xlabs.xyz>
2023-02-01 14:11:40 -03:00
gipsh 0f47b6d64d
add version endpoint (#118)
Co-authored-by: gipsh <gipsh@gmail.com>
2023-02-01 10:46:22 -03:00
agodnic cd976bac96
[API] Add appId parameter to GET /api/v1/vaas (#114)
Add the `appId` query parameter to `GET /api/v1/vaas`.
2023-02-01 09:59:51 -03:00
ftocal 7a62307899
fix: handle messages when the client is down (#115) 2023-02-01 09:31:15 -03:00
walker-16 cd29aaeb4d
Add filter methods vaa/observations testnet (#117) 2023-02-01 09:20:10 -03:00
gipsh dcea5b2332
pass context to missing funcs (#116)
add missiong context

Co-authored-by: gipsh <gipsh@gmail.com>
2023-02-01 06:43:07 -03:00
agodnic ed0985d502
[API] Add parsed payloads to `GET /api/v1/vaas` (#113)
Add query parameter `parsedPayload` to the endpoint `GET /api/v1/vaas`.
2023-01-31 15:24:34 -03:00
walker-16 1c7e58a27a
Handle guardianSet by p2p enviroment in fly/api (#112) 2023-01-31 11:38:17 -03:00
walker-16 f65796b0fc
Get p2p network configuration by env vars (#109) 2023-01-30 15:51:13 -03:00
gipsh 2db8f58092
Fly backfiller (#106)
* change repo to support backfill of txhash

* generic backfiller for vaas and txhash

* update deps

* remove unused code

---------

Co-authored-by: gipsh <gipsh@gmail.com>
2023-01-30 10:20:38 -03:00
walker-16 ca6710d5d5
Add parsedPayload query param to /vaa/:chainID/:address/:sequence (#102) 2023-01-27 13:47:17 -03:00
agodnic e929104ed9
[API] split api/v1 and v1 routing in different files (#101)
### Summary

Split `/v1` and `/api/v1` controllers into different packages (respectively `api/routes/guardian` and `api/routes/wormscan`).

Still need to move services/repositories/models according to the new package layout.
2023-01-27 12:58:37 -03:00
ftocal 215a00ccc8
fix: use txHash from observation (#100) 2023-01-26 17:58:37 -03:00
walker-16 f23f9f78ab
Enabled pprof fly and enable cors at app group in explorer api (#99) 2023-01-26 14:55:27 -03:00
walker-16 9933fb0d9d
Change aws sdk to v2, to fix memory leak long pooling (#95) 2023-01-26 14:15:39 -03:00
agodnic 2a5b4db51a
[API] Fix issues related to swaggo v1.8.10 (#96)
### Summary

Updating from swaggo v1.8.9 to v1.8.10 caused issues with the generated swagger file.

The issue was solved by moving the handler for `GET /swagger.json` outside the `/doc` directory.
2023-01-26 12:04:01 -03:00
ftocal e20e73c636
Add txHash in VAA (#94)
* add vaaId and txHash relation in vaaIdTxHash collection

* add txHash in vaas collection

* add txHash in response vaa and as filter in find vaas endpoints
2023-01-26 11:54:41 -03:00
agodnic b6266b0776
[API] Fix typo in package name (#92)
Fix typo in package name
2023-01-26 11:00:02 -03:00
agodnic 0a382a0a5c
[API] Add route `GET /swagger.json` (#91)
Expose the API's swagger spec under the route `GET /swagger.json`
2023-01-26 10:32:20 -03:00
agodnic 6022d5fd14
[API] Increase documentation coverage (#90)
Add swagger documentation for all endpoints.

This addresses https://github.com/wormhole-foundation/wormhole-explorer/issues/68
2023-01-25 16:19:14 -03:00
agodnic cc1f1b440f
[API] Increase swagger documentation coverage (#89)
Add documentation coverage for endpoints related to VAAs.
2023-01-24 17:58:04 -03:00
ftocal 2f11affc53
fix: remove enqueued vaas duplicated (#88) 2023-01-24 16:01:00 -03:00
agodnic d93613b833
[API/FLY/SPY] Update .gitignore (#87)
Ignore files generated by `make build`
2023-01-24 12:02:41 -03:00
ftocal 11e1718317
add libwasmvm and common libraries in fly image (#84) 2023-01-24 09:45:07 -03:00
gipsh f4f543fc95
create cicd pipeline for deployments to staging environment - step 1 (#71)
* add missing makefiles and fix deps

* add parser makefile and github action for PR

* fix warning

* fix printf

Co-authored-by: gipsh <gipsh@gmail.com>
2023-01-23 18:41:19 -03:00
walker-16 2283e84ed6
Enabled pprof parser component (#83) 2023-01-23 16:40:39 -03:00
ftocal 70bf3f1059
update sdk wormhole (#82) 2023-01-23 16:13:59 -03:00
walker-16 5225cc13fa
Feature/add grpc support (#73)
* Add grpc web support

* Add endpoints GRPC
- GovernorGetAvailableNotionalByChain
- GovernorGetEnqueuedVAAs
- GovernorIsVAAEnqueued
- GovernorGetTokenList

* Add endpoint GRPC - GetSignedVAA, GetSignedBatchVAA, GetLastHeartbeats, GetCurrentGuardianSet

Co-authored-by: Fernando Torres <fert1335@gmail.com>
2023-01-23 11:45:09 -03:00
walker-16 cf274f1fd8
Fix counter int to string heartbeats endpoint (#70) 2023-01-20 13:38:40 -03:00
ftocal 9c069aabc3
Add k8s deployment for parser (#63) 2023-01-19 12:42:18 -03:00
walker-16 fcc6e4e5e4
Fix api deployment [health/ready] (#62) 2023-01-18 15:31:04 -03:00
ftocal 303b731d60
Feature/add parser pipeline (#46)
* Add pipeline to parse vaa

* Add parser repository and start building pipeline publisher

* Add queue sqs and in-memory to pipeline

* Add ses publisher and queue sqs/memory

* Fix watcher query

* Fix type to marshall/unsmarshall chainID and emitterAddress

* Fix js execution is run many times

* Add comments

* Add comments and improvements

* Change VAA Parser implementation

* Fix and change integration-test vaa-payload-parser

* fix appID mongo field name

* Fix guardianSet version 3, add xlabs to position 8

Co-authored-by: Agustin Pazos <agpazos85@gmail.com>
2023-01-18 12:42:14 -03:00
Gabriel Zimmermann b5e5ce73c5
Query pythnet collection for pyth chain id in api (#57)
* Query pythnet collection for pyth chain id in api

* Delete api/vq FindForPythnet endpoint

Co-authored-by: Agustin Pazos <agpazos85@gmail.com>
2023-01-18 12:33:26 -03:00
walker-16 669fe6d16e
Fix observation endpoints, change setHash to hash (#61) 2023-01-18 12:31:25 -03:00