Skip to content

Conversation

arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Mar 26, 2024

PR-Codex overview

This PR focuses on optimizing Redis usage, improving webhook handling, and enhancing transaction processing.

Detailed summary

  • Improved Redis error handling and logging
  • Updated webhook handling logic
  • Enhanced transaction processing functions
  • Redis configuration changes for better performance

The following files were skipped due to too many changes: src/server/routes/configuration/wallets/update.ts, src/server/routes/configuration/auth/update.ts, src/worker/queues/workers.ts, src/server/routes/transaction/syncRetry.ts, src/worker/utils/withdraw.ts, src/server/routes/configuration/backend-wallet-balance/update.ts, src/server/routes/configuration/transactions/update.ts, src/db/webhooks/createWebhook.ts, src/server/routes/backend-wallet/sendTransaction.ts, src/worker/tasks/ingestWorker.ts, src/server/routes/configuration/events/update.ts, src/server/routes/configuration/chains/update.ts, .github/workflows/beta.yml, src/server/routes/configuration/cors/add.ts, src/server/routes/configuration/cors/remove.ts, src/server/routes/configuration/cors/set.ts, src/server/routes/configuration/cache/update.ts, src/worker/listeners/configListener.ts, src/db/transactions/getAllTxs.ts, src/utils/env.ts, src/utils/cache/getContractV5.ts, src/utils/redis/cache.ts, src/db/wallets/getWalletDetails.ts, src/server/routes/webhooks/getAll.ts, src/server/routes/transaction/getAllDeployedContracts.ts, src/db/webhooks/getAllWebhooks.ts, src/utils/cache/getWebhook.ts, src/server/routes/relayer/index.ts, src/worker/tasks/webhookWorker.ts, package.json, src/server/middleware/auth.ts, src/utils/cache/getConfig.ts, src/server/routes/backend-wallet/transfer.ts, src/server/routes/transaction/getAll.ts, src/worker/tasks/retryTx.ts, src/scripts/sync-config-from-postgres.ts, src/schema/transaction.ts, src/server/schemas/transaction/index.ts, src/utils/errors.ts, src/worker/tasks/updateMinedUserOps.ts, src/worker/queues/queues.ts, src/server/utils/simulateTx.ts, src/server/routes/backend-wallet/simulateTransaction.ts, src/utils/cache/getWallet.ts, src/db/transactions/updateTx.ts, src/server/routes/webhooks/create.ts, src/db/transactions/queueTx.ts, src/worker/tasks/updateMinedTx.ts, src/db/transactions/queueTxRaw.ts, src/utils/usage.ts, src/utils/webhook.ts, src/worker/tasks/processTx.ts, yarn.lock

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

zeet-co bot commented Mar 26, 2024

We're building your pull request over on Zeet.
Click me for more info about your build and deployment.
Once built, this branch can be tested at: https://web3-api-akbv-fk-beta.chainsaw-dev.zeet.app before merging 😉

Copy link

socket-security bot commented Mar 26, 2024

@farhanW3 farhanW3 changed the base branch from main to beta March 29, 2024 02:23
src/db/client.ts Outdated
export const getRedisClient = async (): Promise<Redis> => {
if (!isRedisReady) {
redisClient = new Redis(env.REDIS_URL, {
maxRetriesPerRequest: null,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear why this is needed but it looks like it fixes an issue. Add a comment to document?

minedAt: tx.minedAt?.toISOString() || null,
cancelledAt: tx.cancelledAt?.toISOString() || null,
processedAt: undefined,
queuedAt:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this instanceof Date needed? It should always be a Date when read from DB.

Comment on lines +52 to +55
throw createCustomError(
`Wallet with address ${walletAddress} was configured with unknown wallet type ${walletDetails.type}`,
400,
"BAD_REQUEST",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a low level helper func which really shouldn't know or imply anything about the caller's intent. So it shouldn't know what status code to set.

joaquim-verges and others added 8 commits April 2, 2024 09:59
* fix: add errorMessage to query to get queued txs

* remove unused files

* update thirdweb package

* getWalletBalance fix
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](follow-redirects/follow-redirects@v1.15.2...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copy link

socket-security bot commented Apr 4, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/aws-sdk@2.1589.0
  • Install script: postinstall
  • Source: node scripts/warn-maintenance-mode.js

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/aws-sdk@2.1589.0

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.

3 participants