-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Motivation
When verifying a contract, blockscout along with verification data sends to eth-bytecode-db the contract metadata. E.g., verify-solidity-standard-json request schema:
{
"bytecode": "string",
"bytecodeType": "BYTECODE_TYPE_UNSPECIFIED",
"compilerVersion": "string",
"input": "string",
"metadata": {
"chainId": "string",
"contractAddress": "string",
"transactionHash": "string",
"blockNumber": "string",
"transactionIndex": "string",
"deployer": "string",
"creationCode": "string",
"runtimeCode": "string"
}
}
On contrary, on contract lookup requests blockscout sends only data required for the lookup and omit the contract metadata even if available. That metadata, though, is used by eth-bytecode-db service to add the contract verification data into verifier-alliance database.
Currently we do not write mappings found via lookup mechanism into verifier-alliance database. We would like to start doing that, though.
Details
I am asking to update eth-bytecode-db lookup requests with the contract metadata. Currently it can be useful for the following eth-bytecode-db endpoints:
/api/v2/bytecodes/sources:search
{
"bytecode": "string",
"bytecodeType": "BYTECODE_TYPE_UNSPECIFIED"
}
and
/api/v2/bytecodes/sources:search-all
{
"bytecode": "string",
"bytecodeType": "BYTECODE_TYPE_UNSPECIFIED",
"chain": "string",
"address": "string",
"onlyLocal": true
}
I suggest to just add there a new metadata
field which is filled the same way as for the contract verification requests. E.g., /api/v2/bytecodes/sources:search-all
request may look the following way
{
"bytecode": "string",
"bytecodeType": "BYTECODE_TYPE_UNSPECIFIED",
"chain": "string",
"address": "string",
"onlyLocal": true,
"metadata": {
"chainId": "string",
"contractAddress": "string",
"transactionHash": "string",
"blockNumber": "string",
"transactionIndex": "string",
"deployer": "string",
"creationCode": "string",
"runtimeCode": "string"
}
}