Skip to content

Commit

Permalink
Merge branch 'explorer/866-ci-add-command-to-avoid-mixlock-changes' i…
Browse files Browse the repository at this point in the history
…nto explorer/765-feat-add-search-by-proof-hash
  • Loading branch information
glpecile committed Aug 26, 2024
2 parents 3c6a4e5 + 06f1940 commit b1733bc
Show file tree
Hide file tree
Showing 16 changed files with 1,608 additions and 117 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
ssh -o "StrictHostKeyChecking=no" ${USERNAME}@${HOST_NAME} "
cd ${APP_DIR} &&
git fetch &&
git reset --hard HEAD &&
git clean -fd &&
git checkout ${REF} &&
git pull &&
sudo systemctl restart ${SERVICE_NAME}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/lint-contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint contracts
on:
push:
branches: [main]
pull_request:
branches: ["*"]
paths:
- "contracts/src/core/*.sol"
- ".github/workflows/lint-contracts.yml"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm install
working-directory: contracts

- name: Run Solhint
run: npm run lint:sol
working-directory: contracts
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ anvil_upgrade_index_registry:
@echo "Upgrading Index Registry Contracts..."
. contracts/scripts/anvil/upgrade_index_registry.sh

lint_contracts:
@cd contracts && npm run lint:sol

anvil_start:
@echo "Starting Anvil..."
anvil --load-state contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json
Expand Down Expand Up @@ -441,6 +444,12 @@ upgrade_batcher_payment_service:
build_aligned_contracts:
@cd contracts/src/core && forge build

show_aligned_error_codes:
@echo "\nAlignedLayerServiceManager errors:"
@cd contracts/src/core && forge inspect IAlignedLayerServiceManager.sol:IAlignedLayerServiceManager errors
@echo "\nBatcherPaymentService errors:"
@cd contracts/src/core && forge inspect BatcherPaymentService.sol:BatcherPaymentService errors

__BUILD__:
build_binaries:
@echo "Building aggregator..."
Expand Down
3 changes: 3 additions & 0 deletions alerts/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ RPC_URL=<YOUR_RPC_URL>
CONTRACT_ADDRESS=<YOUR_CONTRACT_ADDRESS>
NEW_BATCH_TOPIC=<YOUR_NEW_BATCH_TOPIC>
VERIFIED_BATCH_TOPIC=<YOUR_VERIFIED_BATCH_TOPIC>
PAGER_DUTY_KEY=<YOUR_PAGER_DUTY_KEY>
PAGER_DUTY_EMAIL=<YOUR_PAGER_DUTY_EMAIL>
PAGER_DUTY_SERVICE_ID=<YOUR_PAGER_DUTY_SERVICE_ID>

# Variables for process_errors_alerts.sh
SERVICE=<YOUR_SERVICE>
Expand Down
8 changes: 8 additions & 0 deletions alerts/contract_alerts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ function send_telegram_message() {
-d disable_notification=true
}

# Function to send PagerDuty alert
# @param message
function send_pagerduty_alert() {
. pagerduty.sh "$1"
}

# Flags to avoid sending multiple alerts
no_new_batches_alert=false
no_verified_batches_alert=false
Expand All @@ -38,6 +44,7 @@ do
message="🚨 ALERT: No new batches in Service Manager since block $from_block"
send_slack_message "$message"
send_telegram_message "$message"
send_pagerduty_alert "$message"
fi
no_new_batches_alert=true
else
Expand All @@ -57,6 +64,7 @@ do
message="🚨 ALERT: No verified batches in Service Manager since block $from_block"
send_slack_message "$message"
send_telegram_message "$message"
send_pagerduty_alert "$message"
fi
no_verified_batches_alert=true
else
Expand Down
16 changes: 16 additions & 0 deletions alerts/pagerduty.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
curl --request POST -s \
--url https://api.pagerduty.com/incidents \
--header 'Accept: application/json' \
--header "Authorization: Token token=$PAGER_DUTY_KEY" \
--header 'Content-Type: application/json' \
--header "From: $PAGER_DUTY_EMAIL"\
--data "{
\"incident\": {
\"type\": \"incident\",
\"title\": \"$1\",
\"service\": {
\"id\": \"$PAGER_DUTY_SERVICE_ID\",
\"type\": \"service_reference\"
}
}
}"
1 change: 1 addition & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ docs/

data/

node_modules/
13 changes: 13 additions & 0 deletions contracts/.solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "solhint:recommended",
"rules": {
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
],
"no-complex-fallback": "off",
"func-name-mixedcase": "off"
}
}
1 change: 1 addition & 0 deletions contracts/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/core/ERC20Mock.sol
Loading

0 comments on commit b1733bc

Please sign in to comment.