blockscout / frontend

Front-end application for Blockscout
https://blockscout.com
GNU General Public License v3.0
177 stars 469 forks source link

Celo: Cross-link to epoch block on the regular block view #2365

Closed fedor-ivn closed 1 day ago

fedor-ivn commented 2 weeks ago

Add a cross-link to the epoch block on the regular block view.

Formula for calculating epoch block number:

epoch_block_number = block.celo.epoch_number * 17280

:warning: Important Detail: the epoch mechanics changed when Celo transitioned to L2, so this feature should only be enabled for historical blocks. It would be ideal to configure this using an environment variable, like CELO_L2_UPGRADE_FROM_BLOCK. For the Alfajores testnet, the last block before the L2 transition is 26369280 (Epoch 1526).

Image

tom2drum commented 1 week ago

New frontend ENVs example (for Alfajores testnet):

NEXT_PUBLIC_CELO_ENABLED=true
NEXT_PUBLIC_CELO_L2_UPGRADE_BLOCK=26369280