Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Airseeker monitoring changes to accommodate Grafana #432

Merged
merged 41 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1b27618
Expose serverless example items as variables
aquarat Jun 29, 2023
4a867bf
Revert yml modification
aquarat Jun 29, 2023
e346374
Add wallet monitoring and printing of sponsor wallet addresses
aquarat Jul 5, 2023
de664ef
Move empty wallet check deeper in stack
aquarat Jul 5, 2023
6aeefde
Comment unnecessary test (for monitoring)
aquarat Jul 7, 2023
8e4fd7b
Make floats strings in DB, add reporting for beaconsets
aquarat Jul 24, 2023
088619b
Add bignumber.js
aquarat Jul 24, 2023
e036a99
Fix threshold calculation
aquarat Jul 24, 2023
e4c1ce1
Paranoid fix
aquarat Jul 24, 2023
566da56
Modify schema
aquarat Jul 25, 2023
fe180f5
Only log beaconset values
aquarat Jul 25, 2023
f916605
Revert schema, make values include 10e18
aquarat Jul 25, 2023
6cc8f5e
Extend schema
aquarat Jul 27, 2023
9a79e01
Update schema
aquarat Jul 28, 2023
17832b0
Alerting fixes
aquarat Jul 31, 2023
eda7780
Alerting fixes
aquarat Jul 31, 2023
45b5e1e
Compound values with Nodary retrieval and wallet balances as floats
aquarat Aug 2, 2023
247a1b5
Compound values (Nodary) and float wallet balances
aquarat Aug 3, 2023
1133ce8
Add DB chains export and use that for chain names
aquarat Aug 3, 2023
2fcce91
Add prisma migrations
aquarat Aug 3, 2023
1536324
Add additional indexes to support the dashboard
aquarat Aug 8, 2023
5d254db
Refactor chain names, remove wallet balance reporting, amend schema
aquarat Aug 9, 2023
d5305f2
Refactor chain names, remove wallet balance reporting, amend schema
aquarat Aug 9, 2023
bac6ddc
Add in alerting for Nodary
aquarat Aug 10, 2023
8ce58a7
Add gateway failure alerting
aquarat Aug 10, 2023
aa810bf
Add gateway failure alerting and additional Prisma migrations
aquarat Aug 10, 2023
05ecf8f
Add some documentation, remove problematic console.log
aquarat Aug 10, 2023
31d2864
Add bad RPC detection and add logging for bad RPC URLs
aquarat Aug 11, 2023
c664584
Fix reference deviation issue where reference value was unavailable
aquarat Aug 16, 2023
7b5357a
Add alert close and modify alias to prevent conflict
aquarat Aug 16, 2023
4a7bd19
Move dAPI Name further up in scope
aquarat Aug 16, 2023
5b40cbc
Extra alert detail
aquarat Aug 16, 2023
0482a0e
More alert detail
aquarat Aug 16, 2023
02c089d
More resilient missing nodary value check
aquarat Aug 16, 2023
5d33259
Add additional migrations, fix tests
aquarat Aug 22, 2023
f09f0f1
More tests, revert wallet watching components
aquarat Aug 22, 2023
f43dd2e
Turn off e2e tests and remove unused dependency
aquarat Aug 22, 2023
3f103aa
Turn off e2e tests and remove unused dependency
aquarat Aug 22, 2023
5266ad6
Add migration for cumulativeGasUsed
aquarat Aug 28, 2023
c82fed3
Add indexes to schema.prisma and detail
aquarat Aug 28, 2023
196b9d2
Hash gateway urls to obfuscate them
aquarat Oct 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,26 @@ jobs:
- name: Test
run: yarn test

test-e2e:
name: Test e2e
runs-on: ubuntu-latest
timeout-minutes: 10
# Don't run twice for a push within an internal PR
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Clone Airseeker
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.TARGET_NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run testing services
run: yarn dev:testing-services:start
- name: Test E2E
run: yarn test:e2e
# test-e2e:
# name: Test e2e
# runs-on: ubuntu-latest
# timeout-minutes: 10
# # Don't run twice for a push within an internal PR
# if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
# steps:
# - name: Clone Airseeker
# uses: actions/checkout@v2
# - name: Setup Node
# uses: actions/setup-node@v2
# with:
# node-version: ${{ env.TARGET_NODE_VERSION }}
# cache: 'yarn'
# - name: Install Dependencies
# run: yarn install --frozen-lockfile
# - name: Run testing services
# run: yarn dev:testing-services:start
# - name: Test E2E
# run: yarn test:e2e

required-checks-passed:
name: All required checks passed
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ logs
# Vercel ncc build files
ncc

.DS_Store
.DS_Store

# Don't commit the actual serverless.yml file
serverless.yml
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,20 @@
"@api3/airnode-node": "^0.11.0",
"@api3/airnode-protocol": "^0.11.0",
"@api3/airnode-protocol-v1": "1.2.4",
"@api3/operations-utilities": "^0.2.0",
"@api3/airnode-validator": "^0.11.0",
"@api3/operations-utilities": "^0.2.0",
"@api3/promise-utils": "^0.4.0",
"@prisma/client": "^4.14.1",
"@vercel/ncc": "^0.36.1",
"axios": "^1.1.3",
"bignumber.js": "^9.1.1",
"bottleneck": "^2.19.5",
"ethers": "^5.7.2",
"lodash": "^4.17.21",
"prisma": "^4.14.1",
"promise.any": "^2.0.4",
"source-map-support": "^0.5.21",
"zod": "^3.17.3",
"@prisma/client": "^4.14.1",
"prisma": "^4.14.1"
"zod": "^3.17.3"
},
"devDependencies": {
"@api3/airnode-admin": "0.11.0",
Expand Down
31 changes: 0 additions & 31 deletions prisma/migrations/20230524133956_initial/migration.sql

This file was deleted.

85 changes: 85 additions & 0 deletions prisma/migrations/20230725145331_initial/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
-- CreateTable
CREATE TABLE "BeaconMetadata" (
"dataFeedId" TEXT NOT NULL,
"name" TEXT NOT NULL,
"providerName" TEXT NOT NULL,

CONSTRAINT "BeaconMetadata_pkey" PRIMARY KEY ("dataFeedId")
);

-- CreateTable
CREATE TABLE "BeaconSetMetadata" (
"dataFeedId" TEXT NOT NULL,
"name" TEXT NOT NULL,
"beaconIds" TEXT[],

CONSTRAINT "BeaconSetMetadata_pkey" PRIMARY KEY ("dataFeedId")
);

-- CreateTable
CREATE TABLE "BeaconSetChildren" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"beaconSetId" TEXT NOT NULL,
"name" TEXT NOT NULL,
"beaconId" TEXT NOT NULL,

CONSTRAINT "BeaconSetChildren_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "DataFeedApiValue" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"when" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"dataFeedId" TEXT NOT NULL,
"apiValue" DOUBLE PRECISION NOT NULL,
"timestamp" TIMESTAMP(3) NOT NULL,
"fromNodary" BOOLEAN NOT NULL DEFAULT false,

CONSTRAINT "DataFeedApiValue_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "DeviationValue" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"when" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"dataFeedId" TEXT NOT NULL,
"chainId" TEXT NOT NULL,
"deviation" DOUBLE PRECISION NOT NULL,

CONSTRAINT "DeviationValue_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "WalletBalance" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"when" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"walletAddress" TEXT NOT NULL,
"chainId" TEXT NOT NULL,
"balance" TEXT NOT NULL,

CONSTRAINT "WalletBalance_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE INDEX "BeaconMetadata_dataFeedId_idx" ON "BeaconMetadata"("dataFeedId");

-- CreateIndex
CREATE INDEX "BeaconMetadata_name_idx" ON "BeaconMetadata"("name");

-- CreateIndex
CREATE INDEX "BeaconMetadata_providerName_idx" ON "BeaconMetadata"("providerName");

-- CreateIndex
CREATE INDEX "BeaconSetMetadata_dataFeedId_idx" ON "BeaconSetMetadata"("dataFeedId");

-- CreateIndex
CREATE INDEX "BeaconSetMetadata_name_idx" ON "BeaconSetMetadata"("name");

-- CreateIndex
CREATE INDEX "DataFeedApiValue_dataFeedId_idx" ON "DataFeedApiValue"("dataFeedId");

-- CreateIndex
CREATE INDEX "DeviationValue_dataFeedId_chainId_idx" ON "DeviationValue"("dataFeedId", "chainId");

-- CreateIndex
CREATE INDEX "WalletBalance_walletAddress_chainId_idx" ON "WalletBalance"("walletAddress", "chainId");
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- CreateTable
CREATE TABLE "NodaryApiValues" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"dataFeedId" TEXT NOT NULL,
"name" TEXT NOT NULL,
"apiValue" DOUBLE PRECISION NOT NULL,
"nodaryDeviation" DOUBLE PRECISION NOT NULL,
"providerName" TEXT NOT NULL,

CONSTRAINT "NodaryApiValues_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "BeaconSetEvents" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"when" TIMESTAMP(3) NOT NULL,
"dataFeedId" TEXT NOT NULL,
"apiValue" DOUBLE PRECISION NOT NULL,
"chain" TEXT NOT NULL,
"name" TEXT NOT NULL,
"nodaryDeviation" DOUBLE PRECISION NOT NULL,

CONSTRAINT "BeaconSetEvents_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "DApiMetadata" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"name" TEXT NOT NULL,
"beaconSetId" TEXT,
"beaconId" TEXT,

CONSTRAINT "DApiMetadata_pkey" PRIMARY KEY ("id")
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE "LastBeaconSetEventsTracking" (
"chainId" TEXT NOT NULL,
"chainName" TEXT NOT NULL,
"lastEvent" TIMESTAMP(3) NOT NULL,

CONSTRAINT "LastBeaconSetEventsTracking_pkey" PRIMARY KEY ("chainId")
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- Added the required column `nodaryTimestampDelta` to the `NodaryApiValues` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "NodaryApiValues" ADD COLUMN "nodaryTimestampDelta" INTEGER NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- Added the required column `when` to the `NodaryApiValues` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "NodaryApiValues" ADD COLUMN "when" TIMESTAMP(3) NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "BeaconSetEvents" ADD COLUMN "inBeaconSet" BOOLEAN NOT NULL DEFAULT false;

-- AlterTable
ALTER TABLE "NodaryApiValues" ADD COLUMN "inBeaconSet" BOOLEAN NOT NULL DEFAULT false;
21 changes: 21 additions & 0 deletions prisma/migrations/20230727143733_add_trimmed_dapis/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- CreateTable
CREATE TABLE "TrimmedDApi" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"name" TEXT NOT NULL,
"dataFeedId" TEXT NOT NULL,
"isBeaconSet" BOOLEAN NOT NULL,
"category" TEXT NOT NULL,
"chainName" TEXT NOT NULL,
"supplierCategory" TEXT NOT NULL,
"fundingStatus" TEXT NOT NULL,
"displayOnMarket" BOOLEAN NOT NULL,
"isNewListing" BOOLEAN NOT NULL,
"estimatedExpiry" TIMESTAMP(3),
"managedAvailable" BOOLEAN NOT NULL,
"upgradeStatus" TEXT NOT NULL,

CONSTRAINT "TrimmedDApi_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "TrimmedDApi_name_chainName_key" ON "TrimmedDApi"("name", "chainName");
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX "NodaryApiValues_when_name_idx" ON "NodaryApiValues"("when", "name");
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- CreateTable
CREATE TABLE "NodaryProvidersFlat" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"feedName" TEXT NOT NULL,
"provider" TEXT NOT NULL,

CONSTRAINT "NodaryProvidersFlat_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "NodaryProvidersAsArrays" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"feedName" TEXT NOT NULL,
"provider" TEXT[],

CONSTRAINT "NodaryProvidersAsArrays_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE INDEX "BeaconSetEvents_when_name_idx" ON "BeaconSetEvents"("when", "name");
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Warnings:

- Changed the type of `balance` on the `WalletBalance` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.

*/
-- AlterTable
ALTER TABLE "BeaconSetEvents" ADD COLUMN "children" TEXT[];

-- AlterTable
ALTER TABLE "WalletBalance" DROP COLUMN "balance",
ADD COLUMN "balance" DOUBLE PRECISION NOT NULL;

-- CreateTable
CREATE TABLE "CompoundValues" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"when" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"dapiName" TEXT NOT NULL,
"chain" TEXT NOT NULL,
"dataFeedId" TEXT NOT NULL,
"onChainValue" DOUBLE PRECISION NOT NULL,
"offChainValue" DOUBLE PRECISION NOT NULL,
"onOffChainDeviation" DOUBLE PRECISION NOT NULL,
"nodaryDeviation" DOUBLE PRECISION NOT NULL,
"nodaryValue" DOUBLE PRECISION NOT NULL,
"onChainTimestamp" TIMESTAMP(3) NOT NULL,
"timestampDelta" INTEGER NOT NULL,

CONSTRAINT "CompoundValues_pkey" PRIMARY KEY ("id")
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX "NodaryApiValues_dataFeedId_idx" ON "NodaryApiValues"("dataFeedId");
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX "TrimmedDApi_chainName_supplierCategory_idx" ON "TrimmedDApi"("chainName", "supplierCategory");
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
Warnings:

- You are about to drop the column `chain` on the `CompoundValues` table. All the data in the column will be lost.
- You are about to drop the column `chainId` on the `DeviationValue` table. All the data in the column will be lost.
- You are about to drop the column `chainId` on the `WalletBalance` table. All the data in the column will be lost.
- You are about to drop the `LastBeaconSetEventsTracking` table. If the table is not empty, all the data it contains will be lost.
- Added the required column `chainName` to the `CompoundValues` table without a default value. This is not possible if the table is not empty.
- Added the required column `chainName` to the `DeviationValue` table without a default value. This is not possible if the table is not empty.
- Added the required column `chainName` to the `WalletBalance` table without a default value. This is not possible if the table is not empty.
- Added the required column `name` to the `WalletBalance` table without a default value. This is not possible if the table is not empty.

*/
-- DropIndex
DROP INDEX "DeviationValue_dataFeedId_chainId_idx";

-- DropIndex
DROP INDEX "WalletBalance_walletAddress_chainId_idx";

-- AlterTable
ALTER TABLE "CompoundValues" RENAME COLUMN "chain" TO "chainName";

-- AlterTable
ALTER TABLE "DeviationValue" RENAME COLUMN "chainId" TO "chainName";

-- AlterTable
ALTER TABLE "WalletBalance" RENAME COLUMN "chainId" TO "chainName";
ALTER TABLE "WalletBalance" ADD COLUMN "name" TEXT NOT NULL DEFAULT 'Airseeker';

-- DropTable
DROP TABLE "LastBeaconSetEventsTracking";

-- CreateIndex
CREATE INDEX "DeviationValue_dataFeedId_chainName_idx" ON "DeviationValue"("dataFeedId", "chainName");

-- CreateIndex
CREATE INDEX "WalletBalance_walletAddress_chainName_idx" ON "WalletBalance"("walletAddress", "chainName");
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "WalletBalance" ALTER COLUMN "name" DROP DEFAULT;
Loading