Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardhat deploy plugin fails on testnet relay #678

Closed
mshakeg opened this issue Nov 7, 2022 · 9 comments · Fixed by #690
Closed

hardhat deploy plugin fails on testnet relay #678

mshakeg opened this issue Nov 7, 2022 · 9 comments · Fixed by #690
Assignees
Labels
bug Something isn't working P1
Milestone

Comments

@mshakeg
Copy link
Contributor

mshakeg commented Nov 7, 2022

Description

Attempting to deploy contracts using the hardhat-deploy plugin fails on hashio's testnet relay but deploys fine on local node.

The trace for the failed testnet deployment is as follows:

[Request ID: a2b14c3f-a1d0-4ffc-a76a-983707111a6d] Gas price below configured minimum gas price {"name":"ProviderError","_stack":"ProviderError: HttpProviderError\n    at HttpProvider.request (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)\n    at LocalAccountsProvider.request (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/providers/accounts.ts:181:36)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)","code":-32009,"_isProviderError":true} ProviderError: HttpProviderError
    at HttpProvider.request (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)
    at LocalAccountsProvider.request (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/providers/accounts.ts:181:36)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
An unexpected error occurred:

Error: ERROR processing /Users/usr/hedera-json-rpc-relay/tools/hardhat-example/deploy/Greeter.ts:
ProviderError: HttpProviderError
    at HttpProvider.request (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)
    at LocalAccountsProvider.request (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/providers/accounts.ts:181:36)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at DeploymentsManager.executeDeployScripts (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async DeploymentsManager.runDeploy (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1052:5)
    at async SimpleTaskDefinition.action (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat-deploy/src/index.ts:438:5)
    at async Environment._runTaskDefinition (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at async Environment.run (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at async SimpleTaskDefinition.action (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat-deploy/src/index.ts:584:32)
    at async Environment._runTaskDefinition (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at async Environment.run (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at async SimpleTaskDefinition.action (/Users/usr/hedera-json-rpc-relay/tools/hardhat-example/node_modules/hardhat-deploy/src/index.ts:669:5)

Steps to reproduce

  1. Checkout to this branch
  2. Set the testnet keys accordingly in .env based on .env.example
  3. Start up the hedera local node
  4. Run the local:deploy script i.e. npm run local:deploy and observe that the Greeter contract is deployed fine using the hardhat-deploy plugin
  5. Run the testnet:deploy script i.e. npm run testnet:deploy and observe that the Greeter contract fails to deploy with the previously mentioned error.

Additional context

No response

Hedera network

testnet

Version

hashio@latest

Operating system

No response

@mshakeg mshakeg added the bug Something isn't working label Nov 7, 2022
@mshakeg mshakeg mentioned this issue Nov 7, 2022
2 tasks
@mshakeg
Copy link
Contributor Author

mshakeg commented Nov 8, 2022

When attempting to deploy the contract using hardhat ethers it fails with a different error:

     [Request ID: d9830071-6053-4347-9f2a-a7ee1414d9dc] HBAR Rate limit exceeded
  ProviderError: HttpProviderError
      at HttpProvider.request (/Users/usr/project/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)
      at LocalAccountsProvider._getNonce (/Users/usr/project/node_modules/hardhat/src/internal/core/providers/accounts.ts:230:51)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async LocalAccountsProvider.request (/Users/usr/project/node_modules/hardhat/src/internal/core/providers/accounts.ts:168:27)
      at async EthersProviderWrapper.send (/Users/usr/project/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

@mshakeg
Copy link
Contributor Author

mshakeg commented Nov 8, 2022

In addition when deploying SillyLargeContract using hardhat ethers on testnet it times out, but not on the local node.

       Should be able to deploy SillyLargeContract:
     HeadersTimeoutError: Headers Timeout Error
      at Timeout.onParserTimeout [as _onTimeout] (node_modules/undici/lib/client.js:902:28)
      at listOnTimeout (node:internal/timers:561:11)
      at processTimers (node:internal/timers:502:7)

Run the local:tdeploy and testnet:tdeploy scripts to demonstrate success on local node & failure on testnet, I've confirmed the contract was in fact deployed though the relay does not respond until after it receives a tx receipt/record confirming the deployment hence the timeout due to that delayed response.

This timeout issue only appears on large contract deploys for the obvious reason that the time to upload the contract to the HFS and then deploy it takes longer than smaller contracts.

@georgi-l95
Copy link
Collaborator

Hi @mshakeg , I've checkout your branch, regarding your first problem with npm run testnet:deploy I can't reproduce a problem here.
Greeter deployed to: 0x0000000000000000000000000000000002E9377f

There is however problem with the large contract, it's getting stuck and resulting in HeadersTimeoutError. I will debug more.

@mshakeg
Copy link
Contributor Author

mshakeg commented Nov 8, 2022

Hi @georgi-l95 , seems like it was an intermittent issue as I too can also deploy it fine now, it might still be worthwhile reaching out to the hashio/swirlds team and investigating why Request ID: a2b14c3f-a1d0-4ffc-a76a-983707111a6d failed, assuming they save logs for more than a day.

@Nana-EC Nana-EC self-assigned this Nov 11, 2022
@Nana-EC Nana-EC added the P1 label Nov 11, 2022
@Nana-EC Nana-EC added this to the 0.12.0 milestone Nov 11, 2022
@Nana-EC
Copy link
Collaborator

Nana-EC commented Nov 11, 2022

Thanks @mshakeg , yes we can push logs from HashIO for this.
This is an issue we're aware of and we'll have a fix out for the next 0.12 release.
As always thanks for sharing what you find, the feedback loop helps :)

@mshakeg
Copy link
Contributor Author

mshakeg commented Nov 11, 2022

@Nana-EC sure thing and great to hear.

Btw might you have any idea when hashio's testnet relay will be back up again, it's been down continuously for 4 days.

@mshakeg
Copy link
Contributor Author

mshakeg commented Nov 11, 2022

@georgi-l95 I suspect the timeout value can be changed using the timeout network option in the hardhat config. It defaults to 20s for custom networks hence the timeout makes sense for large contract deploys. I haven't been able to confirm as hashio has been down for 4 days seemingly continuously.

@mshakeg
Copy link
Contributor Author

mshakeg commented Nov 11, 2022

@Nana-EC it seems like the hashio testnet relay is back online.

@georgi-l95 I've confirmed that setting a higher than default timeout(e.g. 60_000 ms) works. Though ideally it should take <20s to deploy a contract like Ethereum, which would require optimisations to the bytecode upload time contract to the Hedera file system.

@georgi-l95
Copy link
Collaborator

Okay, I'm glad to hear that this is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants