defender-client
defender-client copied to clipboard
ethers v6
Any plans to upgrade relayer to use ethers v6?
I'm also interested in this topic
Wen ethers v6?
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.
What's the status on this? @shahnami @spalladino @tirumerla @MCarlomagno
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.
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.
Awesome news!, we'll try it out and let you guys know.
Thanks
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
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
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
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
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",
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 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 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?
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!