Skip to content
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

fet: l2-bridge-arb iterate over l1 #582

Merged
merged 26 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9ec997b
fet: l2-bridge-arb iterate over l1
sergeyWh1te Jul 10, 2024
1e6fab0
fet: l2-bridge-arb iterate over l1
sergeyWh1te Jul 10, 2024
77c808d
feat: l2-bridge-arb iterate over l1
sergeyWh1te Jul 15, 2024
880745f
feat: l2-bridge-arb iterate over l1
sergeyWh1te Jul 15, 2024
bb2e62d
feat: l2-bridge-arb iterate over l1
sergeyWh1te Jul 15, 2024
eaaf772
feat: l2-bridge-arb iterate over l1
sergeyWh1te Jul 16, 2024
a70aae5
feat: decrease searching l2 blocks in past to 6 minutes
sergeyWh1te Jul 17, 2024
e25745e
feat: l2-bridge-arb inc lru cache capacity
sergeyWh1te Jul 17, 2024
ffc119e
feat: l2-bridge-arb fix logging working interval
sergeyWh1te Jul 17, 2024
8602268
feat: l2-bridge-arb fix logging working interval
sergeyWh1te Jul 17, 2024
143a1e4
feat: l2-bridge-arb added sqlite3
sergeyWh1te Jul 19, 2024
9c398d9
feat: l2-bridge-arb added sqlite3
sergeyWh1te Jul 19, 2024
9681357
feat: l2-bridge-arb added sqlite3
sergeyWh1te Jul 19, 2024
83227f7
feat: l2-bridge-arb added sqlite3
sergeyWh1te Jul 19, 2024
159ee63
feat: l2-bridge-arb added sqlite3
sergeyWh1te Jul 19, 2024
070bf1d
feat: l2-bridge-arb added sqlite3
sergeyWh1te Jul 19, 2024
de4125c
feat: l2-bridge-arb added sqlite3
sergeyWh1te Jul 19, 2024
bdf2f83
feat: l2-bridge-arb changed provider
sergeyWh1te Jul 19, 2024
d99c160
feat: l2-bridge-arb changed provider
sergeyWh1te Jul 19, 2024
bd05cab
feat: l2-bridge-arb changed provider
sergeyWh1te Jul 19, 2024
8664193
feat: l2-bridge-arb updated deps
sergeyWh1te Jul 19, 2024
93eaa02
feat: l2-bridge-arb fix digest severity
sergeyWh1te Jul 20, 2024
fdfba5d
feat: l2-bridge-arb fix proxy watcher
sergeyWh1te Jul 22, 2024
25f7c1c
feat: l2-bridge-arb typo fix
sergeyWh1te Jul 23, 2024
4349dea
feat: l2-bridge-arb typo fix
sergeyWh1te Jul 23, 2024
c5ab67e
feat: move l1-arb part from l2-bridge-eth to l2-bridge-arb
sergeyWh1te Jul 29, 2024
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
1 change: 1 addition & 0 deletions l2-bridge-arbitrum/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
!.yarn/releases/
dist/
forta.config.json
.env
5 changes: 3 additions & 2 deletions l2-bridge-arbitrum/.env.sample
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
APP_NAME=l2-bridge-arbitrum
INSTANCE=forta
NETWORK_NAME=Arbitrum

HTTP_PORT=3000
LOG_FORMAT=simple
LOG_LEVEL=debug
ETHEREUM_RPC_URL=https://eth.drpc.com
ARBITRUM_RPC_URL=https://arbitrum.drpc.com
ARBITRUM_RPC_URL=https://arbitrum-one.publicnode.com

USE_FORTA_RPC_URL=true

## FORTA compatible env names
NODE_ENV=local
AGENT_GRPC_PORT=50051
FORTA_CHAIN_ID=42161
FORTA_CHAIN_ID=1
2 changes: 0 additions & 2 deletions l2-bridge-arbitrum/.eslintignore

This file was deleted.

14 changes: 0 additions & 14 deletions l2-bridge-arbitrum/.eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions l2-bridge-arbitrum/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Build stage: compile Typescript to Javascript
FROM node:20.15.0-alpine3.20 AS base
FROM node:20.15.1-alpine3.20 AS base

RUN apk add --no-cache g++=13.2.1_git20240309-r0 make=4.4.1-r2
RUN apk add --no-cache python3=3.12.3-r1 g++=13.2.1_git20240309-r0 make=4.4.1-r2 sqlite=3.45.3-r1

FROM base as builder

Expand All @@ -15,9 +14,10 @@ FROM base as production
LABEL "network.forta.settings.agent-logs.enable"="true"

ENV APP_NAME=l2-bridge-arbitrum
ENV NETWORK_NAME=Arbitrum
ENV NODE_ENV=production
ENV ETHEREUM_RPC_URL=https://eth.drpc.org
ENV ARBITRUM_RPC_URL=https://arbitrum.drpc.org
ENV ARBITRUM_RPC_URL=https://arbitrum-one.publicnode.com

ENV AGENT_GRPC_PORT=50051
ENV HTTP_PORT=3000
Expand Down
35 changes: 25 additions & 10 deletions l2-bridge-arbitrum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,35 @@

## Supported chains

- Arbitrum
- Ethereum, Arbitrum

## Alerts

1. ⚠️ Currently processing Ethereum network block is outdated

1. Router events
1. 🚨🚨🚨 Arbitrum: Token Gateway changed
2. 🚨 Arbitrum Native Bridge: L1 Gateway Router proxy admin changed
3. 🚨 Arbitrum Native Bridge: L1 Gateway Router proxy upgraded
1. Bridge events
1. 🚨🚨🚨 Arbitrum bridge wstETH:stEth balance mismatch
2. 🚨🚨🚨 Arbitrum bridge LDO balance mismatch
3. 🚨 Arbitrum L2 Bridge: Deposits Disabled
4. 🚨 Arbitrum L2 Bridge: Role Admin changed
3. 🚨🚨🚨 Arbitrum L1 Bridge: Implementation initialized
4. 🚨 Arbitrum L1 Bridge: Withdrawals Disabled
5. 🚨 Arbitrum L2 Bridge: Withdrawals Disabled
6. ⚠️ Arbitrum L2 Bridge: Role granted
7. ⚠️ Arbitrum L2 Bridge: Role revoked
8. ℹ️ Arbitrum L2 Bridge: Deposits Enabled
9. ℹ️ Arbitrum L2 Bridge: Withdrawals Enabled
2. Gov Events
6. 🚨 Arbitrum L1 Bridge: Deposits Disabled
7. 🚨 Arbitrum L2 Bridge: Deposits Disabled
8. 🚨 Arbitrum L1 Bridge: Role Admin changed
9. 🚨 Arbitrum L2 Bridge: Role Admin changed
10. ⚠️ Arbitrum L1 Bridge: Role granted
11. ⚠️ Arbitrum L2 Bridge: Role granted
12. ⚠️ Arbitrum L1 Bridge: Role revoked
13. ⚠️ Arbitrum L2 Bridge: Role revoked
14. ℹ️ Arbitrum L1 Bridge: Deposits Enabled
15. ℹ️ Arbitrum L2 Bridge: Deposits Enabled
16. ℹ️ Arbitrum L1 Bridge: Withdrawals Enabled
17. ℹ️ Arbitrum L2 Bridge: Withdrawals Enabled
1. Gov Events
1. 🚨 Arbitrum Gov Bridge: Ethereum Governance Executor Updated
2. 🚨 Arbitrum Gov Bridge: Guardian Updated
3. ⚠️ Arbitrum Gov Bridge: Delay Updated
Expand All @@ -26,11 +40,12 @@
7. ℹ️ Arbitrum Gov Bridge: Action set queued
8. ℹ️ Arbitrum Gov Bridge: Action set executed
9. ℹ️ Arbitrum Gov Bridge: Action set canceled
3. Proxy events
1. Proxy events
1. 🚨 Arbitrum: Proxy ossified
2. 🚨 Arbitrum: Proxy admin changed
3. 🚨 Arbitrum: Proxy implementation changed
4. 🚨 Arbitrum: Proxy upgraded
5. 🚨 Arbitrum: Proxy beacon upgraded
4. Monitor Withdrawals
1. Monitor Withdrawals
1. ⚠️ Arbitrum: Huge withdrawals during the last ...
2. ℹ️ Arbitrum digest
35 changes: 35 additions & 0 deletions l2-bridge-arbitrum/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import eslint from '@eslint/js'
import prettier from 'eslint-plugin-prettier'
import tseslint from 'typescript-eslint'
import tsParser from '@typescript-eslint/parser'
import globals from 'globals'

export default tseslint.config({
...eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
files: ['** /*.ts'],
ignores: ['**/generated', '**/proto'],
plugins: {
prettier,
},
languageOptions: {
globals: {
...globals.node,
},
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
},
},
rules: {
'@typescript-eslint/ array-type': 'error',
'@typescript-eslint/ consistent-type-imports': 'error',
'prettier/prettier': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
curly: 'error',
semi: 'off',
},
})
6 changes: 0 additions & 6 deletions l2-bridge-arbitrum/jest.config.js

This file was deleted.

82 changes: 48 additions & 34 deletions l2-bridge-arbitrum/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "lido-l2-bridge-arbitrum-bot",
"name": "lido-l2-bridge-arbitrum",
"version": "0.0.1",
"license": "MIT",
"description": "Lido Detection Bot for Arbitrum part of L2 bridge",
"chainIds": [
42161
42161,
1
],
"chainSettings": {
"default": {
Expand All @@ -13,7 +15,9 @@
},
"scripts": {
"update-version": "node ../utils/write-version.js",
"build": "tsc && yarn run copy-version && mkdir dist/generated/proto && make gen_proto_prod",
"move-migrations": "mkdir -p dist/db/migrations && cp src/db/migrations/* dist/db/migrations/",
"move-db": "cp -r src/db/* dist/db/",
"build": "tsc && yarn run copy-version && yarn run move-migrations && yarn run move-db && mkdir dist/generated/proto && make gen_proto_prod",
"copy-version": "cp version.json dist",
"start": "ts-node src/main.ts",
"start:prod": "node dist/main.js",
Expand All @@ -24,57 +28,67 @@
"generate-proto": "make gen_ts && make gen_js",
"eslint:lint": "eslint ./src",
"eslint:format": "eslint ./src --fix",
"prettier:check": "prettier --check ./src",
"prettier:format": "prettier --write ./src README.md",
"prettier:check": "prettier --check ./src eslint.config.mjs",
"prettier:format": "prettier --write ./src README.md eslint.config.mjs",
"lint": "yarn run prettier:check && yarn run eslint:lint",
"format": "yarn run eslint:format && yarn run prettier:format",
"postinstall": "yarn generate-types && yarn generate-proto"
},
"dependencies": {
"@ethersproject/abi": "^5.0.0",
"@ethersproject/providers": "^5.0.0",
"@grpc/grpc-js": "^1.10.2",
"@types/lodash": "^4.14.202",
"@types/node": "^20.14.2",
"async-mutex": "^0.4.0",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@grpc/grpc-js": "^1.11.1",
"@types/node": "^20.14.11",
"async-mutex": "^0.5.0",
"bignumber.js": "^9.1.2",
"dotenv": "^16.4.5",
"ethers": "^5.5.1",
"ethers": "^5.7.2",
"express": "^4.19.2",
"forta-agent": "^0.1.48",
"fp-ts": "^2.16.1",
"lodash": "^4.17.21",
"prom-client": "^15.1.2",
"ts-retry": "^4.2.4",
"winston": "^3.11.0"
"fp-ts": "^2.16.8",
"knex": "^3.1.0",
"prom-client": "^15.1.3",
"ts-retry": "^4.2.5",
"winston": "^3.13.1",
"lru-cache": "^11.0.0"
},
"devDependencies": {
"@faker-js/faker": "^8.3.1",
"@faker-js/faker": "^8.4.1",
"@jest/globals": "^29.7.0",
"@tsconfig/node20": "^20.1.2",
"@tsconfig/node20": "^20.1.4",
"@typechain/ethers-v5": "^11.1.2",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.11",
"@types/nodemon": "^1.19.0",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-prettier": "^5.0.1",
"@types/jest": "^29.5.12",
"@types/nodemon": "^1.19.6",
"@types/ws": "^8.5.11",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-prettier": "^5.2.1",
"grpc-tools": "^1.12.4",
"grpc_tools_node_protoc_ts": "^5.3.3",
"husky": "^8.0.3",
"husky": "^9.1.1",
"jest": "^29.7.0",
"nodemon": "^3.0.1",
"postinstall": "^0.8.0",
"prettier": "^3.1.0",
"nodemon": "^3.1.4",
"postinstall": "^0.10.3",
"prettier": "^3.3.3",
"sqlite": "5.1.1",
"sqlite3": "^5.1.7",
"ts-generator": "^0.1.1",
"ts-jest": "^29.1.2",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
"typechain": "^8.3.2",
"typescript": "^5.3.2"
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.0-alpha.46"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"testPathIgnorePatterns": [
"dist"
]
},
"packageManager": "yarn@1.22.22"
}
Loading
Loading