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

ProviderError: pending state is not available for Taiko Mainnet #6076

Closed
airled opened this issue Dec 25, 2024 · 5 comments
Closed

ProviderError: pending state is not available for Taiko Mainnet #6076

airled opened this issue Dec 25, 2024 · 5 comments
Assignees

Comments

@airled
Copy link

airled commented Dec 25, 2024

Version of Hardhat

2.22.4

What happened?

Seems like something wrong when Hardhat tries to deploy a contract to the Taiko mainnet. When I try to call await hre.ethers.deployContract(), Hardhat raises with the error:

ProviderError: pending state is not available
    at HttpProvider.request (node_modules/hardhat/src/internal/core/providers/http.ts:90:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at HardhatEthersProvider.estimateGas (node_modules/@nomicfoundation/hardhat-ethers/src/internal/hardhat-ethers-provider.ts:237:27)
    at node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:235:35
    at async Promise.all (index 0)
    at HardhatEthersSigner._sendUncheckedTransaction (node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:256:7)
    at HardhatEthersSigner.sendTransaction (node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:125:18)
    at ContractFactory.deploy (node_modules/ethers/src.ts/contract/factory.ts:111:24)
    at main (scripts/deploy.js:59:18)

There are no problems with deployment exactly the same contract to other chains.
I tried different rpcs, also private ones, but no luck. Also Remix IDE has successfully deployed the contract.

Minimal reproduction steps

Create an empty contract and try to deploy the contract to the Taiko Mainnet.
hardhat.config.js:

require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: {
    compilers: [
      {
        version: "0.8.26",
        settings: {
          optimizer: {
            enabled: true,
            runs: 1000,
          },
        },
      },
    ],
  },
  networks: {
    taiko: {
      url: "https://taiko.drpc.org",
      accounts: [process.env.WALLET_PRIVATE_KEY],
    }
  }
};
@newtmex
Copy link

newtmex commented Dec 30, 2024

Does the account process.env.WALLET_PRIVATE_KEY have enough tokens for gas?

@airled
Copy link
Author

airled commented Dec 30, 2024

Does the account process.env.WALLET_PRIVATE_KEY have enough tokens for gas?

Yes, it has. I can deploy a contract with this account via remix ide without problems.

@newtmex
Copy link

newtmex commented Dec 30, 2024 via email

@airled
Copy link
Author

airled commented Dec 31, 2024

Check the RPC you're using, that might be th issue.

On Mon, Dec 30, 2024, 19:10 Uladzimir @.***> wrote:

Does the account process.env.WALLET_PRIVATE_KEY have enough tokens for
gas?

Yes, it has. I can deploy a contract with that account via remix ide.
Also, my coworker can't deploy a contract with his account either.


Reply to this email directly, view it on GitHub
#6076 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AD6D34NGQ34NX7DBE5YZCGL2IGEC5AVCNFSM6AAAAABUFS6LAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRVG43TSMZVGE
.
You are receiving this because you commented.Message ID:
@.***>

I tried different rpcs, public and private, but no luck, as I wrote in the original post.

@fvictorio
Copy link
Member

@airled apparently that RPC endpoint doesn't support the pending block tag:

$ cast rpc -r https://taiko.drpc.org/ eth_getBlockByNumber pending false
Error: server returned an error response: error code -32000: pending block is not available

And since you mentioned that you tried other endpoints, this might be a problem with Taiko's node itself. The pending block tag, as far as I know, is part of the execution APIs specs, so I think it should work. I'd recommend contacting the Taiko team about this.

I'm tentatively closing this. There is a workaround on our side that we could implement, but I don't think we should, at least not right now. If a lot of EVM chains stop supporting the pending block tag (which I think is highly unlikely), then we could re-consider this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants