Commit Graph

122 Commits

Author SHA1 Message Date
agodnic d51695999a
[FLY] Remove duplicated code (#172)
Remove duplicated constants, use the definitions in the `common` package instead.
2023-03-06 14:36:40 -03:00
agodnic f169af3d37
[FLY] Fix an issue related to `.env` files (#173)
Fix an issue in which fly was not correctly populating the `P2P_NETWORK`
variable from an `.env` file.
2023-03-06 14:36:14 -03:00
agodnic c1dea6ea4d
[PARSER/PIPELINE] Update .gitignore (#174) 2023-03-06 14:35:53 -03:00
agodnic b3ec0bcc9e
[API] Fix pagination in `GET /api/v1/governor/notional/available/{chainId}` (#168)
### Summary

Changes:
* Fix `page` and `pageSize` parameters in `GET /api/v1/governor/notional/available/{chainId}`.
* Sort results by ascending guardian address to enforce deterministic output.

Tracking issue: https://github.com/wormhole-foundation/wormhole-explorer/issues/162
2023-03-01 10:44:27 -03:00
walker-16 9ba11aab24
Feataure/add analytic component (#164)
* Add Readme, dockerfile, go module init

* Add config package and main

* Add infrastructure package [health/ready]

* Add common lib

* Add http/queue package

* build healtcheck to influx cloud version

* Add vaa_count metric

* Enable pyth message
2023-02-28 17:58:26 -03:00
agodnic 533b83ad28
[API] Accept additional address formats (#170)
### Summary

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

This PR modifies all endpoints that receive an emitter/guardian address to accept a wider range of formats.
After this pull request, all of these are equivalent:
* `0x000000000000000000000000f890982f9310df57d00f659cf4fd87e65aded8d7`
* `000000000000000000000000f890982f9310df57d00f659cf4fd87e65aded8d7`
* `0xf890982f9310df57d00f659cf4fd87e65aded8d7`
* `f890982f9310df57d00f659cf4fd87e65aded8d7`

### Testing plan
* Added unit tests for the parsing code.
* Tested manually a few of the affected endpoints.
2023-02-28 17:50:23 -03:00
ftocal b1583d5e21
add ingress for api in staging and test environments (#169) 2023-02-28 15:44:45 -03:00
agodnic cd99c446e1
[API] Format governor queries for readability (#167) 2023-02-27 11:32:12 -03:00
agodnic 4cf7577a03
[API] Remove unused query params from swagger docs (#166)
### Summary

* Swagger: remove `sortOrder` query parameter from several endpoints in which it didn't make sense.
* Swagger: remove query params `page` and `pageSize` from endpoints that return a single object.
* Sort the output of `GET /api/v1/governor/config` by ascending id.
* Refactor: remove duplicated code, format code for readability.
2023-02-24 10:47:20 -03:00
agodnic 3e01b42f20
[API] Fix incorrect route in swagger docs (#165)
The API's swagger documentation exposes a route
`GET /api/v1/governor/max_available/:chain`,
but instead it should be
`GET /api/v1/governor/notional/max_available/:chain`.
2023-02-23 16:54:40 -03:00
ftocal 33440225a7
fix guardian healtcheck in fly (#160) 2023-02-16 13:23:50 -03:00
ftocal 1076173cd5
Add deployment for pipeline (#158)
Change deployment for parser

Co-authored-by: walker-16 <agpazos85@gmail.com>
2023-02-16 11:56:10 -03:00
ftocal 27d864d91c
pipeline: new component (#146)
* pipeline: new component consuming mongo watch and publishing to sns topic

* fix: use aws config with role
2023-02-16 11:09:57 -03:00
walker-16 cbb7956f90
Feature/refactor parser to use sns sqs (#148)
* Add README to configurate SNS and subscribe with parser FIFO SQS

* Remove producer and watcher, handler new queue vaa event message
2023-02-16 10:55:54 -03:00
walker-16 e40154bf01
Improve healthcheck process to check guardian heartbeats (#156)
Co-authored-by: ftocal <fert1335@gmail.com>
2023-02-13 17:28:34 -03:00
ftocal a926f3c409
Add https to api in test (#155) 2023-02-13 10:17:19 -03:00
agodnic 4ca0bf1c0e
[API] Several fixes in `GET /api/v1/governor/limit` (#153)
### Summary

Changes to `GET /api/v1/governor/limit`:
* Fix the behavior of the parameters `page` and `pageSize` (which previously were being ignored).
* When no results are found, return an HTTP status code of 200 and set the response to an empty array.
* Remove the `sortOrder` query parameter.

The rationale for removing the `sortOrder` parameter is that sorting chains by ascending/descending chain ID doesn't seem to be a useful operation.
2023-02-10 15:58:10 -03:00
agodnic e85fa82784
[API] Remove redundant checks (#150)
Remove redundant nil checks in `api/handlers/governor/repository.go`.
2023-02-10 15:57:11 -03:00
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