Skip to content

Commit 8992807

Browse files
committed
Redeploy aligned
2 parents ff6744a + e546a4f commit 8992807

File tree

74 files changed

+4396
-2698
lines changed

Some content is hidden

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

74 files changed

+4396
-2698
lines changed

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

.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: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)
@@ -1268,6 +1268,19 @@ ansible_operator_deploy: ## Deploy the Operator. Parameters: INVENTORY
12681268
-e "ecdsa_keystore_path=$(ECDSA_KEYSTORE)" \
12691269
-e "bls_keystore_path=$(BLS_KEYSTORE)"
12701270

1271+
ansible_explorer_deploy:
1272+
@ansible-playbook infra/ansible/playbooks/explorer.yaml \
1273+
-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+
12711284
__ETHEREUM_PACKAGE__: ## ____
12721285

12731286
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

batcher/aligned-batcher/src/lib.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ use std::time::Duration;
2626
use aligned_sdk::core::constants::{
2727
ADDITIONAL_SUBMISSION_GAS_COST_PER_PROOF, BATCHER_SUBMISSION_BASE_GAS_COST,
2828
BUMP_BACKOFF_FACTOR, BUMP_MAX_RETRIES, BUMP_MAX_RETRY_DELAY, BUMP_MIN_RETRY_DELAY,
29-
CONNECTION_TIMEOUT, DEFAULT_MAX_FEE_PER_PROOF, ETHEREUM_CALL_BACKOFF_FACTOR,
30-
ETHEREUM_CALL_MAX_RETRIES, ETHEREUM_CALL_MAX_RETRY_DELAY, ETHEREUM_CALL_MIN_RETRY_DELAY,
31-
GAS_PRICE_PERCENTAGE_MULTIPLIER, PERCENTAGE_DIVIDER,
29+
CBOR_ARRAY_MAX_OVERHEAD, CONNECTION_TIMEOUT, DEFAULT_MAX_FEE_PER_PROOF,
30+
ETHEREUM_CALL_BACKOFF_FACTOR, ETHEREUM_CALL_MAX_RETRIES, ETHEREUM_CALL_MAX_RETRY_DELAY,
31+
ETHEREUM_CALL_MIN_RETRY_DELAY, GAS_PRICE_PERCENTAGE_MULTIPLIER, PERCENTAGE_DIVIDER,
3232
RESPOND_TO_TASK_FEE_LIMIT_PERCENTAGE_MULTIPLIER,
3333
};
3434
use aligned_sdk::core::types::{
@@ -115,6 +115,16 @@ impl Batcher {
115115
let s3_client = s3::create_client(upload_endpoint).await;
116116

117117
let config = ConfigFromYaml::new(config_file);
118+
// Ensure max_batch_bytes_size can at least hold one proof of max_proof_size,
119+
// including the overhead introduced by serialization
120+
assert!(
121+
config.batcher.max_proof_size + CBOR_ARRAY_MAX_OVERHEAD
122+
<= config.batcher.max_batch_byte_size,
123+
"max_batch_bytes_size ({}) not big enough for one max_proof_size ({}) proof",
124+
config.batcher.max_batch_byte_size,
125+
config.batcher.max_proof_size
126+
);
127+
118128
let deployment_output =
119129
ContractDeploymentOutput::new(config.aligned_layer_deployment_config_file_path);
120130

batcher/aligned-batcher/src/types/batch_queue.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use aligned_sdk::{
22
communication::serialization::cbor_serialize,
3-
core::types::{NoncedVerificationData, VerificationDataCommitment},
3+
core::{
4+
constants::CBOR_ARRAY_MAX_OVERHEAD,
5+
types::{NoncedVerificationData, VerificationDataCommitment},
6+
},
47
};
58
use ethers::types::{Address, Signature, U256};
69
use priority_queue::PriorityQueue;
@@ -132,7 +135,10 @@ pub(crate) fn calculate_batch_size(batch_queue: &BatchQueue) -> Result<usize, Ba
132135
});
133136

134137
if let ControlFlow::Continue(batch_size) = folded_result {
135-
Ok(batch_size)
138+
// We over-estimate the size of the batch by at most 8 bytes.
139+
// This saves us from a scenario where we actually try to send more
140+
// than the maximum allowed bytes and get rejected by operators.
141+
Ok(CBOR_ARRAY_MAX_OVERHEAD + batch_size)
136142
} else {
137143
Err(BatcherError::SerializationError(String::from(
138144
"Could not calculate size of batch",

batcher/aligned-sdk/abi/BatcherPaymentService.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)