Skip to content

Commit 312b677

Browse files
committed
fix data race
1 parent 50454df commit 312b677

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

aggregator/aggregator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ func (agg *Aggregator) sendAggregatedResponseToContract(ctx context.Context, tas
393393

394394
tx, err := agg.multiProverContract.ConfirmState(agg.transactOpt, *task.state.Task.ToAbi(), nonSignerStakesAndSignature)
395395
if err != nil {
396-
return logex.Trace(err)
396+
return logex.Trace(bindings.MultiProverError(err))
397397
}
398398
logex.Pretty(task.state.Task)
399399
logex.Infof("confirm state: %v", tx.Hash())

aggregator/blsagg.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (a *BlsAggregatorService) singleTaskAggregatorGoroutineFunc(
274274
signersApkG2: bls.NewZeroG2Point().Add(operatorsAvsStateDict[signedTaskResponseDigest.OperatorId].Pubkeys.G2Pubkey),
275275
signersAggSigG1: signedTaskResponseDigest.BlsSignature,
276276
signersOperatorIdsSet: map[types.OperatorId]bool{signedTaskResponseDigest.OperatorId: true},
277-
signersTotalStakePerQuorum: operatorsAvsStateDict[signedTaskResponseDigest.OperatorId].StakePerQuorum,
277+
signersTotalStakePerQuorum: cloneStakePerQuorumMap(operatorsAvsStateDict[signedTaskResponseDigest.OperatorId].StakePerQuorum),
278278
}
279279
} else {
280280
digestAggregatedOperators.signersAggSigG1.Add(signedTaskResponseDigest.BlsSignature)
@@ -461,3 +461,11 @@ func checkIfStakeThresholdsMet(
461461
}
462462
return true
463463
}
464+
465+
func cloneStakePerQuorumMap(stakes map[types.QuorumNum]types.StakeAmount) map[types.QuorumNum]types.StakeAmount {
466+
out := make(map[types.QuorumNum]types.StakeAmount, len(stakes))
467+
for k, v := range stakes {
468+
out[k] = new(big.Int).Set(v)
469+
}
470+
return out
471+
}

scripts/avs.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -e
2+
3+
. $(dirname $0)/env.sh
4+
5+
function add_whitelist() {
6+
MULTI_PROVER_SERVICE_MANAGER=$(_get_key $AVS_DEPLOY .multiProverServiceManager) \
7+
DEPLOY_KEY_SUFFIX=DEPLOY_KEY \
8+
_script script/Whitelist.s.sol --sig 'add(address)' $1
9+
}
10+
11+
"$@"

scripts/env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ echo "RPC_URL: $(_get_env RPC_URL)"
5353
echo "=============================================================="
5454
echo
5555

56-
AVS_DEPLOY=contracts/script/output/avs_deploy_output.json
56+
AVS_DEPLOY=contracts/script/output/avs_deploy_$ENV.json
5757
TEE_DEPLOY=contracts/script/output/tee_deploy_output_$ENV.json
5858
EIGENLAYER_DEPLOY=contracts/script/output/eigenlayer_holesky_deploy.json
5959
PRIVATE_KEY=$(_get_env DEPLOY_KEY)

0 commit comments

Comments
 (0)