You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System contracts are not displayed as contracts in the UI until they have been updated.
Here is how the explorer works now:
It parses transaction logs and searches for ContractDeployed events.
When a ContractDeployed event is found, it extracts the address of the deployed contract from the log, fetches additional data from the network (e.g., bytecode), and stores it as a contract record in the DB.
In the UI, when an address is opened, general information such as balances, transactions, and transfers is shown. If the address is a contract (i.e., there is a contract record for that address), additional contract information is displayed, including the Contract and Events tabs.
Unfortunately, system contracts created during genesis are not created with a transaction, so there is no ContractDeployed log. This means they won’t be added to the database and won’t appear as contracts.
However, when system contracts are updated, a transaction containing ContractDeployed events is created, and these events are picked up by the explorer.
🔄 Reproduction Steps:
Spin up a new local node environment (network + explorer).
Make sure that the explorer is up and running and indexed all existing data.
System contracts to be shown as contracts from the very beginning, even if they haven't been updated.
🤔 Possible fix:
The caveat here is that the fix should be executed on the existing environments. Since there is no functionality that runs migration scripts with the initialized blockchain provider, we need either to add it (which is out of scope for this bug) or fix it differently.
One possible way to fix the problem is as follows:
Add a new service to the worker, where OnModuleInit it will request system contracts from the DB. For those that do not exist in the DB, it will use the blockchain service to fetch data about them and add them to the DB.
Since contracts created in step 1 won't have a createdInBlockNumber, creatorTxHash, createdInLogIndex, or creatorAddress, we need to fix the UI to properly display contracts without these fields.
The text was updated successfully, but these errors were encountered:
🐛 Bug Report
📝 Description:
System contracts are not displayed as contracts in the UI until they have been updated.
Here is how the explorer works now:
Unfortunately, system contracts created during genesis are not created with a transaction, so there is no ContractDeployed log. This means they won’t be added to the database and won’t appear as contracts.
However, when system contracts are updated, a transaction containing ContractDeployed events is created, and these events are picked up by the explorer.
🔄 Reproduction Steps:
🤔 Expected Behavior:
Describe what you expected to happen:
System contracts to be shown as contracts from the very beginning, even if they haven't been updated.
🤔 Possible fix:
The caveat here is that the fix should be executed on the existing environments. Since there is no functionality that runs migration scripts with the initialized blockchain provider, we need either to add it (which is out of scope for this bug) or fix it differently.
One possible way to fix the problem is as follows:
createdInBlockNumber
,creatorTxHash
,createdInLogIndex
, orcreatorAddress
, we need to fix the UI to properly display contracts without these fields.The text was updated successfully, but these errors were encountered: