Skip to content

Commit 594e4c2

Browse files
authored
Add celo-related envs (#276)
* Add new value `celo` for `CHAIN_TYPE` env * Add docs for `CELO_CORE_CONTRACTS` env * Add epoch fetcher envs * feat: add new Explorer's tables to `sharelock.md`
1 parent 0459d8f commit 594e4c2

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

for-developers/information-and-settings/env-variables/backend-env-variables.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ _**Note**_**: Before release 5.1.2, all environment variables of time format sup
6969
| `CHECKSUM_FUNCTION` | Defines checksum address function. 2 available values: `rsk`, `eth` | <p>Version: v2.0.1+<br>Default: <code>eth</code><br>Applications: API</p> |
7070
| `RESTRICTED_LIST` | A comma-separated list of addresses to enable restricted access to them. | <p>Version: v3.3.3+<br>Default: (empty)<br>Applications: API</p> |
7171
| `RESTRICTED_LIST_KEY` | A key to access addresses listed in`RESTRICTED_LIST` variable. Can be passed via query param to the page's URL: `?key=...` | <p>Version: v3.3.3+<br>Default: (empty)<br>Applications: API</p> |
72-
| `CHAIN_TYPE` | Specifies the model of data and enables fetchers specific to the chain. Available values are `ethereum`, `optimism`, `arbitrum`, `polygon_zkevm`, `polygon_edge`, `rsk`, `shibarium`, `stability`, `suave`, `zetachain`, `filecoin`, `default`. | <p>Needs Recompile: ☑️<br>Version: v5.3.0+<br>Default: <code>default</code><br>Applications: API, Indexer</p> |
72+
| `CHAIN_TYPE` | Specifies the model of data and enables fetchers specific to the chain. Available values are `ethereum`, `optimism`, `arbitrum`, `celo`, `polygon_zkevm`, `polygon_edge`, `rsk`, `shibarium`, `stability`, `suave`, `zetachain`, `filecoin`, `default`. | <p>Needs Recompile: ☑️<br>Version: v5.3.0+<br>Default: <code>default</code><br>Applications: API, Indexer</p> |
7373
| `CHAIN_ID` | Chain ID of the network. For instance, 100 in the case of xDai chain. | <p>Version: v3.7.0+<br>Default: (empty)<br>Applications: API, Indexer</p> |
7474
| `JSON_RPC` | JSON RPC endpoint of the chain for the WalletConnect integration. Implemented in [#4931](https://github.com/blockscout/blockscout/pull/4931) | <p>Version: v4.1.0+<br>Default: (empty)<br>Applications: API, Indexer</p> |
7575
| `HEALTHY_BLOCKS_PERIOD` | New blocks indexed max delay in /health API endpoint. Time format. Implemented in [#2294](https://github.com/blockscout/blockscout/pull/2294/) | <p>Version: v2.0.2+<br>Default: <code>5m</code><br>Applications: API, Indexer</p> |

for-developers/information-and-settings/env-variables/backend-envs-chain-specific.md

+43
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,46 @@ Supported together with setting `CHAIN_TYPE=arbitrum`
162162
| `INDEXER_ARBITRUM_MISSING_BATCHES_RANGE` | Size of each batch range which will be inspected for the missing batches. Since it is not expected that batches are missed often, it is OK to have this value relatevly large. Implemented in [#10466](https://github.com/blockscout/blockscout/pull/10446). | <p>Version: master<br>Default: <code>10000</code><br>Applications: Indexer</p> |
163163
| `INDEXER_ARBITRUM_CONFIRMATIONS_TRACKING_FINALIZED` | Whether to choose `safe` (true) or `latest` (false) block to discover new confirmations. This setting is required to reduce latency between the actual confirmation transaction and its discovery. Recommended to have true on rollups which use Ethereum Mainnet as L1. Determines how fast new confirmations will be discovered. Implemented in [#9312](https://github.com/blockscout/blockscout/pull/9312). | <p>Version: v6.7.0+<br>Default: <code>true</code><br>Applications: Indexer</p> |
164164
| `INDEXER_ARBITRUM_NEW_BATCHES_LIMIT` | The number of batches to be handled and imported at once. This is applicable for cases when dozens of batches are found in one discovery iteration, and it is necessary to import them in chunks to avoid the entire process being aborted if any errors occur. Implemented in [#9312](https://github.com/blockscout/blockscout/pull/9312). | <p>Version: v6.7.0+<br>Default: <code>10</code><br>Applications: Indexer</p> |
165+
166+
### <mark style="background-color:yellow;">Celo Management</mark>
167+
168+
{% hint style="info" %}
169+
Supported together with setting `CHAIN_TYPE=celo`
170+
{% endhint %}
171+
172+
173+
| Variable | Description | Parameters | |
174+
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | --- |
175+
| `CELO_CORE_CONTRACTS` | JSON dictionary containing the addresses and metadata of core CELO network contracts. Read detailed description down below. Implemented in [#9713](https://github.com/blockscout/blockscout/pull/9713). | <p>Version: master<br>Default: (empty)<br>Applications: API, Indexer</p> | |
176+
| `INDEXER_DISABLE_CELO_EPOCH_FETCHER` | If set to `true`, the epoch rewards and validator group votes fetchers will not be started. However, epoch blocks pending to fetch will still be imported into the database. Implemented in [#9944](https://github.com/blockscout/blockscout/pull/9944). | <p>Version: master<br>Default: <code>false</code><br>Applications: Indexer</p> | |
177+
| `INDEXER_CELO_VALIDATOR_GROUP_VOTES_BATCH_SIZE` | Specifies the block range size for the `eth_getLogs` request, determining the number of blocks included between `toBlock` and `fromBlock`. Implemented in [#9944](https://github.com/blockscout/blockscout/pull/9944). | <p>Version: master<br>Default: <code>200000</code><br>Applications: Indexer</p> | |
178+
179+
<details>
180+
181+
<summary>Details on `CELO_CORE_CONTRACTS`</summary>
182+
183+
The CELO network includes several core contracts that are central to its operation. These core contracts manage various aspects of the Celo network, including its stablecoins, governance, identity, and more.
184+
185+
All these contracts can be obtained by querying the `Registry` contract, which is deployed at the genesis block with the address `0x000000000000000000000000000000000000ce10`. This contract serves as a repository for the addresses of all core contracts on the Celo network.
186+
187+
Fortunately, core contracts are not updated frequently, so we store information about core contracts statically under the `CELO_CORE_CONTRACTS` variable, which is a JSON object of a specified structure.
188+
189+
In case the contracts are updated, maintaining the Blockscout instance will require updating the `CELO_CORE_CONTRACTS` variable and manually setting blocks for refetch (all blocks produced after the core contracts' update).
190+
191+
The structure of the JSON value for the `CELO_CORE_CONTRACTS` variable is detailed in this [gist](https://gist.github.com/fedor-ivn/c77030d09bd05349710450e0fcf00a1f).
192+
193+
{% hint style="warning" %}
194+
The JSON structure may change. To assemble the `CELO_CORE_CONTRACTS` environment variable, run `mix fetch_celo_core_contracts` in the root of the Blockscout repository. This task will index the chain from block `0` to the latest block number, providing the most up-to-date values.
195+
{% endhint %}
196+
197+
The JSON structure in the gist contains two main sections: `addresses` and `events`.
198+
199+
- **addresses**: This section maps contract names to the list of respective addresses and the block number at which they were updated. For example:
200+
- `"Accounts"`: `[{ "address": "0xed7f51a34b4e71fbe69b3091fcf879cd14bd73a9", "updated_at_block_number": 574 }]`
201+
- `"Election"`: `[{ "address": "0x1c3edf937cfc2f6f51784d20deb1af1f9a8655fa", "updated_at_block_number": 592 }]`
202+
- **events**: This section maps contract addresses to the events associated with them, including any parameters and the block numbers at which these events were emitted. For example:
203+
- `"EpochRewards"`: `{ "0xb10ee11244526b94879e1956745ba2e35ae2ba20": { "CarbonOffsettingFundSet": [{ "address": "0x22579ca45ee22e2e16ddf72d955d6cf4c767b0ef", "updated_at_block_number": 15049265 }] } }`
204+
- `"FeeHandler"`: `{ "0x90d94229623a0a38826a4a7557a6d79acde43f76": { "BurnFractionSet": [{ "updated_at_block_number": 19732579, "value": 0.7999999999999999 }] } }`
205+
206+
</details>
207+

for-developers/information-and-settings/sharelock.md

+4
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,7 @@ Note that this should always be enforced because as long as there is one DB tran
145145
| Explorer.Chain.ZkSync.BatchBlock | zksync\_batch\_blocks | \[asc: :hash\] |
146146
| Explorer.Chain.ZkSync.BatchTransaction | zksync\_batch\_transactions | \[asc: :hash\] |
147147
| Explorer.Chain.ZkSync.LifecycleTransaction | zksync\_lifecycle\_transactions | \[asc: :id\] |
148+
| Explorer.Chain.Celo.EpochReward | celo\_epoch\_rewards | \[asc: :block\_hash\] |
149+
| Explorer.Chain.Celo.PendingEpochBlockOperation | celo\_pending\_epoch\_block\_operations | \[asc: :block\_hash\] |
150+
| Explorer.Chain.Celo.ValidatorGroupVote | celo\_epoch\_validator\_group\_votes | \[asc: :transaction\_hash, asc: :account\_address\_hash, asc: :group\_address\_hash\] |
151+
| Explorer.Chain.Celo.ElectionReward | celo\_election\_rewards | \[asc: :block\_hash, asc: type, asc: :account\_address\_hash, asc: :associated\_account\_address\_hash\] |

0 commit comments

Comments
 (0)