Skip to content

Migrate to AirseekerRegistry contract #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 8, 2024
Merged
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ sensitive information inside secrets.

#### `sponsorWalletMnemonic`

The mnemonic of the wallet used to derive sponsor wallets. Sponsor wallets are derived for each dAPI separately. It is
recommended to interpolate this value from secrets. For example:
The mnemonic of the wallet used to derive sponsor wallets. Sponsor wallets are derived for each data feed separately. It
is recommended to interpolate this value from secrets. For example:

```jsonc
// The mnemonic is interpolated from the "SPONSOR_WALLET_MNEMONIC" secret.
Expand Down Expand Up @@ -152,9 +152,9 @@ A record of contract addresses used by Airseeker.
The address of the Api3ServerV1 contract. If not specified, the address is loaded from the
[Airnode protocol v1](https://github.com/api3dao/airnode-protocol-v1) repository.

###### `DapiDataRegistry`
###### `AirseekerRegistry`

The address of the DapiDataRegistry contract.
The address of the AirseekerRegistry contract.

##### `providers`

Expand Down Expand Up @@ -209,7 +209,7 @@ The interval specifying how often to run the data feed update loop. In seconds.

##### `dataFeedBatchSize`

The batch size of active dAPIs that are to be fetched in a single RPC call.
The batch size of active data feeds that are to be fetched in a single RPC call.

##### `fallbackGasLimit` _(optional)_

Expand Down
24 changes: 12 additions & 12 deletions airseeker_v2_pipeline.drawio
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<mxfile host="app.diagrams.net" modified="2023-11-09T08:39:31.290Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" etag="yRIwGNZNJzACz53eiixr" version="22.1.0" type="device">
<mxfile host="app.diagrams.net" modified="2023-12-21T19:45:16.966Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" etag="rNfqhbre3VsZqO3wsoVr" version="22.1.11" type="device">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1259" dy="680" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="3300" pageHeight="4681" math="0" shadow="0">
<mxGraphModel dx="1259" dy="676" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="3300" pageHeight="4681" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="ci7EG28U3f9VGxeywyoC-37" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-28" target="ci7EG28U3f9VGxeywyoC-34" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="HytMPlxkX1mnba_mCnJT-0" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-28" target="ci7EG28U3f9VGxeywyoC-115">
<mxCell id="HytMPlxkX1mnba_mCnJT-0" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-28" target="ci7EG28U3f9VGxeywyoC-115" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-28" value="Repeat indefinitely, after every&lt;br&gt;&lt;i&gt;signedDataFetchInterval.&lt;br&gt;&lt;/i&gt;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
Expand Down Expand Up @@ -71,7 +71,7 @@
<mxCell id="ci7EG28U3f9VGxeywyoC-60" value="for each batch&lt;br&gt;in a single RPC call&lt;br&gt;in a staggered way" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-53" target="ci7EG28U3f9VGxeywyoC-57" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-53" value="Multicall to get the first batch of active dAPIs along with the total count of active dAPIs." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-53" value="Multicall to get the first batch of active data feeds along with their count." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="880" y="1479" width="240" height="80" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-55" value="fetch&amp;nbsp;from" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-53" target="ci7EG28U3f9VGxeywyoC-56" edge="1">
Expand All @@ -82,7 +82,7 @@
<mxCell id="ci7EG28U3f9VGxeywyoC-56" value="Chain" style="rhombus;whiteSpace=wrap;html=1;rounded=1;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="960" y="1639" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-70" value="for all active dAPIs&lt;br&gt;in the batch" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-57" target="ci7EG28U3f9VGxeywyoC-69" edge="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-70" value="for all active data&lt;br&gt;feeds in the batch" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-57" target="ci7EG28U3f9VGxeywyoC-69" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-57" value="" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
Expand All @@ -102,7 +102,7 @@
<mxCell id="ci7EG28U3f9VGxeywyoC-62" value="Call signed API URL." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="900" y="820" width="240" height="80" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-69" value="Persist the Airnode addresses, template IDs, signed API URLs and on-chain values for these dAPIs." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-69" value="Persist the Airnode addresses, template IDs, signed API URLs and on-chain values for these data feeds." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="1680" y="1479" width="240" height="80" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-74" value="write to" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-69" target="ci7EG28U3f9VGxeywyoC-75" edge="1">
Expand All @@ -113,27 +113,27 @@
<mxCell id="ci7EG28U3f9VGxeywyoC-75" value="State" style="ellipse;whiteSpace=wrap;html=1;rounded=1;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="1760" y="1639" width="80" height="81" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-87" value="for all dAPIs" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="ci7EG28U3f9VGxeywyoC-86" edge="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-87" value="for all data feeds" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="ci7EG28U3f9VGxeywyoC-86" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1920" y="1520" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-78" value="" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="1290" y="1490" width="240" height="80" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-79" value="Fetch the rest of the active dAPI batches together with Airnode address, template ID(s), signed API URLs and on chain values." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-79" value="Fetch the rest of the active data feed batches together with Airnode address, template ID(s), signed API URLs and on chain values." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="1300" y="1499" width="240" height="80" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-89" value="if there is any dAPI &lt;br&gt;to be updated" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-86" target="ci7EG28U3f9VGxeywyoC-88" edge="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-89" value="if there is any data feed&lt;br&gt;to be updated" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-86" target="ci7EG28U3f9VGxeywyoC-88" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-86" value="Determine which dAPIs need to &lt;br&gt;be updated." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-86" value="Determine which data feeds need to &lt;br&gt;be updated." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="2080" y="1480" width="240" height="80" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-91" value="for each dAPI that needs &lt;br&gt;to be updated" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-88" target="ci7EG28U3f9VGxeywyoC-90" edge="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-91" value="for each data feed that &lt;br&gt;needs to be updated" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-88" target="ci7EG28U3f9VGxeywyoC-90" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-88" value="Run gas collector and calculate gas price&lt;br&gt;(once for all dAPIs)." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxCell id="ci7EG28U3f9VGxeywyoC-88" value="Run gas collector and calculate gas price&lt;br&gt;(once for all data feeds)." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="2480" y="1480" width="240" height="80" as="geometry" />
</mxCell>
<mxCell id="ci7EG28U3f9VGxeywyoC-97" value="for each update &lt;br&gt;transaction" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-90" target="ci7EG28U3f9VGxeywyoC-96" edge="1">
Expand Down
2 changes: 1 addition & 1 deletion airseeker_v2_pipeline.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion config/airseeker.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"31337": {
"contracts": {
"Api3ServerV1": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
"DapiDataRegistry": "0xDD78254f864F97f65e2d86541BdaEf88A504D2B2"
"AirseekerRegistry": "0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0"
},
"providers": {
"hardhat": {
Expand Down
3 changes: 1 addition & 2 deletions contracts/contract-imports.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.18;

import "@api3/dapi-management/contracts/DapiDataRegistry.sol";
import "@api3/dapi-management/contracts/HashRegistry.sol";
import "@api3/dapi-management/contracts/AirseekerRegistry.sol";
2 changes: 1 addition & 1 deletion local-test-configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ also required for the monitoring page.

- Open the monitoring page located in `local-test-configuration/monitoring/index.html` in a browser with the following
query parameters appended
`?api3ServerV1Address=<DEPLOYED_API3_SERVER_V1_ADDRESS>&dapiDataRegistryAddress=<DEPLOYED_DAPI_DATA_REGISTRY_ADDRESS>&rpcUrl=<RPC_URL>&airseekerMnemonic=<AIRSEEKER_MNEMONIC>`
`?airseekerRegistryAddress=<DEPLOYED_AIRSEEKER_REGISTRY_ADDRESS>&rpcUrl=<RPC_URL>&airseekerMnemonic=<AIRSEEKER_MNEMONIC>`
and open console.

The `AIRSEEKER_MNEMONIC` needs to be URI encoded via `encodeURIComponent` in JS. For example,
Expand Down
2 changes: 1 addition & 1 deletion local-test-configuration/airseeker/airseeker.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"31337": {
"contracts": {
"Api3ServerV1": "${API3_SERVER_V1_ADDRESS}",
"DapiDataRegistry": "${DAPI_DATA_REGISTRY_ADDRESS}"
"AirseekerRegistry": "${AIRSEEKER_REGISTRY_ADDRESS}"
},
"providers": {
"hardhat": {
Expand Down
4 changes: 2 additions & 2 deletions local-test-configuration/airseeker/secrets.example.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ SPONSOR_WALLET_MNEMONIC=
LOCALHOST_IP=localhost
# NOTE: Use instructions to deploy the contracts and paste the Api3ServerV1 address.
API3_SERVER_V1_ADDRESS=
# NOTE: Use instructions to deploy the contracts and paste the DapiDataRegistry address.
DAPI_DATA_REGISTRY_ADDRESS=
# NOTE: Use instructions to deploy the contracts and paste the AirseekerRegistry address.
AIRSEEKER_REGISTRY_ADDRESS=
Loading