3_adding_new_archival

🧑‍🎓 Instructions for adding new archival check configurations by following an example for Polygon zkEVM 🧑‍🎓

Overview

The process of configuring archival checks for a new chain is manual but only needs to be performed once per chain.

Service QoS Configurations

QoS configurations are stored in path/config/service_qos_config.go.

Adding an Archival Check By Example: Polygon zkEVM

This example uses the Polygon zkEVM chain (F029).

1

Find a Block Explorer

Firstly, find a publically accessible block explorer for the chain. Most EVM chain block explorers use a similar format for their browser UI.

Block Explorer for Polygon zkEVM: https://zkevm.polygonscan.com/

2

Go to the chain's block explorer

Go to the chain's block explorer and search for Top Account in the Blockchain dropdown.

![HowToArchival1](../../../static/img/howto_archival_1.png)

3

Choose a top account

Find an account with lots of activity and click on the Address.

![HowToArchival2](../../../static/img/howto_archival_2.png)

4

Find the contract creation block

Under the Filters section, select View Contract Creation.

![HowToArchival3](../../../static/img/howto_archival_3.png)

Take note of the block number of the first transaction for that address.

![HowToArchival4](../../../static/img/howto_archival_4.png)

5

Add the new archival check configuration

In the path/config/service_qos_config.go file, add a new entry to the shannonServices array.

The configuration MUST be entered in this exact format:

// Polygon zkEVM
evm.NewEVMServiceQoSConfig("F029", "0x44d", evm.NewEVMArchivalCheckConfig(
   // https://zkevm.polygonscan.com/address/0xee1727f5074e747716637e1776b7f7c7133f16b1
   "0xee1727f5074E747716637e1776B7F7C7133f16b1",
   // Contract start block
   111,
)),

It must contain the following elements in evm.NewEVMArchivalCheckConfig, exactly as shown above.

Line
Description
Example

1

A comment containing the URL for the contract address on the block explorer as a comment

// https://zkevm.polygonscan.com/address/ 0xee1727f5074e747716637e1776b7f7c7133f16b1

2

The contract address as the first parameter

"0xee1727f5074E747716637e1776B7F7C7133f16b1"

3

A comment containing // Contract start block

// Contract start block

4

A block number just slightly higher than the first transaction for that address as the second parameter

111

6

Send a test request

Configure PATH for the service you want to test, and run make path_run to start PATH from a local binary.

For information on how to configure PATH for a service, see the Shannon Cheat Sheet.

Then send a request to validate that data is returned correctly for the requested block.

Example eth_getBalance Request

  • The example contract address: 0xee1727f5074E747716637e1776B7F7C7133f16b1

  • A randomly selected block hash (ideally close to the first transaction for that address): 0x15E (350)

Request:

curl http://localhost:3069/v1 \
  -H "Target-Service-Id: F029" \
  -d '{
     "jsonrpc": "2.0",
     "method": "eth_getBalance",
     "id": 1,
     "params": [
        "0xee1727f5074E747716637e1776B7F7C7133f16b1",
        "0x15E"
     ]
  }'

Expect Response:

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x247a76d7647c0000"
}

Additional Resources

  • All Service QoS Configurations

  • How EVM Archival Checks Work

Was this helpful?