Skip to content

Commit cc9d710

Browse files
committed
Merge branch 'main' into ph/txWorkerRedis
2 parents 83e430e + 71c9242 commit cc9d710

File tree

9 files changed

+87
-7
lines changed

9 files changed

+87
-7
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ COPY . .
4242
# Prune dev dependencies from the packages
4343
RUN yarn install --frozen-lockfile --production=false --network-timeout 1000000 && \
4444
yarn build && \
45+
yarn copy-files && \
4546
yarn install --frozen-lockfile --production=true --network-timeout 1000000
4647

4748
##############################
@@ -64,4 +65,7 @@ COPY --from=build /app/node_modules ./node_modules
6465
COPY --from=build /app/src/prisma/* ./src/prisma/
6566
COPY --from=build /app/dist ./dist
6667

68+
# Replace the schema path in the package.json file
69+
RUN sed -i 's_"schema": "./src/prisma/schema.prisma"_"schema": "./dist/prisma/schema.prisma"_g' package.json
70+
6771
ENTRYPOINT [ "yarn", "start"]

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"start:docker-force-build": "docker compose --profile engine --env-file ./.env up --remove-orphans --build",
2323
"lint:fix": "eslint --fix 'src/**/*.ts'",
2424
"test:unit": "vitest",
25-
"test:coverage": "vitest run --coverage"
25+
"test:coverage": "vitest run --coverage",
26+
"copy-files": "copyfiles -u 2 ./src/prisma/* ./dist/prisma/ && copyfiles -u 3 ./src/prisma/migrations/**/*.sql ./dist/prisma/migrations/"
2627
},
2728
"dependencies": {
2829
"@aws-sdk/client-kms": "^3.398.0",
@@ -47,6 +48,7 @@
4748
"bullmq": "^5.11.0",
4849
"cookie": "^0.5.0",
4950
"cookie-parser": "^1.4.6",
51+
"copyfiles": "^2.4.1",
5052
"cron-parser": "^4.9.0",
5153
"crypto": "^1.0.1",
5254
"crypto-js": "^4.2.0",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE INDEX CONCURRENTLY "transactions_sentAt_minedAt_cancelledAt_errorMessage_queued_idx" ON "transactions"("sentAt", "minedAt", "cancelledAt", "errorMessage", "queuedAt");
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE INDEX CONCURRENTLY "transactions_sentAt_accountAddress_userOpHash_minedAt_error_idx" ON "transactions"("sentAt", "accountAddress", "userOpHash", "minedAt", "errorMessage", "retryCount");
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE INDEX CONCURRENTLY "transactions_sentAt_transactionHash_accountAddress_minedAt__idx" ON "transactions"("sentAt", "transactionHash", "accountAddress", "minedAt", "errorMessage", "nonce");
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE INDEX CONCURRENTLY "transactions_queuedAt_idx" ON "transactions"("queuedAt");

src/prisma/schema.prisma

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ model Transactions {
160160
sentAtBlockNumber Int? @map("sentAtBlockNumber")
161161
blockNumber Int? @map("blockNumber")
162162
163+
@@index([sentAt, minedAt, cancelledAt, errorMessage, queuedAt])
164+
@@index([sentAt, accountAddress, userOpHash, minedAt, errorMessage, retryCount])
165+
@@index([sentAt, transactionHash, accountAddress, minedAt, errorMessage, nonce])
166+
@@index([queuedAt])
163167
@@map("transactions")
164168
}
165169

src/scripts/setup-db.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const main = async () => {
1212
);
1313
`;
1414

15-
const schema = `./src/prisma/schema.prisma`;
15+
const schema =
16+
process.env.NODE_ENV === "production"
17+
? `./dist/prisma/schema.prisma`
18+
: `./src/prisma/schema.prisma`;
1619

1720
if (hasWalletsTable) {
1821
execSync(`yarn prisma migrate reset --force --schema ${schema}`, {

yarn.lock

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5718,6 +5718,19 @@ copy-anything@^3.0.2:
57185718
dependencies:
57195719
is-what "^4.1.8"
57205720

5721+
copyfiles@^2.4.1:
5722+
version "2.4.1"
5723+
resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.4.1.tgz#d2dcff60aaad1015f09d0b66e7f0f1c5cd3c5da5"
5724+
integrity sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==
5725+
dependencies:
5726+
glob "^7.0.5"
5727+
minimatch "^3.0.3"
5728+
mkdirp "^1.0.4"
5729+
noms "0.0.0"
5730+
through2 "^2.0.1"
5731+
untildify "^4.0.0"
5732+
yargs "^16.1.0"
5733+
57215734
core-util-is@~1.0.0:
57225735
version "1.0.3"
57235736
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
@@ -7222,7 +7235,7 @@ glob@^10.4.1:
72227235
package-json-from-dist "^1.0.0"
72237236
path-scurry "^1.11.1"
72247237

7225-
glob@^8.0.0, glob@^8.0.1:
7238+
glob@^8.0.0:
72267239
version "8.1.0"
72277240
resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e"
72287241
integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==
@@ -7810,6 +7823,11 @@ is64bit@^2.0.0:
78107823
dependencies:
78117824
system-architecture "^0.1.0"
78127825

7826+
isarray@0.0.1:
7827+
version "0.0.1"
7828+
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
7829+
integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==
7830+
78137831
isarray@^1.0.0, isarray@~1.0.0:
78147832
version "1.0.0"
78157833
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -8567,7 +8585,7 @@ minimalistic-crypto-utils@^1.0.1:
85678585
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
85688586
integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==
85698587

8570-
minimatch@^3.0.5, minimatch@^3.1.2:
8588+
minimatch@^3.0.3, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
85718589
version "3.1.2"
85728590
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
85738591
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
@@ -8845,6 +8863,14 @@ node-libs-browser@2.2.1:
88458863
util "^0.11.0"
88468864
vm-browserify "^1.0.1"
88478865

8866+
noms@0.0.0:
8867+
version "0.0.0"
8868+
resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859"
8869+
integrity sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==
8870+
dependencies:
8871+
inherits "^2.0.1"
8872+
readable-stream "~1.0.31"
8873+
88488874
normalize-path@^3.0.0, normalize-path@~3.0.0:
88498875
version "3.0.0"
88508876
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
@@ -9099,6 +9125,11 @@ path-exists@^4.0.0:
90999125
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
91009126
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
91019127

9128+
path-is-absolute@^1.0.0:
9129+
version "1.0.1"
9130+
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
9131+
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
9132+
91029133
path-key@^3.1.0:
91039134
version "3.1.1"
91049135
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
@@ -9746,7 +9777,7 @@ react-style-singleton@^2.2.1:
97469777
invariant "^2.2.4"
97479778
tslib "^2.0.0"
97489779

9749-
readable-stream@^2.0.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@^2.3.8:
9780+
readable-stream@^2.0.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@^2.3.8, readable-stream@~2.3.6:
97509781
version "2.3.8"
97519782
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b"
97529783
integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==
@@ -9779,6 +9810,16 @@ readable-stream@^4.0.0:
97799810
process "^0.11.10"
97809811
string_decoder "^1.3.0"
97819812

9813+
readable-stream@~1.0.31:
9814+
version "1.0.34"
9815+
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
9816+
integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==
9817+
dependencies:
9818+
core-util-is "~1.0.0"
9819+
inherits "~2.0.1"
9820+
isarray "0.0.1"
9821+
string_decoder "~0.10.x"
9822+
97829823
readdirp@~3.6.0:
97839824
version "3.6.0"
97849825
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
@@ -10292,6 +10333,11 @@ string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@^1.3.0:
1029210333
dependencies:
1029310334
safe-buffer "~5.2.0"
1029410335

10336+
string_decoder@~0.10.x:
10337+
version "0.10.31"
10338+
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
10339+
integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==
10340+
1029510341
string_decoder@~1.1.1:
1029610342
version "1.1.1"
1029710343
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
@@ -10499,6 +10545,14 @@ three@^0.146.0:
1049910545
resolved "https://registry.yarnpkg.com/three/-/three-0.146.0.tgz#fd80f0d128ab4bb821a02191ae241e4e6326f17a"
1050010546
integrity sha512-1lvNfLezN6OJ9NaFAhfX4sm5e9YCzHtaRgZ1+B4C+Hv6TibRMsuBAM5/wVKzxjpYIlMymvgsHEFrrigEfXnb2A==
1050110547

10548+
through2@^2.0.1:
10549+
version "2.0.5"
10550+
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"
10551+
integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==
10552+
dependencies:
10553+
readable-stream "~2.3.6"
10554+
xtend "~4.0.1"
10555+
1050210556
tildify@2.0.0:
1050310557
version "2.0.0"
1050410558
resolved "https://registry.yarnpkg.com/tildify/-/tildify-2.0.0.tgz#f205f3674d677ce698b7067a99e949ce03b4754a"
@@ -10757,6 +10811,11 @@ unstorage@^1.9.0:
1075710811
ofetch "^1.3.3"
1075810812
ufo "^1.4.0"
1075910813

10814+
untildify@^4.0.0:
10815+
version "4.0.0"
10816+
resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b"
10817+
integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==
10818+
1076010819
untun@^0.1.3:
1076110820
version "0.1.3"
1076210821
resolved "https://registry.yarnpkg.com/untun/-/untun-0.1.3.tgz#5d10dee37a3a5737ff03d158be877dae0a0e58a6"
@@ -11384,7 +11443,7 @@ xmlcreate@^2.0.4:
1138411443
resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be"
1138511444
integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==
1138611445

11387-
xtend@^4.0.0, xtend@^4.0.1:
11446+
xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1:
1138811447
version "4.0.2"
1138911448
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
1139011449
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
@@ -11454,7 +11513,7 @@ yargs@^15.3.1:
1145411513
y18n "^4.0.0"
1145511514
yargs-parser "^18.1.2"
1145611515

11457-
yargs@^16.2.0:
11516+
yargs@^16.1.0, yargs@^16.2.0:
1145811517
version "16.2.0"
1145911518
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
1146011519
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==

0 commit comments

Comments
 (0)