Skip to content

Commit 1ecf17e

Browse files
committed
Merge branch 'refs/heads/staging' into explorer_ansible
# Conflicts: # Makefile # infra/ansible/playbooks/elixir.yaml # infra/ansible/playbooks/postgres.yaml # infra/ansible/stage_inventory.yaml
2 parents 82e6a1d + d6004dc commit 1ecf17e

149 files changed

Lines changed: 29333 additions & 1097 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/foundry-gas-diff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}
3636

3737
- name: Compare gas reports
38-
uses: Rubilmax/foundry-gas-diff@v3.16
38+
uses: Rubilmax/foundry-gas-diff@v3.21
3939
with:
4040
summaryQuantile: 0.9 # only display the 10% most significant gas diffs in the summary (defaults to 20%)
4141
sortCriteria: avg,max # sort diff rows by criteria

.github/workflows/send-proofs-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- '**.md'
1111

1212
concurrency:
13-
group: pull_request-${{ github.event.pull_request.number }}
13+
group: ${{ github.event_name == 'merge_group' && format('merge_group-{0}', github.event.merge_group.head_sha) || format('pull_request-{0}', github.event.pull_request.number) }}
1414
cancel-in-progress: true
1515

1616
jobs:

Makefile

Lines changed: 136 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ CONFIG_FILE?=config-files/config.yaml
77
export OPERATOR_ADDRESS ?= $(shell yq -r '.operator.address' $(CONFIG_FILE))
88
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml
99

10-
OPERATOR_VERSION=v0.13.0
10+
OPERATOR_VERSION=v0.14.0
11+
EIGEN_SDK_GO_VERSION_TESTNET=v0.2.0-beta.1
12+
EIGEN_SDK_GO_VERSION_MAINNET=v0.1.13
1113

1214
ifeq ($(OS),Linux)
1315
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux
@@ -30,6 +32,16 @@ ifeq ($(OS),Darwin)
3032
BUILD_OPERATOR = $(MAKE) build_operator_macos
3133
endif
3234

35+
ifeq ($(ENVIRONMENT), devnet)
36+
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_devnet
37+
else ifeq ($(ENVIRONMENT), testnet)
38+
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_testnet
39+
else ifeq ($(ENVIRONMENT), mainnet)
40+
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_mainnet
41+
else
42+
GET_SDK_VERSION = $(MAKE) operator_set_eigen_sdk_go_version_error
43+
endif
44+
3345

3446
FFI_FOR_RELEASE ?= true
3547

@@ -140,7 +152,13 @@ anvil_start_with_block_time_with_more_prefunded_accounts:
140152

141153
_AGGREGATOR_:
142154

155+
build_aggregator:
156+
$(GET_SDK_VERSION)
157+
@echo "Building aggregator"
158+
@go build -o ./build/aligned-aggregator ./aggregator/cmd/main.go
159+
143160
aggregator_start:
161+
$(GET_SDK_VERSION)
144162
@echo "Starting Aggregator..."
145163
@go run aggregator/cmd/main.go --config $(AGG_CONFIG_FILE) \
146164
2>&1 | zap-pretty
@@ -156,15 +174,31 @@ test_go_retries:
156174
__OPERATOR__:
157175

158176
operator_start:
177+
$(GET_SDK_VERSION)
159178
@echo "Starting Operator..."
160179
go run operator/cmd/main.go start --config $(CONFIG_FILE) \
161180
2>&1 | zap-pretty
162181

182+
operator_set_eigen_sdk_go_version_testnet:
183+
@echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_TESTNET)"
184+
go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_TESTNET)
185+
186+
operator_set_eigen_sdk_go_version_devnet: operator_set_eigen_sdk_go_version_mainnet
187+
188+
operator_set_eigen_sdk_go_version_mainnet:
189+
@echo "Setting Eigen SDK version to: $(EIGEN_SDK_GO_VERSION_MAINNET)"
190+
go get github.com/Layr-Labs/eigensdk-go@$(EIGEN_SDK_GO_VERSION_MAINNET)
191+
192+
operator_set_eigen_sdk_go_version_error:
193+
@echo "Error setting Eigen SDK version, missing ENVIRONMENT. Possible values for ENVIRONMENT=<devnet|testnet|mainnet>"
194+
exit 1
195+
163196
operator_full_registration: operator_get_eth operator_register_with_eigen_layer operator_mint_mock_tokens operator_deposit_into_mock_strategy operator_whitelist_devnet operator_register_with_aligned_layer
164197

165-
operator_register_and_start: operator_full_registration operator_start
198+
operator_register_and_start: $(GET_SDK_VERSION) operator_full_registration operator_start
166199

167200
build_operator: deps
201+
$(GET_SDK_VERSION)
168202
$(BUILD_OPERATOR)
169203

170204
build_operator_macos:
@@ -178,6 +212,7 @@ build_operator_linux:
178212
@echo "Operator built into /operator/build/aligned-operator"
179213

180214
update_operator:
215+
$(GET_SDK_VERSION)
181216
@echo "Updating Operator..."
182217
@./scripts/fetch_latest_release.sh
183218
@make build_operator
@@ -290,6 +325,24 @@ verifier_disable:
290325
@echo "Disabling verifier with ID: $(VERIFIER_ID)"
291326
@. contracts/scripts/.env && . contracts/scripts/disable_verifier.sh $(VERIFIER_ID)
292327

328+
strategies_get_weight:
329+
@echo "Getting weight of strategy: $(STRATEGY_INDEX)"
330+
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/get_strategy_weight.sh $(STRATEGY_INDEX)
331+
332+
strategies_update_weight:
333+
@echo "Updating strategy weights: "
334+
@echo "STRATEGY_INDICES: $(STRATEGY_INDICES)"
335+
@echo "NEW_MULTIPLIERS: $(NEW_MULTIPLIERS)"
336+
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/update_strategy_weight.sh $(STRATEGY_INDICES) $(NEW_MULTIPLIERS)
337+
338+
strategies_remove:
339+
@echo "Removing strategies: $(INDICES_TO_REMOVE)"
340+
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/remove_strategy.sh $(INDICES_TO_REMOVE)
341+
342+
strategies_get_addresses:
343+
@echo "Getting strategy addresses"
344+
@. contracts/scripts/.env.$(NETWORK) && . contracts/scripts/get_restakeable_strategies.sh
345+
293346
__BATCHER__:
294347

295348
BURST_SIZE ?= 5
@@ -486,16 +539,15 @@ task_sender_send_infinite_proofs_devnet:
486539
cargo run --release -- send-infinite-proofs \
487540
--burst-size $(BURST_SIZE) --burst-time-secs $(BURST_TIME_SECS) \
488541
--eth-rpc-url http://localhost:8545 \
489-
--batcher-url ws://localhost:8080 \
490542
--network devnet \
491543
--proofs-dirpath $(CURDIR)/scripts/test_files/task_sender/proofs \
492544
--private-keys-filepath $(CURDIR)/batcher/aligned-task-sender/wallets/devnet
493545

494546
task_sender_test_connections_devnet:
495547
@cd batcher/aligned-task-sender && \
496548
cargo run --release -- test-connections \
497-
--batcher-url ws://localhost:8080 \
498-
--num-senders $(NUM_SENDERS)
549+
--num-senders $(NUM_SENDERS) \
550+
--network devnet
499551

500552
# ===== HOLESKY-STAGE =====
501553
task_sender_generate_and_fund_wallets_holesky_stage:
@@ -514,21 +566,21 @@ task_sender_send_infinite_proofs_holesky_stage:
514566
cargo run --release -- send-infinite-proofs \
515567
--burst-size $(BURST_SIZE) --burst-time-secs $(BURST_TIME_SECS) \
516568
--eth-rpc-url https://ethereum-holesky-rpc.publicnode.com \
517-
--batcher-url wss://stage.batcher.alignedlayer.com \
518569
--network holesky-stage \
519570
--proofs-dirpath $(CURDIR)/scripts/test_files/task_sender/proofs \
520571
--private-keys-filepath $(CURDIR)/batcher/aligned-task-sender/wallets/holesky-stage
521572

522573
task_sender_test_connections_holesky_stage:
523574
@cd batcher/aligned-task-sender && \
524575
cargo run --release -- test-connections \
525-
--batcher-url wss://stage.batcher.alignedlayer.com \
526-
--num-senders $(NUM_SENDERS)
576+
--num-senders $(NUM_SENDERS) \
577+
--network holesky-stage
527578

528579
__UTILS__:
529580
aligned_get_user_balance_devnet:
530581
@cd batcher/aligned/ && cargo run --release -- get-user-balance \
531-
--user_addr $(USER_ADDR)
582+
--user_addr $(USER_ADDR) \
583+
--network devnet
532584

533585
aligned_get_user_balance_holesky:
534586
@cd batcher/aligned/ && cargo run --release -- get-user-balance \
@@ -1046,11 +1098,18 @@ docker_verify_proof_submission_success:
10461098
verification=$$(aligned verify-proof-onchain \
10471099
--aligned-verification-data $${proof} \
10481100
--rpc_url $$(echo $(DOCKER_RPC_URL)) 2>&1); \
1101+
cat $${proof%.cbor}.json; \
1102+
echo "$$verification"; \
10491103
if echo "$$verification" | grep -q not; then \
10501104
echo "ERROR: Proof verification failed for $${proof}"; \
10511105
exit 1; \
10521106
elif echo "$$verification" | grep -q verified; then \
10531107
echo "Proof verification succeeded for $${proof}"; \
1108+
else \
1109+
echo "WARNING: Unexpected verification result for $${proof}"; \
1110+
echo "Output:"; \
1111+
echo "$$verification"; \
1112+
exit 1; \
10541113
fi; \
10551114
echo "---------------------------------------------------------------------------------------------------"; \
10561115
done; \
@@ -1212,3 +1271,71 @@ ansible_operator_deploy: ## Deploy the Operator. Parameters: INVENTORY
12121271
ansible_explorer_deploy:
12131272
@ansible-playbook infra/ansible/playbooks/explorer.yaml \
12141273
-i $(INVENTORY)
1274+
1275+
ansible_telemetry_create_env:
1276+
@cp -n infra/ansible/playbooks/ini/config-telemetry.ini.example infra/ansible/playbooks/ini/config-telemetry.ini
1277+
@echo "Config files for Telemetry created in infra/ansible/playbooks/ini"
1278+
@echo "Please complete the values and run make ansible_telemetry_deploy"
1279+
1280+
ansible_telemetry_deploy:
1281+
@ansible-playbook infra/ansible/playbooks/telemetry.yaml \
1282+
-i $(INVENTORY)
1283+
1284+
__ETHEREUM_PACKAGE__: ## ____
1285+
1286+
ethereum_package_start: ## Starts the ethereum_package environment
1287+
kurtosis run --enclave aligned github.com/ethpandaops/ethereum-package --args-file network_params.yaml
1288+
1289+
ethereum_package_inspect: ## Prints detailed information about the net
1290+
kurtosis enclave inspect aligned
1291+
1292+
ethereum_package_rm: ## Stops and removes the ethereum_package environment and used resources
1293+
kurtosis enclave rm aligned -f
1294+
1295+
batcher_start_ethereum_package: user_fund_payment_service
1296+
@echo "Starting Batcher..."
1297+
@$(MAKE) run_storage &
1298+
@cargo run --manifest-path ./batcher/aligned-batcher/Cargo.toml --release -- --config ./config-files/config-batcher-ethereum-package.yaml --env-file ./batcher/aligned-batcher/.env.dev
1299+
1300+
aggregator_start_ethereum_package:
1301+
$(MAKE) aggregator_start AGG_CONFIG_FILE=config-files/config-aggregator-ethereum-package.yaml
1302+
1303+
operator_start_ethereum_package:
1304+
$(MAKE) operator_start OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
1305+
1306+
operator_register_start_ethereum_package:
1307+
$(MAKE) operator_full_registration OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml \
1308+
$(MAKE) operator_start OPERATOR_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8 CONFIG_FILE=config-files/config-operator-1-ethereum-package.yaml
1309+
1310+
1311+
install_spamoor: ## Instal spamoor to spam transactions
1312+
@echo "Installing spamoor..."
1313+
@git clone https://github.com/ethpandaops/spamoor.git
1314+
@cd spamoor && make
1315+
@mv spamoor/bin/spamoor $(HOME)/.local/bin
1316+
@rm -rf spamoor
1317+
@echo "======================================================================="
1318+
@echo "Installation complete! Run 'spamoor --help' to verify the installation."
1319+
@echo "If 'spamoor' is not recognized, make sure it's in your PATH by adding the following line to your shell configuration:"
1320+
@echo "export PATH=\$$PATH:\$$HOME/.local/bin"
1321+
@echo "======================================================================="
1322+
1323+
# Spamoor funding wallet
1324+
SPAMOOR_PRIVATE_KEY?=dbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97
1325+
NUM_WALLETS?=1000
1326+
TX_PER_BLOCK?=250
1327+
# Similar to a swap
1328+
TX_CONSUMES_GAS?=150000
1329+
1330+
spamoor_send_transactions: ## Sends normal transactions and also replacement transactions
1331+
spamoor gasburnertx -p $(SPAMOOR_PRIVATE_KEY) -c $(COUNT) \
1332+
--gas-units-to-burn $(TX_CONSUMES_GAS) \
1333+
--max-wallets $(NUM_WALLETS) --max-pending $(TX_PER_BLOCK) \
1334+
-t $(TX_PER_BLOCK) -h http://127.0.0.1:8545/ -h http://127.0.0.1:8550/ -h http://127.0.0.1:8555/ -h http://127.0.0.1:8565/ \
1335+
--refill-amount 5 --refill-balance 2 --tipfee $(TIP_FEE) --basefee 100 \
1336+
2>&1 | grep -v 'checked child wallets (no funding needed)'
1337+
1338+
__NODE_EXPORTER_: ##__
1339+
1340+
install_node_exporter:
1341+
@./scripts/install_node_exporter.sh

aggregator/pkg/server.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package pkg
33
import (
44
"context"
55
"encoding/hex"
6+
"errors"
67
"fmt"
78
"net/http"
89
"net/rpc"
@@ -48,6 +49,17 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
4849
"SenderAddress", "0x"+hex.EncodeToString(signedTaskResponse.SenderAddress[:]),
4950
"BatchIdentifierHash", "0x"+hex.EncodeToString(signedTaskResponse.BatchIdentifierHash[:]),
5051
"operatorId", hex.EncodeToString(signedTaskResponse.OperatorId[:]))
52+
53+
if signedTaskResponse.BlsSignature.G1Point == nil {
54+
agg.logger.Warn("invalid operator response with nil signature",
55+
"BatchMerkleRoot", "0x"+hex.EncodeToString(signedTaskResponse.BatchMerkleRoot[:]),
56+
"SenderAddress", "0x"+hex.EncodeToString(signedTaskResponse.SenderAddress[:]),
57+
"BatchIdentifierHash", "0x"+hex.EncodeToString(signedTaskResponse.BatchIdentifierHash[:]),
58+
"operatorId", hex.EncodeToString(signedTaskResponse.OperatorId[:]))
59+
*reply = 1
60+
return errors.New("invalid response: nil signature")
61+
}
62+
5163
taskIndex := uint32(0)
5264

5365
// The Aggregator may receive the Task Identifier after the operators.
@@ -69,7 +81,7 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
6981
defer cancel() // Ensure the cancel function is called to release resources
7082

7183
// Create a channel to signal when the task is done
72-
done := make(chan struct{})
84+
done := make(chan uint8)
7385

7486
agg.logger.Info("Starting bls signature process")
7587
go func() {
@@ -80,9 +92,11 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
8092

8193
if err != nil {
8294
agg.logger.Warnf("BLS aggregation service error: %s", err)
95+
done<- 1
8396
// todo shouldn't we here close the channel with a reply = 1?
8497
} else {
8598
agg.logger.Info("BLS process succeeded")
99+
done<- 0
86100
}
87101

88102
close(done)
@@ -94,10 +108,10 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
94108
case <-ctx.Done():
95109
// The context's deadline was exceeded or it was canceled
96110
agg.logger.Info("Bls process timed out, operator signature will be lost. Batch may not reach quorum")
97-
case <-done:
111+
case res := <-done:
98112
// The task completed successfully
99-
agg.logger.Info("Bls context finished correctly")
100-
*reply = 0
113+
agg.logger.Info("Bls context finished on time")
114+
*reply = res
101115
}
102116

103117
return nil

alerts/.env.devnet

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
# Variables for sender_with_alert.sh
2525
REPETITIONS=8
2626
SENDER_ADDRESS=0x14dC79964da2C08b23698B3D3cc7Ca32193d9955
27-
BATCHER_URL=ws://localhost:8080
2827
RPC_URL=http://localhost:8545
2928
EXPLORER_URL=http://localhost:3000
3029
NETWORK=devnet

alerts/.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ NETWORK=<MAINNET|HOLESKY|STAGE>
2626
# Variables for sender_with_alert.sh
2727
REPETITIONS=<REPETITIONS>
2828
SENDER_ADDRESS=<YOUR_SENDER_ADDRESS>
29-
BATCHER_URL=<BATCHER_URL>
3029
RPC_URL=<RPC_BASE_URL>
3130
EXPLORER_URL=<EXPLORER_BASE_URL>
3231
NETWORK=<NETWORK>

alerts/balance_alerts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ do
3838
fi
3939
balance_alert=true
4040
else
41-
message="🟩 INFO: Wallet $WALLET_ADDRESS balance ($balance_eth ETH) is above $BALANCE_THRESHOLD ETH"
41+
message="🟩 INFO: $WALLET_NAME ($NETWORK) Wallet $WALLET_ADDRESS balance ($balance_eth ETH) is above $BALANCE_THRESHOLD ETH"
4242
printf "$message\n"
4343
if [ "$balance_alert" = true ]; then
4444
send_slack_message "$message"

alerts/contract_alerts.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ do
4141
if [ -z "$new_batch_logs" ]; then
4242
printf "No new batches logs found\n"
4343
if [ "$no_new_batches_alert" = false ]; then
44-
message="🚨 ALERT: No new batches in Service Manager since block $from_block"
44+
message="🚨 $NETWORK ALERT: No new batches in Service Manager since block $from_block"
45+
printf "$message\n"
4546
send_slack_message "$message"
4647
send_telegram_message "$message"
4748
send_pagerduty_alert "$message"
@@ -50,7 +51,8 @@ do
5051
else
5152
printf "New batches logs found\n"
5253
if [ "$no_new_batches_alert" = true ]; then
53-
message="🟩 INFO: Batches creation resumed in Service Manager since block $from_block"
54+
message="🟩 $NETWORK INFO: Batches creation resumed in Service Manager since block $from_block"
55+
printf "$message\n"
5456
send_slack_message "$message"
5557
send_telegram_message "$message"
5658
fi
@@ -61,7 +63,8 @@ do
6163
if [ -z "$verified_batch_logs" ]; then
6264
printf "No verified batches logs found\n"
6365
if [ "$no_verified_batches_alert" = false ]; then
64-
message="🚨 ALERT: No verified batches in Service Manager since block $from_block"
66+
message="🚨 $NETWORK ALERT: No verified batches in Service Manager since block $from_block"
67+
printf "$message\n"
6568
send_slack_message "$message"
6669
send_telegram_message "$message"
6770
send_pagerduty_alert "$message"
@@ -70,7 +73,8 @@ do
7073
else
7174
printf "Verified batches logs found\n"
7275
if [ "$no_verified_batches_alert" = true ]; then
73-
message="🟩 INFO: Batches verification resumed in Service Manager since block $from_block"
76+
message="🟩 $NETWORK INFO: Batches verification resumed in Service Manager since block $from_block"
77+
printf "$message\n"
7478
send_slack_message "$message"
7579
send_telegram_message "$message"
7680
fi

0 commit comments

Comments
 (0)