second-state/smart-contract-search-engine

Create filter to ignore ABI and contract address combinations which are known not to be related

tpmccallum opened this issue · 3 comments

At present we have 1 million contracts indexed and 100 ABIs uploaded (ETH MainNet demo)

This means that the system must process 100 million threads when testing to see of a particular ABI and a particular contract address are instantiating and returning contract data.

A contract address can be associated with one or more ABIs (main ABI and smaller sub ABIs i.e. contracts that inherit from other contracts).

We need to allow ABIs and contract addresses to be tested, but have a system which ignores known pairs of ABI and address where no relationship exists.

Sha3 creates content addressable type hashes (deterministic). Combining the ABI Sha3 and the address and then Sha3'ing the output will produce a unique key which can facilitate this functionality.

A new index has been added. It will store the Sha3 hashes of the ABI + contract address
b04f771#diff-d4d862ec0e67940d6ef03d24ffea207d

System now reads new config and also has a new function which can add items to the ignore index
fcb2b49#diff-865680b796b7d36a0c8d7a0a1840ff70

Last but not least, we have no also added a filter to reduce the amount of records being processed at the outset (with a little help from the ignore index)

2fb3692#diff-865680b796b7d36a0c8d7a0a1840ff70