Skip to content

Commit 10bd8c6

Browse files
committed
Merge branch 'staging' into mina
2 parents 83f0b1b + b281543 commit 10bd8c6

99 files changed

Lines changed: 4430 additions & 11328 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/build-and-test-go.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,32 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23+
2324
- uses: actions/setup-go@v5
2425
with:
2526
go-version: "1.23"
2627
cache: false
28+
2729
- name: foundry-toolchain
2830
uses: foundry-rs/foundry-toolchain@v1.2.0
31+
2932
- name: Build SP1 bindings
3033
run: make build_sp1_linux
31-
- name: Build Old SP1 bindings
32-
run: make build_sp1_linux_old
34+
3335
- name: Build Risc Zero go bindings
3436
run: make build_risc_zero_linux
35-
- name: Build Old Risc Zero go bindings
36-
run: make build_risc_zero_linux_old
37+
3738
- name: Build Merkle Tree bindings
3839
run: make build_merkle_tree_linux
40+
3941
- name: Build Mina bindings
4042
run: make build_mina_linux
43+
4144
- name: Build Mina Account bindings
4245
run: make build_mina_account_linux
46+
4347
- name: Build operator
4448
run: go build operator/cmd/main.go
49+
4550
- name: Build aggregator
4651
run: go build aggregator/cmd/main.go

.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:

.github/workflows/test-risc-zero-old.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/test-sp1-old.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ config-files/*.last_processed_batch.json
1616
nonce_*.bin
1717

1818
infra/ansible/playbooks/ini/**.ini
19+
infra/ansible/playbooks/files/**.pem

Makefile

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ ifeq ($(OS),Darwin)
2020
endif
2121

2222
ifeq ($(OS),Linux)
23-
export LD_LIBRARY_PATH+=$(CURDIR)/operator/risc_zero_old/lib:$(CURDIR)/operator/risc_zero/lib:$(CURDIR)/operator/mina/lib:$(CURDIR)/operator/mina_account/lib
24-
OPERATOR_FFIS=$(CURDIR)/operator/risc_zero_old/lib:$(CURDIR)/operator/risc_zero/lib:$(CURDIR)/operator/mina/lib:$(CURDIR)/operator/mina_account/lib
23+
export LD_LIBRARY_PATH+=$(CURDIR)/operator/risc_zero/lib:$(CURDIR)/operator/mina/lib:$(CURDIR)/operator/mina_account/lib
24+
OPERATOR_FFIS=$(CURDIR)/operator/risc_zero/lib:$(CURDIR)/operator/mina/lib:$(CURDIR)/operator/mina_account/lib
2525
endif
2626

2727
ifeq ($(OS),Linux)
@@ -195,7 +195,7 @@ operator_set_eigen_sdk_go_version_error:
195195

196196
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
197197

198-
operator_register_and_start: operator_full_registration operator_start
198+
operator_register_and_start: $(GET_SDK_VERSION) operator_full_registration operator_start
199199

200200
build_operator: deps
201201
$(GET_SDK_VERSION)
@@ -779,25 +779,6 @@ generate_risc_zero_empty_journal_proof:
779779
@cd scripts/test_files/risc_zero/no_public_inputs && RUST_LOG=info cargo run --release
780780
@echo "Fibonacci proof and ELF with empty journal generated in scripts/test_files/risc_zero/no_public_inputs folder"
781781

782-
build_sp1_macos_old:
783-
@cd operator/sp1_old/lib && cargo build $(RELEASE_FLAG)
784-
@cp operator/sp1_old/lib/target/$(TARGET_REL_PATH)/libsp1_verifier_old_ffi.dylib operator/sp1_old/lib/libsp1_verifier_old_ffi.dylib
785-
786-
build_sp1_linux_old:
787-
@cd operator/sp1_old/lib && cargo build $(RELEASE_FLAG)
788-
@cp operator/sp1_old/lib/target/$(TARGET_REL_PATH)/libsp1_verifier_old_ffi.so operator/sp1_old/lib/libsp1_verifier_old_ffi.so
789-
790-
test_sp1_rust_ffi_old:
791-
@echo "Testing SP1 Rust FFI source code..."
792-
@cd operator/sp1_old/lib && RUST_MIN_STACK=83886080 cargo t --release
793-
794-
test_sp1_go_bindings_macos_old: build_sp1_macos_old
795-
@echo "Testing SP1 Go bindings..."
796-
go test ./operator/sp1_old/... -v
797-
798-
test_sp1_go_bindings_linux_old: build_sp1_linux_old
799-
@echo "Testing SP1 Go bindings..."
800-
go test ./operator/sp1_old/... -v
801782

802783
__RISC_ZERO_FFI__: ##
803784
build_risc_zero_macos:
@@ -825,26 +806,6 @@ generate_risc_zero_fibonacci_proof:
825806
RUST_LOG=info cargo run --release && \
826807
echo "Fibonacci proof, pub input and image ID generated in scripts/test_files/risc_zero folder"
827808

828-
build_risc_zero_macos_old:
829-
@cd operator/risc_zero_old/lib && cargo build $(RELEASE_FLAG)
830-
@cp operator/risc_zero_old/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_old_ffi.dylib operator/risc_zero_old/lib/librisc_zero_verifier_old_ffi.dylib
831-
832-
build_risc_zero_linux_old:
833-
@cd operator/risc_zero_old/lib && cargo build $(RELEASE_FLAG)
834-
@cp operator/risc_zero_old/lib/target/$(TARGET_REL_PATH)/librisc_zero_verifier_old_ffi.so operator/risc_zero_old/lib/librisc_zero_verifier_old_ffi.so
835-
836-
test_risc_zero_rust_ffi_old:
837-
@echo "Testing RISC Zero Rust FFI source code..."
838-
@cd operator/risc_zero_old/lib && cargo test --release
839-
840-
test_risc_zero_go_bindings_macos_old: build_risc_zero_macos_old
841-
@echo "Testing RISC Zero Go bindings..."
842-
go test ./operator/risc_zero_old/... -v
843-
844-
test_risc_zero_go_bindings_linux_old: build_risc_zero_linux_old
845-
@echo "Testing RISC Zero Go bindings..."
846-
go test ./operator/risc_zero_old/... -v
847-
848809

849810
__MERKLE_TREE_FFI__: ##
850811
build_merkle_tree_macos:
@@ -869,11 +830,6 @@ test_merkle_tree_go_bindings_linux: build_merkle_tree_linux
869830
@echo "Testing Merkle Tree Go bindings..."
870831
go test ./operator/merkle_tree/... -v
871832

872-
test_merkle_tree_old_go_bindings_macos: build_merkle_tree_macos_old
873-
@echo "Testing Old Merkle Tree Go bindings..."
874-
go test ./operator/merkle_tree_old/... -v
875-
876-
877833
__MINA_FFI__: ##
878834
build_mina_macos:
879835
@cd operator/mina/lib && cargo build --release ${MINA_FEATURES_FLAG}
@@ -926,8 +882,6 @@ build_all_ffi_macos: ## Build all FFIs for macOS
926882
@echo "Building all FFIs for macOS..."
927883
@$(MAKE) build_sp1_macos
928884
@$(MAKE) build_risc_zero_macos
929-
@$(MAKE) build_sp1_macos_old
930-
@$(MAKE) build_risc_zero_macos_old
931885
@$(MAKE) build_merkle_tree_macos
932886
@$(MAKE) build_mina_macos
933887
@$(MAKE) build_mina_account_macos
@@ -937,8 +891,6 @@ build_all_ffi_linux: ## Build all FFIs for Linux
937891
@echo "Building all FFIs for Linux..."
938892
@$(MAKE) build_sp1_linux
939893
@$(MAKE) build_risc_zero_linux
940-
@$(MAKE) build_sp1_linux_old
941-
@$(MAKE) build_risc_zero_linux_old
942894
@$(MAKE) build_merkle_tree_linux
943895
@$(MAKE) build_mina_linux
944896
@$(MAKE) build_mina_account_linux
@@ -1381,6 +1333,19 @@ ansible_operator_deploy: ## Deploy the Operator. Parameters: INVENTORY
13811333
-e "ecdsa_keystore_path=$(ECDSA_KEYSTORE)" \
13821334
-e "bls_keystore_path=$(BLS_KEYSTORE)"
13831335

1336+
ansible_explorer_deploy:
1337+
@ansible-playbook infra/ansible/playbooks/explorer.yaml \
1338+
-i $(INVENTORY)
1339+
1340+
ansible_telemetry_create_env:
1341+
@cp -n infra/ansible/playbooks/ini/config-telemetry.ini.example infra/ansible/playbooks/ini/config-telemetry.ini
1342+
@echo "Config files for Telemetry created in infra/ansible/playbooks/ini"
1343+
@echo "Please complete the values and run make ansible_telemetry_deploy"
1344+
1345+
ansible_telemetry_deploy:
1346+
@ansible-playbook infra/ansible/playbooks/telemetry.yaml \
1347+
-i $(INVENTORY)
1348+
13841349
__ETHEREUM_PACKAGE__: ## ____
13851350

13861351
ethereum_package_start: ## Starts the ethereum_package environment

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/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)