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

Automatic gas price doesn't work: Error: 429 Client Error: Too Many Requests for url: https://ropsten.infura.io/ #345

Open
vsbogd opened this issue Oct 29, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@vsbogd
Copy link
Member

vsbogd commented Oct 29, 2019

Small log:

$ snet account deposit 0.00000010 -y
# Calculating gas price. It might take ~60 seconds.
Error: 429 Client Error: Too Many Requests for url: https://ropsten.infura.io/
If you want to see full Traceback then run:
snet --print-traceback [parameters]

Full log with traceback:

$ snet --print-traceback account deposit 0.00000010 -y
# Calculating gas price. It might take ~60 seconds.
Traceback (most recent call last):
  File "/home/vital/miniconda3/envs/singnet/bin/snet", line 11, in <module>
    load_entry_point('snet-cli', 'console_scripts', 'snet')()
  File "/home/vital/projects/singnet/src/github.com/singnet/snet-cli/packages/snet_cli/snet_cli/__init__.py", line 23, in main
    getattr(args.cmd(conf, args), args.fn)()
  File "/home/vital/projects/singnet/src/github.com/singnet/snet-cli/packages/snet_cli/snet_cli/mpe_account_command.py", line 32, in deposit_to_mpe
    self.transact_contract_command("SingularityNetToken", "approve", [mpe_address, amount])
  File "/home/vital/projects/singnet/src/github.com/singnet/snet-cli/packages/snet_cli/snet_cli/commands.py", line 211, in transact_contract_command
    is_silent).transact()
  File "/home/vital/projects/singnet/src/github.com/singnet/snet-cli/packages/snet_cli/snet_cli/commands.py", line 355, in transact
    gas_price = self.get_gas_price_verbose()
  File "/home/vital/projects/singnet/src/github.com/singnet/snet-cli/packages/snet_cli/snet_cli/commands.py", line 143, in get_gas_price_verbose
    g = self.w3.eth.generateGasPrice()
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/eth.py", line 385, in generateGasPrice
    return self.gasPriceStrategy(self.web3, transaction_params)
  File "/home/vital/projects/singnet/src/github.com/singnet/snet-cli/packages/snet_cli/snet_cli/commands.py", line 100, in __call__
    self.calc_gas_price(w3, transaction_params))
  File "/home/vital/projects/singnet/src/github.com/singnet/snet-cli/packages/snet_cli/snet_cli/commands.py", line 110, in calc_gas_price
    return (medium_gas_price_strategy(w3, transaction_params))
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/gas_strategies/time_based.py", line 165, in time_based_gas_price_strategy
    sample_size=sample_size,
  File "/home/vital/.local/lib/python3.6/site-packages/eth_utils/functional.py", line 46, in inner
    return callback(fn(*args, **kwargs))
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/gas_strategies/time_based.py", line 84, in _compute_probabilities
    reverse=True,
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/gas_strategies/time_based.py", line 60, in _aggregate_miner_data
    data_by_miner = groupby(0, raw_data)
  File "cytoolz/itertoolz.pyx", line 118, in cytoolz.itertoolz.groupby
  File "cytoolz/itertoolz.pyx", line 160, in cytoolz.itertoolz.groupby
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/gas_strategies/time_based.py", line 54, in _get_raw_miner_data
    block = w3.eth.getBlock(block['parentHash'], full_transactions=True)
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/eth.py", line 141, in getBlock
    [block_identifier, full_transactions],
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/manager.py", line 109, in request_blocking
    response = self._make_request(method, params)
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/manager.py", line 92, in _make_request
    return request_func(method, params)
  File "cytoolz/functoolz.pyx", line 232, in cytoolz.functoolz.curry.__call__
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/formatting.py", line 50, in apply_formatters
    response = make_request(method, params)
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/gas_price_strategy.py", line 18, in middleware
    return make_request(method, params)
  File "cytoolz/functoolz.pyx", line 232, in cytoolz.functoolz.curry.__call__
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/formatting.py", line 48, in apply_formatters
    response = make_request(method, formatted_params)
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/attrdict.py", line 18, in middleware
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 232, in cytoolz.functoolz.curry.__call__
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/formatting.py", line 50, in apply_formatters
    response = make_request(method, params)
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/normalize_errors.py", line 9, in middleware
    result = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 232, in cytoolz.functoolz.curry.__call__
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/formatting.py", line 50, in apply_formatters
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 232, in cytoolz.functoolz.curry.__call__
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/formatting.py", line 48, in apply_formatters
    response = make_request(method, formatted_params)
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/middleware/exception_retry_request.py", line 80, in middleware
    return make_request(method, params)
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/providers/rpc.py", line 68, in make_request
    **self.get_request_kwargs()
  File "/home/vital/miniconda3/envs/singnet/lib/python3.6/site-packages/web3/utils/request.py", line 27, in make_post_request
    response.raise_for_status()
  File "/home/vital/.local/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://ropsten.infura.io/
@vsbogd vsbogd added the bug Something isn't working label Oct 29, 2019
@vsbogd
Copy link
Member Author

vsbogd commented Oct 29, 2019

As workaround one can use manual gas price:

$ snet account deposit 5 -y --gas-price 380000000000

@keshrisohit
Copy link
Contributor

we need to provide api key for infura api like https://ropsten.infura.io/v3/your-api-key

@vsbogd
Copy link
Member Author

vsbogd commented Nov 11, 2019

@keshrisohit, do you mean each user should register on Infura and get the key or we should provide single key for our repo?

@keshrisohit
Copy link
Contributor

@vsbogd each user need to register on infura and get their own api key.
Infura is now restricting number of calls to https://ropsten.infura.io/

@vsbogd
Copy link
Member Author

vsbogd commented Nov 11, 2019

So what is the way we can fix that? Am I right that you propose updating snet-cli api to ask user register in Infura and provide an Infura key?

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

No branches or pull requests

2 participants