ethereum-etl icon indicating copy to clipboard operation
ethereum-etl copied to clipboard

Process all basic blocks to make the sighash checks 'greedy'

Open andrewmccall opened this issue 3 years ago • 3 comments

Instead of processing just basic_block[0] I've looped through all the basic blocks this finds the sighashes for many more ERC20 contracts.

I think this also removed the limitation around proxies. I'm still building my knowledge around ETH so it may do so at the expense of introducing false positives.

andrewmccall avatar Aug 04 '21 17:08 andrewmccall

Sorry, I missed the actual fix I wanted to implement in my commit. This now contains a loop through the basic blocks adding all the hashes.

This will may add more sighashes than there really are (I'm not sure everything that's a PUSH4 is actually a function) but it doesn't seem to miss any which works for the matching on contracts if the function comes through a proxy, which lots of contracts seem to implement.

andrewmccall avatar Aug 10 '21 17:08 andrewmccall

Thanks for the PR!

Looking only at the 1st block could produce false negatives (some function sighashes will be missing), while looking at all blocks could product false positives (some function sighashes will be added mistakenly). The PR needs some test cases and comparison of results before and after to understand the impact

I kindly request to add test cases that could surface false positives.

medvedev1088 avatar Feb 03 '22 17:02 medvedev1088

Any updates relating this issue/PR?

yongchand avatar Jul 07 '22 06:07 yongchand