Skip to content

upgrade etherjs version from v5 to v6#31

Merged
tak1827 merged 7 commits intomasterfrom
fix/support-pectra
Sep 30, 2025
Merged

upgrade etherjs version from v5 to v6#31
tak1827 merged 7 commits intomasterfrom
fix/support-pectra

Conversation

@tak1827
Copy link
Contributor

@tak1827 tak1827 commented Sep 17, 2025

こんな感じのType4サポートしてないエラーがでるので、etherjsのバージョンをPectraをサポートしてるバージョンv6.14.4まで上げた。

テストはパスすること確認。

npm run test
npm run test:e2e
verse-layer-opstack-proxy1-1  | Error: unsupported transaction type: 4 (operation="parseTransaction", transactionType=4, code=UNSUPPORTED_OPERATION, version=transactions/5.7.0)
verse-layer-opstack-proxy1-1  |     at Logger.makeError (/usr/src/app/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
verse-layer-opstack-proxy1-1  |     at Logger.throwError (/usr/src/app/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
verse-layer-opstack-proxy1-1  |     at Object.parse (/usr/src/app/node_modules/@ethersproject/transactions/src.ts/index.ts:494:19)
verse-layer-opstack-proxy1-1  |     at TransactionService.parseRawTx (/usr/src/app/src/services/transaction.service.ts:193:25)
verse-layer-opstack-proxy1-1  |     at ProxyService.sendTransaction (/usr/src/app/src/services/proxy.service.ts:137:31)
verse-layer-opstack-proxy1-1  |     at ProxyService.send (/usr/src/app/src/services/proxy.service.ts:85:27)
verse-layer-opstack-proxy1-1  |     at ProxyService.handleSingleRequest (/usr/src/app/src/services/proxy.service.ts:42:31)
verse-layer-opstack-proxy1-1  |     at ProxyController.handler (/usr/src/app/src/controllers/proxy.controller.ts:73:31)
verse-layer-opstack-proxy1-1  |     at ProxyController.post (/usr/src/app/src/controllers/proxy.controller.ts:36:16)
verse-layer-opstack-proxy1-1  |     at /usr/src/app/node_modules/@nestjs/core/router/router-execution-context.js:38:29 {
verse-layer-opstack-proxy1-1  |   reason: 'unsupported transaction type: 4',
verse-layer-opstack-proxy1-1  |   code: 'UNSUPPORTED_OPERATION',
verse-layer-opstack-proxy1-1  |   operation: 'parseTransaction',
verse-layer-opstack-proxy1-1  |   transactionType: 4
verse-layer-opstack-proxy1-1  | }

gasLimit: gasLimit.toString(),
to,
value,
value: value.toString(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

toStringにしないと、パースエラーがでる。
supertest側で起きてる。バージョン上げても解消しない。

{"statusCode":400,"message":"Unexpected token '\\"', \\"\\"[unable t\\"... is not valid JSON","error":"Bad Request"}

// Error: invalid argument 0: json: cannot unmarshal hex number
// with leading zero digits into Go struct field
// TransactionArgs.nonce of type hexutil.Uint64
toBeHex(v: string | bigint | number): string {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ethers.toBeHexを使うと、op-geth側でパースエラーが出るので。

Copy link
Collaborator

Choose a reason for hiding this comment

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

こちらが使えそうです https://docs.ethers.org/v6/api/utils/#toQuantity

Copy link
Contributor Author

Choose a reason for hiding this comment

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

置き換えました。

@tak1827 tak1827 marked this pull request as ready for review September 25, 2025 04:13
@tak1827 tak1827 requested a review from ironbeer September 25, 2025 04:13
@tak1827 tak1827 merged commit e0472a6 into master Sep 30, 2025
2 checks passed
@tak1827 tak1827 deleted the fix/support-pectra branch September 30, 2025 02:13
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.

2 participants