defender-client icon indicating copy to clipboard operation
defender-client copied to clipboard

ethers v6

Open aleciten opened this issue 2 years ago • 16 comments
trafficstars

Any plans to upgrade relayer to use ethers v6?

aleciten avatar Jul 14 '23 23:07 aleciten

I'm also interested in this topic

xkelxmc avatar Aug 08 '23 11:08 xkelxmc

Wen ethers v6?

Hicham010 avatar Aug 22 '23 09:08 Hicham010

It's been a year since the release of ethers.js v6. Many projects are now based on v6, and downgrading to v5 just for Defender is difficult. I urge you to promptly support ethers.js v6.

fumiyamizuguchi avatar Sep 15 '23 14:09 fumiyamizuguchi

What's the status on this? @shahnami @spalladino @tirumerla @MCarlomagno

froggiedev avatar Nov 23 '23 00:11 froggiedev

What's the status on this? @shahnami @spalladino @tirumerla @MCarlomagno

Hello @froggiedev apologies for the late reply. We have this item in our todo list and we are planning to tackle it in next few weeks. We will keep you updated once it's released.

tirumerla avatar Dec 04 '23 23:12 tirumerla

Hello Folks, we released ethers v6 support in the latest defender-sdk package. You can use defender-sdk package with defender 2.0. Please let us know if this works for you or any feedback you may have on defender-sdk packages. We are looking into adding ethers v6 to defender-client packages but timeline is unknown. We also have plans to deprecate defender-client packages soon would recommend switching to defender-sdk if it works for your usecases.

Please let me know if you have any questions.

tirumerla avatar Dec 13 '23 17:12 tirumerla

Awesome news!, we'll try it out and let you guys know.

Thanks

aleciten avatar Dec 18 '23 19:12 aleciten

The relay package in defender-sdk is still using ethers5. Are you planning on upgrading this this to 6?

Reference: https://github.com/OpenZeppelin/defender-client/blob/c94b20e1b96c9d856a444d07bba62ba93ec9ec12/packages/relay/package.json#L24

stewart-lore avatar Jan 16 '24 21:01 stewart-lore

Hi @stewart-lore that's correct, we upgraded ethers from v5 to v6, but we still are using 5.x version for abstract-provider, there is no such dependency for ethers 6 so we are working on migrating and, ideally, remove them. This is planned to happen in the following weeks

MCarlomagno avatar Jan 16 '24 22:01 MCarlomagno

I've tried using @openzeppelin/defender-sdk v1.9.0 with ethers v6.10.0 but its incompatible when using the relay signer.

When I try and wait for a transaction to be mined using const receipt = await tx.wait(), I get the following error

/primestaked-eth/node_modules/ethers/src.ts/providers/provider.ts:1516
                if ((await receipt.confirmations()) >= confirms) {
                                   ^
TypeError: receipt.confirmations is not a function
    at DefenderRelayProvider.txListener (/primestaked-eth/node_modules/ethers/src.ts/providers/provider.ts:1516:36)
    at Timeout._onTimeout (/primestaked-eth/node_modules/@ethersproject/providers/src.ts/base-provider.ts:2137:32)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7)

ethers.js v6 changed confirmations from a number in v5 to a promise that resolves a number.

Ethers v5 TransactionResponse https://docs.ethers.org/v5/api/providers/types/#providers-TransactionResponse

Ethers v6 TransactionResponse https://docs.ethers.org/v6/api/providers/#TransactionReceipt-confirmations

naddison36 avatar Feb 07 '24 11:02 naddison36

The best way to replicate the Ethers v6 compatibility issue of the relay signer is to run the ethers-signer example in the Defender SDK. It uses Ethers v6 and is currently failing

naddison36 avatar Feb 07 '24 21:02 naddison36

For anyone using Hardhat, you'll need to down the hardhat-chai-matchers and hardhat-ethers dependencies to work with Ethers v5. Here's what I'm using

    "@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
    "@nomiclabs/hardhat-ethers": "^2.2.3",
    "@openzeppelin/defender-sdk": "^1.9.0",
    "ethers": "^5.7.2",
    "hardhat": "^2.18.3",

naddison36 avatar Feb 07 '24 22:02 naddison36

Almost a year and still no Ethers v6? The impact on defender-admin-client has my team abandoning defender... for the second time this year.

jkirkpatrick avatar Apr 29 '24 20:04 jkirkpatrick

@jkirkpatrick we are deprecating this package in favor of defender-sdk, which already supports ethers v6.

I attach some resources:

  • SDK section in defender docs: https://docs.openzeppelin.com/defender/v2/sdk
  • SDK API documentation: https://www.api-docs.defender.openzeppelin.com/#defender-sdk-proposal

MCarlomagno avatar Apr 29 '24 20:04 MCarlomagno

@MCarlomagno So you're saying the current documentation and installation guides for Defender v2 are incorrect, and if I don't start by cloning the starter repo, I am out of luck due to the lack of a migration guide?

jkirkpatrick avatar Apr 29 '24 21:04 jkirkpatrick

So you're saying the current documentation and installation guides for Defender v2 are incorrect

Could you share the incorrect docs please? so we can fix them as soon as possible Thanks!

MCarlomagno avatar Apr 29 '24 21:04 MCarlomagno