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

Implementation for calling JSON RPC calls using asyncio, round-robin public nodes, and increasing gas prices #1131

Closed
amitkot opened this issue Oct 31, 2018 · 4 comments

Comments

@amitkot
Copy link
Contributor

amitkot commented Oct 31, 2018

@pipermerriam following our conversation on devcon4, this is the implementation we developed at Kyber for calling one of our smart contracts.

It calls the nodes directly using json rpc and handles various error cases we faced including nodes being non-responsive and increasing gas prices if we find our transactions do not get mined fast enough.

https://github.com/KyberNetwork/sanity-price-monitor/blob/master/pricemonitor/storing/web3_connector.py

@pipermerriam
Copy link
Member

cc @carver as this appears to be similar to the gas daemon idea you've been tossing around.

@carver
Copy link
Collaborator

carver commented Nov 24, 2018

We may be able to just wait this problem out. I think it's mostly solved if this EIP makes it into an upcoming hard-fork ethereum/EIPs#1559

@carver
Copy link
Collaborator

carver commented Dec 6, 2018

I'm probably not going to build this, since I'll hope that the previous EIP ^ will happen in not too long (next ~year?).

But if I were going to build it, my first stab at the API would be launch the daemon:

from eth_gas import Daemon

gas_daemon = Daemon(ip, port, accounts=[eth_account.Account], etc...)
gas_daemon.run_server()  # probably asyncio under the hood

Then this in the transaction-sending script:

from eth_gas import price_strategies
from ._utils import gas_daemon

PRICE_STRATEGY = price_strategies.exponential(per_hour=1.2)
...
txn_hash = w3.eth.sendTransaction(...)
gas_daemon.add(txn_hash, PRICE_STRATEGY)

@fselmo
Copy link
Collaborator

fselmo commented Jul 5, 2023

EIP-1559 saved the day

@fselmo fselmo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants