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

Switch server dependency from Express to Fastify #1638

Merged
merged 25 commits into from
May 12, 2022
Merged

Conversation

justinkaseman
Copy link
Member

@justinkaseman justinkaseman commented Mar 3, 2022

Description

Spike on profiling a more performant HTTP server dependency.

Changes

  • Switch Express for Fastify

Steps to Test

  1. Start an adapter
  2. Send a request to each EA server endpoint:
  • POST /
  • GET /health
  • GET /smoke

Quality Assurance

  • Ran yarn changeset if adapter source code was changed
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant <ADAPTER_PACKAGE>/schemas/env.json and <ADAPTER_PACKAGE>/README.md
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Clubhouse/Shortcut
  • This is related to a maximum of one Clubhouse/Shortcut story or GitHub issue
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types)

@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2022

🦋 Changeset detected

Latest commit: 0593cf7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 168 packages
Name Type
@chainlink/ea-bootstrap Minor
@chainlink/anchor-adapter Patch
@chainlink/apy-finance-adapter Patch
@chainlink/augur-adapter Patch
@chainlink/bitcoin-json-rpc-adapter Patch
@chainlink/bob-adapter Patch
@chainlink/bsol-price-adapter Patch
@chainlink/circuit-breaker-adapter Patch
@chainlink/crypto-volatility-index-adapter Patch
@chainlink/defi-dozen-adapter Patch
@chainlink/defi-pulse-adapter Patch
@chainlink/dns-record-check-adapter Patch
@chainlink/dxdao-adapter Patch
@chainlink/dydx-rewards-adapter Patch
@chainlink/google-weather-adapter Patch
@chainlink/historical-average-adapter Patch
@chainlink/implied-price-adapter Patch
@chainlink/linear-finance-adapter Patch
@chainlink/market-closure-adapter Patch
@chainlink/medianizer-adapter Patch
@chainlink/nftx-adapter Patch
@chainlink/outlier-detection-adapter Patch
@chainlink/por-indexer-adapter Patch
@chainlink/proof-of-reserves-adapter Patch
@chainlink/reference-transform-adapter Patch
@chainlink/savax-price-adapter Patch
@chainlink/set-token-index-adapter Patch
@chainlink/synth-index-adapter Patch
@chainlink/the-graph-adapter Patch
@chainlink/token-allocation-adapter Patch
@chainlink/vesper-adapter Patch
@chainlink/xsushi-price-adapter Patch
@chainlink/ea-factories Patch
@chainlink/ea-reference-data-reader Patch
@chainlink/example-composite-adapter Patch
@chainlink/example-source-adapter Patch
@chainlink/ea-scripts Patch
@chainlink/readme-test-adapter Patch
@chainlink/1forge-adapter Patch
@chainlink/accuweather-adapter Patch
@chainlink/ada-balance-adapter Patch
@chainlink/alphachain-adapter Patch
@chainlink/alphavantage-adapter Patch
@chainlink/amberdata-adapter Patch
@chainlink/anyblock-adapter Patch
@chainlink/ap-election-adapter Patch
@chainlink/armanino-adapter Patch
@chainlink/bea-adapter Patch
@chainlink/binance-dex-adapter Patch
@chainlink/binance-adapter Patch
@chainlink/bitex-adapter Patch
@chainlink/bitso-adapter Patch
@chainlink/blockchain.com-adapter Patch
@chainlink/blockchair-adapter Patch
@chainlink/blockcypher-adapter Patch
@chainlink/blocksize-capital-adapter Patch
@chainlink/blockstream-adapter Patch
@chainlink/bravenewcoin-adapter Patch
@chainlink/btc.com-adapter Patch
@chainlink/cache.gold-adapter Patch
@chainlink/celsius-address-list-adapter Patch
@chainlink/cfbenchmarks-adapter Patch
@chainlink/chain-reserve-wallet-adapter Patch
@chainlink/coinapi-adapter Patch
@chainlink/coinbase-adapter Patch
@chainlink/coincodex-adapter Patch
@chainlink/coingecko-adapter Patch
@chainlink/coinlore-adapter Patch
@chainlink/coinmarketcap-adapter Patch
@chainlink/coinmetrics-adapter Patch
@chainlink/coinpaprika-adapter Patch
@chainlink/coinranking-adapter Patch
@chainlink/covid-tracker-adapter Patch
@chainlink/cryptoapis-v2-adapter Patch
@chainlink/cryptoapis-adapter Patch
@chainlink/cryptocompare-adapter Patch
@chainlink/cryptoid-adapter Patch
@chainlink/cryptomkt-adapter Patch
@chainlink/currencylayer-adapter Patch
@chainlink/curve-adapter Patch
@chainlink/deribit-adapter Patch
@chainlink/dns-query-adapter Patch
@chainlink/dwolla-adapter Patch
@chainlink/dxfeed-secondary-adapter Patch
@chainlink/dxfeed-adapter Patch
@chainlink/ens-adapter Patch
@chainlink/enzyme-adapter Patch
@chainlink/eodhistoricaldata-adapter Patch
@chainlink/eth-balance-adapter Patch
@chainlink/etherchain-adapter Patch
@chainlink/etherscan-adapter Patch
@chainlink/ethgasstation-adapter Patch
@chainlink/ethgaswatch-adapter Patch
@chainlink/expert-car-broker-adapter Patch
@chainlink/fcsapi-adapter Patch
@chainlink/finage-adapter Patch
@chainlink/finnhub-adapter Patch
@chainlink/fixer-adapter Patch
@chainlink/flightaware-adapter Patch
@chainlink/fmpcloud-adapter Patch
@chainlink/galaxis-adapter Patch
@chainlink/gemini-adapter Patch
@chainlink/genesis-volatility-adapter Patch
@chainlink/geodb-adapter Patch
@chainlink/google-bigquery-adapter Patch
@chainlink/gramchain-adapter Patch
@chainlink/graphql-adapter Patch
@chainlink/iex-cloud-adapter Patch
@chainlink/intrinio-adapter Patch
@chainlink/ipfs-adapter Patch
@chainlink/jpegd-adapter Patch
@chainlink/json-rpc-adapter Patch
@chainlink/kaiko-adapter Patch
@chainlink/layer2-sequencer-health-adapter Patch
@chainlink/lcx-adapter Patch
@chainlink/linkpool-adapter Patch
@chainlink/lition-adapter Patch
@chainlink/lotus-adapter Patch
@chainlink/marketstack-adapter Patch
@chainlink/messari-adapter Patch
@chainlink/metalsapi-adapter Patch
@chainlink/mock-ea-adapter Patch
@chainlink/mycryptoapi-adapter Patch
@chainlink/ncfx-adapter Patch
@chainlink/nikkei-adapter Patch
@chainlink/nomics-adapter Patch
@chainlink/oilpriceapi-adapter Patch
@chainlink/onchain-gas-adapter Patch
@chainlink/openexchangerates-adapter Patch
@chainlink/orchid-bandwidth-adapter Patch
@chainlink/paxos-adapter Patch
@chainlink/paypal-adapter Patch
@chainlink/poa-adapter Patch
@chainlink/polygon-adapter Patch
@chainlink/reduce-adapter Patch
@chainlink/renvm-address-set-adapter Patch
@chainlink/satoshitango-adapter Patch
@chainlink/snowflake-adapter Patch
@chainlink/sochain-adapter Patch
@chainlink/solana-view-function-adapter Patch
@chainlink/spectral-macro-score-adapter Patch
@chainlink/sportsdataio-adapter Patch
@chainlink/stasis-adapter Patch
@chainlink/synthetix-debt-pool-adapter Patch
@chainlink/taapi-adapter Patch
@chainlink/terra-view-function-adapter Patch
@chainlink/therundown-adapter Patch
@chainlink/tiingo-adapter Patch
@chainlink/tradermade-adapter Patch
@chainlink/tradingeconomics-adapter Patch
@chainlink/trueusd-adapter Patch
@chainlink/twelvedata-adapter Patch
@chainlink/unibit-adapter Patch
@chainlink/uniswap-v2-adapter Patch
@chainlink/uniswap-v3-adapter Patch
@chainlink/upvest-adapter Patch
@chainlink/uscpi-one-adapter Patch
@chainlink/view-function-adapter Patch
@chainlink/wbtc-address-set-adapter Patch
@chainlink/wootrade-adapter Patch
@chainlink/wrapped-adapter Patch
@chainlink/xbto-adapter Patch
@chainlink/agoric-adapter Patch
@chainlink/conflux-adapter Patch
@chainlink/dydx-stark-adapter Patch
@chainlink/ethwrite-adapter Patch
@chainlink/harmony-adapter Patch
@chainlink/ea Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@justinkaseman justinkaseman temporarily deployed to QA March 3, 2022 18:21 Inactive
@austinborn
Copy link
Contributor

Is there an easy way to compare metrics of express vs. the fastify servers? Just curious if we can quantify the improvement.

@bogos bogos temporarily deployed to QA April 26, 2022 15:02 Inactive
@bogos bogos temporarily deployed to QA April 28, 2022 16:32 Inactive
@bogos bogos temporarily deployed to QA April 28, 2022 19:47 Inactive
@bogos bogos temporarily deployed to QA May 1, 2022 01:05 Inactive
@bogos bogos temporarily deployed to QA May 1, 2022 01:15 Inactive
@bogos bogos temporarily deployed to QA May 2, 2022 14:56 Inactive
@bogos bogos temporarily deployed to QA May 3, 2022 19:09 Inactive
@bogos bogos temporarily deployed to QA May 4, 2022 14:45 Inactive
@bogos bogos temporarily deployed to QA May 4, 2022 15:42 Inactive
@bogos bogos marked this pull request as ready for review May 4, 2022 15:48
@bogos bogos temporarily deployed to QA May 4, 2022 17:40 Inactive
@bogos bogos temporarily deployed to QA May 4, 2022 20:21 Inactive
@bogos bogos temporarily deployed to QA May 4, 2022 20:22 Inactive
@justinkaseman
Copy link
Member Author

@bogos we will need a changeset here too. I'd call it a minor version bump since there are no breaking changes to the end user.

@bogos bogos temporarily deployed to QA May 5, 2022 12:44 Inactive
@boxhock
Copy link
Contributor

boxhock commented May 5, 2022

Need to watch out for #1843. Anything added in that PR needs to be reflected in this PR.

@bogos bogos temporarily deployed to QA May 11, 2022 21:45 Inactive
@boxhock boxhock merged commit f99b275 into develop May 12, 2022
@boxhock boxhock deleted the feature/sc-27181 branch May 12, 2022 16:20
@boxhock boxhock temporarily deployed to QA May 12, 2022 16:20 Inactive
mjk90 pushed a commit that referenced this pull request May 12, 2022
* Switch server dependency from Express to Fastify

* develop rebase and fix server address port

* update bootstrap unit test with fastify and fix server address port in missing integration EA

* add fastify type and test example

* update EA tests with fastify server

* remove fastify comment from @chainlink/types

* fix test problem with agoric EA

* update helpers server with fastify

* remove express dependencies

* remove unused code

* update missing file

* add changeset

* remove http import in each EA

* rename server variable name

* remove hardcoded host

* replace with arrow function

* remove missing http imports

* code refactor

* merge .pnp.cjs

* udpate with fastify blocksize-capital test, remove unused nock import

* update ens integration test with fastify

* fix problem with bootstrap tests, update status code and adding deleted customErrorMessage

* fix problem with server log

* change changeset and server log message

* merge develop

Co-authored-by: bogos <andre.neyra@gmail.com>
mjk90 added a commit that referenced this pull request May 17, 2022
* Added GSR websocket adapter to sources

* Added GSR websocket adapter integration tests

* Added GSR README, updated env.json

* Added changeset

* Switch server dependency from Express to Fastify (#1638)

* Switch server dependency from Express to Fastify

* develop rebase and fix server address port

* update bootstrap unit test with fastify and fix server address port in missing integration EA

* add fastify type and test example

* update EA tests with fastify server

* remove fastify comment from @chainlink/types

* fix test problem with agoric EA

* update helpers server with fastify

* remove express dependencies

* remove unused code

* update missing file

* add changeset

* remove http import in each EA

* rename server variable name

* remove hardcoded host

* replace with arrow function

* remove missing http imports

* code refactor

* merge .pnp.cjs

* udpate with fastify blocksize-capital test, remove unused nock import

* update ens integration test with fastify

* fix problem with bootstrap tests, update status code and adding deleted customErrorMessage

* fix problem with server log

* change changeset and server log message

* merge develop

Co-authored-by: bogos <andre.neyra@gmail.com>

* Updated gsr integration test to use fastify

* Updated gsr token error handling

Co-authored-by: Justin Kaseman <justinkaseman@live.com>
Co-authored-by: bogos <andre.neyra@gmail.com>
alejoberardino added a commit that referenced this pull request May 17, 2022
* Release/v1.23.0 (#1858)

* (feat): Add ENS adapter (#1841)

* (feat): Add ENS adapter

* Allow framework WARMUP_ENABLED override

* (test): ENS adapter tests

* Add changesets

* Refresh yarn.lock

* chore(deps): update dependency golang to v1.17.10 (#1853)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update dependency @types/supertest to v2.0.12 (#1852)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>

* Switch server dependency from Express to Fastify (#1638)

* Switch server dependency from Express to Fastify

* develop rebase and fix server address port

* update bootstrap unit test with fastify and fix server address port in missing integration EA

* add fastify type and test example

* update EA tests with fastify server

* remove fastify comment from @chainlink/types

* fix test problem with agoric EA

* update helpers server with fastify

* remove express dependencies

* remove unused code

* update missing file

* add changeset

* remove http import in each EA

* rename server variable name

* remove hardcoded host

* replace with arrow function

* remove missing http imports

* code refactor

* merge .pnp.cjs

* udpate with fastify blocksize-capital test, remove unused nock import

* update ens integration test with fastify

* fix problem with bootstrap tests, update status code and adding deleted customErrorMessage

* fix problem with server log

* change changeset and server log message

* merge develop

Co-authored-by: bogos <andre.neyra@gmail.com>

* Increased sleep period in finage integration test to ensure cache is populated (#1863)

* Consume changesets (#1860)

* Consume changesets

* restarting workflow

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Morgan Kuphal <morgan.kuphal@smartcontract.com>

* chore(deps): update dependency hardhat to v2.9.5

* fix(deps): update dependency airtable to v0.11.4 (#1867)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix(deps): update dependency ethers to v5.5.4 (#1868)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>

* chore(deps): update dependency @types/node to v14.18.18 (#1865)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>

* chore(deps): update dependency @types/node to v16.11.35 (#1869)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>

* Fix default EA host, add EA_HOST env var (#1871)

* Consume changesets

* Fix batch cache key generation by ignoring overrides & other excl props (#1875)

* Consume changesets (#1873)

* Consume changesets

* Empty commit

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Austin Born <austinborn212@gmail.com>

* Release v1.24.0

Co-authored-by: Morgan Kuphal <87319522+KuphJr@users.noreply.github.com>
Co-authored-by: Justin Kaseman <justinkaseman@live.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>
Co-authored-by: bogos <andre.neyra@gmail.com>
Co-authored-by: Matthew Kelly <mkelly2@live.co.uk>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Morgan Kuphal <morgan.kuphal@smartcontract.com>
Co-authored-by: Austin Born <austinborn212@gmail.com>
cds95 added a commit that referenced this pull request May 23, 2022
* Release v1.22.0

* Release v1.23.0

* Release/v1.24.0 (#1877)

* Release/v1.23.0 (#1858)

* (feat): Add ENS adapter (#1841)

* (feat): Add ENS adapter

* Allow framework WARMUP_ENABLED override

* (test): ENS adapter tests

* Add changesets

* Refresh yarn.lock

* chore(deps): update dependency golang to v1.17.10 (#1853)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update dependency @types/supertest to v2.0.12 (#1852)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>

* Switch server dependency from Express to Fastify (#1638)

* Switch server dependency from Express to Fastify

* develop rebase and fix server address port

* update bootstrap unit test with fastify and fix server address port in missing integration EA

* add fastify type and test example

* update EA tests with fastify server

* remove fastify comment from @chainlink/types

* fix test problem with agoric EA

* update helpers server with fastify

* remove express dependencies

* remove unused code

* update missing file

* add changeset

* remove http import in each EA

* rename server variable name

* remove hardcoded host

* replace with arrow function

* remove missing http imports

* code refactor

* merge .pnp.cjs

* udpate with fastify blocksize-capital test, remove unused nock import

* update ens integration test with fastify

* fix problem with bootstrap tests, update status code and adding deleted customErrorMessage

* fix problem with server log

* change changeset and server log message

* merge develop

Co-authored-by: bogos <andre.neyra@gmail.com>

* Increased sleep period in finage integration test to ensure cache is populated (#1863)

* Consume changesets (#1860)

* Consume changesets

* restarting workflow

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Morgan Kuphal <morgan.kuphal@smartcontract.com>

* chore(deps): update dependency hardhat to v2.9.5

* fix(deps): update dependency airtable to v0.11.4 (#1867)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix(deps): update dependency ethers to v5.5.4 (#1868)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>

* chore(deps): update dependency @types/node to v14.18.18 (#1865)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>

* chore(deps): update dependency @types/node to v16.11.35 (#1869)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>

* Fix default EA host, add EA_HOST env var (#1871)

* Consume changesets

* Fix batch cache key generation by ignoring overrides & other excl props (#1875)

* Consume changesets (#1873)

* Consume changesets

* Empty commit

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Austin Born <austinborn212@gmail.com>

* Release v1.24.0

Co-authored-by: Morgan Kuphal <87319522+KuphJr@users.noreply.github.com>
Co-authored-by: Justin Kaseman <justinkaseman@live.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>
Co-authored-by: bogos <andre.neyra@gmail.com>
Co-authored-by: Matthew Kelly <mkelly2@live.co.uk>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Morgan Kuphal <morgan.kuphal@smartcontract.com>
Co-authored-by: Austin Born <austinborn212@gmail.com>

* 1.25.0

* update master

Co-authored-by: Jonas Hals <jonas@smartcontract.com>
Co-authored-by: Austin Born <austinborn212@gmail.com>
Co-authored-by: Morgan Kuphal <morgan.kuphal@smartcontract.com>
Co-authored-by: Morgan Kuphal <87319522+KuphJr@users.noreply.github.com>
Co-authored-by: Alejo Berardino <alejoberardino@gmail.com>
Co-authored-by: Justin Kaseman <justinkaseman@live.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: karen-stepanyan <91897037+karen-stepanyan@users.noreply.github.com>
Co-authored-by: bogos <andre.neyra@gmail.com>
Co-authored-by: Matthew Kelly <mkelly2@live.co.uk>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

None yet

5 participants