subquery / subql

SubQuery is an Open, Flexible, Fast and Universal data indexing framework for web3. Our mission is to help developers create the decentralised products of the future.
https://subquery.network
GNU General Public License v3.0
18.94k stars 331 forks source link

Integration with Zilliqa Fails Due to Address Format Validation #1996

Closed youssefea closed 10 months ago

youssefea commented 1 year ago

Issue Description: When attempting to integrate the Zilliqa blockchain with SubQuery, the operation fails during the yarn dev command. The log indicates that the issue is due to the address format that Zilliqa uses, which is not recognized as a valid Ethereum address by the SubQuery configuration.

Log Output: zilliqa-starter-postgres-1 | 2023-09-04 14:43:01.034 UTC [1] LOG: database system is ready to accept connections zilliqa-starter-subquery-node-1 | 2023-09-04T14:43:03.938Z <subql-node> INFO Current @subql/node-ethereum version is 2.12.3 zilliqa-starter-subquery-node-1 | 2023-09-04T14:43:03.940Z <subql-node> INFO Current @subql/node-ethereum version is 2.12.3 zilliqa-starter-subquery-node-1 | 2023-09-04T14:43:04.114Z <configure> ERROR Create Subquery project from given path failed! Error: failed to parse project.yaml. zilliqa-starter-subquery-node-1 | An instance of DeploymentV1_0_0 has failed the validation: zilliqa-starter-subquery-node-1 | - property dataSources[0].options.address has failed the following constraints: isEthereumAddress zilliqa-starter-subquery-node-1 | dependency failed to start: container zilliqa-starter-subquery-node-1 is unhealthy error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Error Context: This error is directly related to the unique address format that Zilliqa uses (e.g., zil1aftudda4gagsw6ytcu92hm7a2dfdp0ksdx8kwy), which doesn't match the typical Ethereum address format. This is critical for integrating any blockchain that has an EVM-compatible layer but utilizes a different address format.

Expected Behavior: The SubQuery project should be able to recognize and work with non-Ethereum address formats for EVM-compatible chains like Zilliqa.

Steps to Reproduce:

Suggested Solution: Update the address validation logic to accommodate for different types of blockchain addresses, not just Ethereum.

Additional Context: This issue could potentially impact other chains with EVM-compatible sides but different address formats.

deverka commented 1 year ago

Is this sth we want to prioritise or not necessarily? @jamesbayly

stwiname commented 1 year ago

We can add a new validation type for their address format and we can support the union type of both