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

feat: reporter scripts #26

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
169d011
feat(reporter): <- adds skeleton for this
allemanfredi Oct 13, 2023
e7b600a
create ABI and AMBHeaderReporterCall script
zengzengzenghuy Oct 15, 2023
aa96a8b
WIP: first draft of reporter scripts
zengzengzenghuy Oct 18, 2023
c310d20
WIP: controller with batching blocks functionality
zengzengzenghuy Oct 20, 2023
55d965e
WIP: add Multiclient class
zengzengzenghuy Oct 21, 2023
8e3656e
feat: controller logic
zengzengzenghuy Oct 22, 2023
6f2f1e8
doc: update README.md
zengzengzenghuy Oct 22, 2023
f802b1c
fix: first review
zengzengzenghuy Oct 23, 2023
bf7dd35
fix: second review
zengzengzenghuy Oct 24, 2023
79883e0
remove unused code
zengzengzenghuy Oct 24, 2023
a7fe83e
remove process.env in class and add data field as constructor parameter
zengzengzenghuy Oct 24, 2023
afb0e58
fix: naming of variables
zengzengzenghuy Oct 24, 2023
1fb6f56
fix: change BlockListener constructur to config
zengzengzenghuy Oct 24, 2023
4422cda
refactor: putting all configurable variables under settings/index.ts
zengzengzenghuy Oct 25, 2023
91981fe
fix: remove lastProcessedBlock and move queryBlockLength logic to ind…
zengzengzenghuy Oct 25, 2023
c902049
fix: remove unused code
zengzengzenghuy Oct 25, 2023
32dffd9
chore(evm): adds gitignore
allemanfredi Oct 25, 2023
96a5ff4
feat: allow each controllers to set interval individually
zengzengzenghuy Oct 26, 2023
5cb88f7
Merge branch 'feat/reporter' of https://github.com/gnosis/hashi into …
zengzengzenghuy Oct 26, 2023
466ef45
feat: added isLightClient check and separate intervals for LC based r…
zengzengzenghuy Oct 26, 2023
fc6c679
feat(reporter): improves classes design, rm not used code and improve…
allemanfredi Oct 26, 2023
5d1cac5
refactor(reporter): rn some vars
allemanfredi Oct 26, 2023
c2e7dff
chore(reporter): fixes compile erros
allemanfredi Oct 27, 2023
40dca77
chore(reporter): rm package-lock.json
allemanfredi Oct 27, 2023
bc7b6f6
feat(reporter): <- dockerizes it
allemanfredi Oct 27, 2023
06b07b1
fix: update .env.example
zengzengzenghuy Oct 27, 2023
719ad57
Merge branch 'feat/reporter' of https://github.com/gnosis/hashi into …
zengzengzenghuy Oct 27, 2023
d0a0972
feat(reporter): handles concurrency for sending a transaction and rn …
allemanfredi Oct 27, 2023
89f4815
Merge branch 'feat/reporter' of https://github.com/gnosis/hashi into …
allemanfredi Oct 27, 2023
baecfdc
fix: update .env.example
zengzengzenghuy Oct 30, 2023
2ba2c56
fix: TelepathyReporterCntroller logic
zengzengzenghuy Oct 30, 2023
b19e6de
Merge branch 'main' into feat/reporter
zengzengzenghuy Nov 3, 2023
742c4c8
feat(reporter): adds more settings and limit AMBReporterController to…
allemanfredi Nov 10, 2023
86d0ac9
fix: wrong transaction nonce error for Telepathy
zengzengzenghuy Nov 14, 2023
12ef0c1
Merge branch 'main' into feat/reporter
allemanfredi Nov 23, 2023
acfb232
feat(reporter): adds WormholeReporterController
allemanfredi Nov 24, 2023
d08d9c1
feat(reporter): adds OptimismReporterController
allemanfredi Nov 24, 2023
ae7a3f6
feat(reporter): adds AxelarReporterController
allemanfredi Nov 24, 2023
3e27cfd
refactor(reporter): adds reporterAddresses within BaseController
allemanfredi Nov 27, 2023
e4a95a3
feat(reporter): adds ConnextReporterController
allemanfredi Nov 27, 2023
94cd1c4
feat(reporter): adds StandardReporterController and adds support to c…
allemanfredi Nov 27, 2023
ec2db70
fix(reporter): fixes wrong param
allemanfredi Nov 27, 2023
7fc61c0
feat(reporter): adds support for ccip, hyperlane and l0
allemanfredi Nov 28, 2023
25f3abf
fix(reporter): fixes lastProcessedBlock within TelepathyReporterContr…
allemanfredi Nov 29, 2023
c2812c7
feat(reporter): adds new l0 and ccip adapters and adds support for ze…
allemanfredi Nov 29, 2023
578ac99
Merge branch 'main' into feat/reporter
allemanfredi Nov 29, 2023
6eb8586
feat(reporter): enabled SygmaReporterController
allemanfredi Dec 1, 2023
e49c49f
feat(reporter): adds ElectronReporterController and changes tsconfig.…
allemanfredi Dec 7, 2023
11e7a86
refactor(reporter): rm fs
allemanfredi Dec 7, 2023
5993963
refactor(reporter): refactors getHeader
allemanfredi Dec 7, 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
17 changes: 17 additions & 0 deletions packages/reporter/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
PRIVATE_KEY=

GOERLI_RPC_URL=
GNOSIS_RPC_URL=
SOURCE_CHAIN=goerli
DEST_CHAIN=gnosis


AMB_CONTROLLER=false
GAS=30000

SYGMA_CONTROLLER=false
SYGMA_FEE_DATA=0x

TELEPATHY_CONTROLLER=false
TELEPATHY_PROOF_API_URL=https://api.telepathy.xyz/api/hashi/

2 changes: 2 additions & 0 deletions packages/reporter/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/dist
**/node_modules
21 changes: 21 additions & 0 deletions packages/reporter/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "prettier"
parser: "@typescript-eslint/parser"
parserOptions:
project: "tsconfig.json"
plugins:
- "@typescript-eslint"
root: true
rules:
"@typescript-eslint/no-floating-promises":
- error
- ignoreIIFE: true
ignoreVoid: true
"@typescript-eslint/no-inferrable-types": "off"
"@typescript-eslint/no-unused-vars":
- error
- argsIgnorePattern: "_"
varsIgnorePattern: "_"
1 change: 1 addition & 0 deletions packages/reporter/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
2 changes: 2 additions & 0 deletions packages/reporter/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/dist
**/node_modules
7 changes: 7 additions & 0 deletions packages/reporter/.prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bracketSpacing: true
printWidth: 120
proseWrap: "always"
singleQuote: false
tabWidth: 2
trailingComma: "all"
semi: false
26 changes: 26 additions & 0 deletions packages/reporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# reporter

Script to call Header Reporter contracts of different oracle from source chain to destination chain.

## Run the script

1. Configure the correct node version by running `nvm use`
2. Installing packages by running `npm install`
3. Create `.env` file and define the configuration to run.
4. run `ts-node src/index.ts`

## Configuration

Configure the mode you want to run by editing the variable in `.env`

1. `_CONTROLLER` (true/false): to enable the controller
2. `SOURCE_CHAIN` (string value of chain): Define the source chain to collect the block header from.
3. `DEST_CHAIN` (string value of chain): Define the destination chain to report the source chain's block header to.

## Adding a new controller

1. Add a new file under `/controller`, create the constructor and `onBlocks` function to call block header reporter
contract periodically.
2. Add the contract addresses under `utils/address.json`.
3. Add the new controller instant in `index.ts`.
4. Add the env variable in `.env.example`.
6 changes: 6 additions & 0 deletions packages/reporter/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"watch": ["src"],
"ext": "ts,json",
"ignore": ["src/**/*.spec.ts"],
"exec": "ts-node ./src/index.ts"
}
Loading
Loading