by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 24 21:33
    kclowes synchronize #1748
  • Sep 24 21:25

    kclowes on master

    Add newsfragment for ENS bug (compare)

  • Sep 24 21:25
    kclowes closed #1751
  • Sep 24 21:23
    kclowes synchronize #1748
  • Sep 24 21:22
    kclowes synchronize #1748
  • Sep 24 21:22
    kclowes edited #1748
  • Sep 24 21:20
    kclowes edited #1748
  • Sep 24 21:18
    kclowes edited #1748
  • Sep 24 21:17
    kclowes synchronize #1751
  • Sep 24 20:53
    kclowes opened #1751
  • Sep 24 20:50

    kclowes on master

    Allow for ENS name resolution (compare)

  • Sep 24 20:50
    kclowes closed #1749
  • Sep 24 20:50
    kclowes edited #1749
  • Sep 24 20:30
    kclowes edited #1749
  • Sep 24 16:28
    kclowes edited #1749
  • Sep 24 16:27
    kclowes closed #1750
  • Sep 24 16:27
    kclowes commented #1750
  • Sep 24 01:16
    ferhatkkochan commented #1750
  • Sep 24 01:15
    ferhatkkochan edited #1750
  • Sep 23 22:59
    kclowes review_requested #1749
Adam Bavosa
@realadambavosa_twitter
hello, I am the devrel lead at Compound. did someone need help with code?
Ben Scherrey
@scherrey
Is there a consistent mechanism to estimate average gas prices and their quartiles so transactions can be created with optimal gas prices from inside python? Seems many people are relying on Metamask to give them numbers.
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<carver> @realadambavosa_twitter -- yeah someone linked an ABI for a contract that looks malformed: it has a several duplicates of the same function, like admin(), which triggers a validation error in web3.py. I can't think of a good reason for there to be such duplicates in the ABI intentionally, it just looks broken. Maybe you could publish one that doesn't have duplicates? https://compound.finance/docs/abi/mainnet/Comptroller
<carver> > Is there a consistent mechanism to estimate average gas prices and their quartiles so transactions can be created with optimal gas prices from inside python? Seems many people are relying on Metamask to give them numbers.
This is a much harder problem than it sounds like, with a lot of intricacies. There is a gas estimator in web3, but I wouldn't bet production code on it. Frankly, I'm kind of hoping/figuring that EIP-1559 will solve it before we get around to writing a more complicated one.
2 replies
Adam Bavosa
@realadambavosa_twitter
ah ok I understand, I will investigate this issue!
Mikko Ohtamaa
@miohtama
The gas estimator coming from Ethereum nodes is crappy at the best
Mikko Ohtamaa
@miohtama
My recommendation is
1) have an app level configuration where devops can adjust the recommended gas price based on a data feed
2) always set gasLimit for the transactions, as often the estimator cannot determine the spent gas, defaults to the max value 9M GWei and then gives you an absurd estimation like $1000/tx
Adam Bavosa
@realadambavosa_twitter
About Compound's Comptroller ABI: We have identified the issue that causes multiple member references. We will deploy the update and fix the ABI in the docs soon. Thank you @miohtama for bringing this issue to our attention!
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<carver> 👍
Mikko Ohtamaa
@miohtama
@realadambavosa_twitter Thank so you much. Do you have a Github issue link? If it is some common pattern other projects may suffer this as well.
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<carver> Agree, very unlikely to get to Berlin. Some conversation at https://ethereum-magicians.org/t/eip-1559-fee-market-change-for-eth-1-0-chain/2783/76
Stellarize
@Stellarize
hello i'm new to web3.py hope will get beautiful experience here . thanks
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<Christoph> Welcome Stellarize!
brschkv
@brschkv
Does anyone else have problems with querying event logs from infura? I always run into "TimeoutError" if I query events further in the past than about 30 days. Seems to be related to this issue: https://community.infura.io/t/ropsten-websocket-event-timeout-with-web3-py/1078/3
Works completely fine back to block 0 with web3.js Contract.getPastEventLogs().
Mikko Ohtamaa
@miohtama
@brschkv You cannot query too big chunks. You need to paginage your queries.
because it puts too big strain on their database and then timeouts because it cannot reply fast enough
brschkv
@brschkv
I did with varying chunk sizes (1000 blocks to 50_000 blocks), but always the same error at around the same time.
LATEST_BLOCK = 10226095
STEP_SIZE = 100_000

for i in range(0, int(1_000_000 / STEP_SIZE)):
    filter_builder = cDAI.events.LiquidateBorrow.build_filter()
    filter_builder.fromBlock = LATEST_BLOCK - ((i + 1) * STEP_SIZE)
    filter_builder.toBlock = LATEST_BLOCK - (i * STEP_SIZE)
    filter_instance = filter_builder.deploy(w3)
    entries = filter_instance.get_all_entries()
    if len(entries) > 0:
        print(i, entries)
Mikko Ohtamaa
@miohtama
@brschkv does it crash on a specific block
I would assume the start of the historical chain is empty, util you start to see much activity after the launch
and you can simply workd around it by decreasing the step size and starting when cDAI was launched
brschkv
@brschkv
I will try and find out if it crashes on a specific block. It does crash around the same time (about a month in the past) with each step_size, but definitely after cDAI was launched.
Mikko Ohtamaa
@miohtama
@brschkv Usually to make things developer friendly (if you ever develop smart contracts) add a running counter index to your events so they are easier to query
you can ask events 0-100, 100-200, etc.
brschkv
@brschkv
:+1: will definitely do!
Mikko Ohtamaa
@miohtama
@brschkv What I have done myself when querying token balances is exponential backoff
have batch size 100, 1000, 10000 blocks
and even you get the first event
go back to 100
because there are time periods when you get a lot of events and time periods when you get less events
brschkv
@brschkv
but still, the same query as above works perfectly fine with web3.js all the way back to block 0
in one shot
Mikko Ohtamaa
@miohtama
ah
@brschkv I think the best way to debug - would be try to run your own node and test against it
so you get more visibility what is going on on the node side
maybe there is a difference how web3.py and web3.js construct the query
so you could also sniff that from HTTP traffic
brschkv
@brschkv
Yes, that is what the infura support hinted in the issue linked above. I have not looked into the code yet, but would be willing to help fixing this.
There are some things, that web3.js still does better. And it annoys me personally because I like web3.py a lot better and would like to use it exclusively. But I constantly have to jump back to web3.js for certain tasks... :-(

@brschkv I think the best way to debug - would be try to run your own node and test against it

I don't have the infrastructure at hand to do that unfortunately...

maybe there is a difference how web3.py and web3.js construct the query

I hope I can make some time to look into that later.

brschkv
@brschkv
There's also an open issue for this already: ethereum/web3.py#1523
Nick Mudge
@mudgen
Mikko Ohtamaa
@miohtama
@mudgen The standard seems to propose a more complicate upgrade proxy. I read through quickly, but not really understand what's the unique selling point here.
good to know, thank you!
Ed Noepel
@EdNoepel
Nick/Piper: I believe I resolved concerns with ethereum/web3.py#1620 three weeks back. What's the process for getting this merged and into a release? Thanks in advance.
Eth-Gitter-Bridge
@Eth-Gitter-Bridge
<carver> @Piper I don't have any context on this, is this good to go? ^