Skip to content

Commit 218a07c

Browse files
committed
function name change
1 parent 65d1dbe commit 218a07c

5 files changed

Lines changed: 71 additions & 71 deletions

File tree

aggregator/pkg/aggregator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ func (agg *Aggregator) AddNewTask(batchMerkleRoot [32]byte, senderAddress [20]by
398398

399399
// |---RETRYABLE---|
400400

401-
func InitializeNewTask(agg *Aggregator, batchIndex uint32, taskCreatedBlock uint32, quorumNums eigentypes.QuorumNums, quorumThresholdPercentages eigentypes.QuorumThresholdPercentages, timeToExpiry time.Duration) func() error {
401+
func InitializeNewTaskFunc(agg *Aggregator, batchIndex uint32, taskCreatedBlock uint32, quorumNums eigentypes.QuorumNums, quorumThresholdPercentages eigentypes.QuorumThresholdPercentages, timeToExpiry time.Duration) func() error {
402402
initializeNewTask_func := func() error {
403403
err := agg.blsAggregationService.InitializeNewTask(batchIndex, taskCreatedBlock, quorumNums, quorumThresholdPercentages, timeToExpiry)
404404
if err != nil {
@@ -423,7 +423,7 @@ Initialize a new task in the BLS Aggregation service
423423
- Retry times (3 retries): 1 sec, 2 sec, 4 sec
424424
*/
425425
func (agg *Aggregator) InitializeNewTaskRetryable(batchIndex uint32, taskCreatedBlock uint32, quorumNums eigentypes.QuorumNums, quorumThresholdPercentages eigentypes.QuorumThresholdPercentages, timeToExpiry time.Duration) error {
426-
return retry.Retry(InitializeNewTask(agg, batchIndex, taskCreatedBlock, quorumNums, quorumThresholdPercentages, timeToExpiry), retry.EthCallRetryConfig())
426+
return retry.Retry(InitializeNewTaskFunc(agg, batchIndex, taskCreatedBlock, quorumNums, quorumThresholdPercentages, timeToExpiry), retry.EthCallRetryConfig())
427427
}
428428

429429
// Long-lived goroutine that periodically checks and removes old Tasks from stored Maps

aggregator/pkg/server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (agg *Aggregator) ServerRunning(_ *struct{}, reply *int64) error {
114114

115115
// |---RETRYABLE---|
116116

117-
func ProcessNewSignature(agg *Aggregator, ctx context.Context, taskIndex uint32, taskResponse interface{}, blsSignature *bls.Signature, operatorId eigentypes.Bytes32) func() error {
117+
func ProcessNewSignatureFunc(agg *Aggregator, ctx context.Context, taskIndex uint32, taskResponse interface{}, blsSignature *bls.Signature, operatorId eigentypes.Bytes32) func() error {
118118

119119
processNewSignature_func := func() error {
120120
err := agg.blsAggregationService.ProcessNewSignature(
@@ -142,10 +142,10 @@ func ProcessNewSignature(agg *Aggregator, ctx context.Context, taskIndex uint32,
142142
*/
143143
func (agg *Aggregator) ProcessNewSignatureRetryable(ctx context.Context, taskIndex uint32, taskResponse interface{}, blsSignature *bls.Signature, operatorId eigentypes.Bytes32) error {
144144

145-
return retry.Retry(ProcessNewSignature(agg, ctx, taskIndex, taskResponse, blsSignature, operatorId), retry.ChainRetryConfig())
145+
return retry.Retry(ProcessNewSignatureFunc(agg, ctx, taskIndex, taskResponse, blsSignature, operatorId), retry.ChainRetryConfig())
146146
}
147147

148-
func GetTaskIndex(agg *Aggregator, batchIdentifierHash [32]byte) func() (uint32, error) {
148+
func GetTaskIndexFunc(agg *Aggregator, batchIdentifierHash [32]byte) func() (uint32, error) {
149149

150150
getTaskIndex_func := func() (uint32, error) {
151151
agg.taskMutex.Lock()
@@ -168,5 +168,5 @@ func GetTaskIndex(agg *Aggregator, batchIdentifierHash [32]byte) func() (uint32,
168168
- Retry times (3 retries): 1 sec, 2 sec, 4 sec
169169
*/
170170
func (agg *Aggregator) GetTaskIndexRetryable(batchIdentifierHash [32]byte) (uint32, error) {
171-
return retry.RetryWithData(GetTaskIndex(agg, batchIdentifierHash), retry.EthCallRetryConfig())
171+
return retry.RetryWithData(GetTaskIndexFunc(agg, batchIdentifierHash), retry.EthCallRetryConfig())
172172
}

core/chainio/retryable.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
// |---AVS_WRITER---|
1717

18-
func RespondToTaskV2(w *AvsWriter, opts *bind.TransactOpts, batchMerkleRoot [32]byte, senderAddress common.Address, nonSignerStakesAndSignature servicemanager.IBLSSignatureCheckerNonSignerStakesAndSignature) func() (*types.Transaction, error) {
18+
func RespondToTaskV2Func(w *AvsWriter, opts *bind.TransactOpts, batchMerkleRoot [32]byte, senderAddress common.Address, nonSignerStakesAndSignature servicemanager.IBLSSignatureCheckerNonSignerStakesAndSignature) func() (*types.Transaction, error) {
1919
respondToTaskV2_func := func() (*types.Transaction, error) {
2020
// Try with main connection
2121
tx, err := w.AvsContractBindings.ServiceManager.RespondToTaskV2(opts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature)
@@ -36,10 +36,10 @@ Send a transaction to the AVS contract to respond to a task.
3636
- NOTE: Contract call reverts are not considered `PermanentError`'s as block reorg's may lead to contract call revert in which case the aggregator should retry.
3737
*/
3838
func (w *AvsWriter) RespondToTaskV2Retryable(opts *bind.TransactOpts, batchMerkleRoot [32]byte, senderAddress common.Address, nonSignerStakesAndSignature servicemanager.IBLSSignatureCheckerNonSignerStakesAndSignature) (*types.Transaction, error) {
39-
return retry.RetryWithData(RespondToTaskV2(w, opts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature), retry.ChainRetryConfig())
39+
return retry.RetryWithData(RespondToTaskV2Func(w, opts, batchMerkleRoot, senderAddress, nonSignerStakesAndSignature), retry.ChainRetryConfig())
4040
}
4141

42-
func BatchesState(w *AvsWriter, opts *bind.CallOpts, arg0 [32]byte) func() (struct {
42+
func BatchesStateFunc(w *AvsWriter, opts *bind.CallOpts, arg0 [32]byte) func() (struct {
4343
TaskCreatedBlock uint32
4444
Responded bool
4545
RespondToTaskFeeLimit *big.Int
@@ -71,10 +71,10 @@ func (w *AvsWriter) BatchesStateRetryable(opts *bind.CallOpts, arg0 [32]byte) (s
7171
Responded bool
7272
RespondToTaskFeeLimit *big.Int
7373
}, error) {
74-
return retry.RetryWithData(BatchesState(w, opts, arg0), retry.EthCallRetryConfig())
74+
return retry.RetryWithData(BatchesStateFunc(w, opts, arg0), retry.EthCallRetryConfig())
7575
}
7676

77-
func BatcherBalances(w *AvsWriter, opts *bind.CallOpts, senderAddress common.Address) func() (*big.Int, error) {
77+
func BatcherBalancesFunc(w *AvsWriter, opts *bind.CallOpts, senderAddress common.Address) func() (*big.Int, error) {
7878
batcherBalances_func := func() (*big.Int, error) {
7979
// Try with main connection
8080
batcherBalance, err := w.AvsContractBindings.ServiceManager.BatchersBalances(opts, senderAddress)
@@ -94,10 +94,10 @@ Get the balance of a batcher from the AVS contract.
9494
- Retry times (3 retries): 1 sec, 2 sec, 4 sec
9595
*/
9696
func (w *AvsWriter) BatcherBalancesRetryable(opts *bind.CallOpts, senderAddress common.Address) (*big.Int, error) {
97-
return retry.RetryWithData(BatcherBalances(w, opts, senderAddress), retry.EthCallRetryConfig())
97+
return retry.RetryWithData(BatcherBalancesFunc(w, opts, senderAddress), retry.EthCallRetryConfig())
9898
}
9999

100-
func BalanceAt(w *AvsWriter, ctx context.Context, aggregatorAddress common.Address, blockNumber *big.Int) func() (*big.Int, error) {
100+
func BalanceAtFunc(w *AvsWriter, ctx context.Context, aggregatorAddress common.Address, blockNumber *big.Int) func() (*big.Int, error) {
101101
balanceAt_func := func() (*big.Int, error) {
102102
// Try with main connection
103103
aggregatorBalance, err := w.Client.BalanceAt(ctx, aggregatorAddress, blockNumber)
@@ -119,12 +119,12 @@ TODO: it gets the balance from an Address, not necessarily an aggregator. The na
119119
- Retry times (3 retries): 1 sec, 2 sec, 4 sec.
120120
*/
121121
func (w *AvsWriter) BalanceAtRetryable(ctx context.Context, aggregatorAddress common.Address, blockNumber *big.Int) (*big.Int, error) {
122-
return retry.RetryWithData(BalanceAt(w, ctx, aggregatorAddress, blockNumber), retry.EthCallRetryConfig())
122+
return retry.RetryWithData(BalanceAtFunc(w, ctx, aggregatorAddress, blockNumber), retry.EthCallRetryConfig())
123123
}
124124

125125
// |---AVS_SUBSCRIBER---|
126126

127-
func BlockNumber(s *AvsSubscriber, ctx context.Context) func() (uint64, error) {
127+
func BlockNumberFunc(s *AvsSubscriber, ctx context.Context) func() (uint64, error) {
128128
latestBlock_func := func() (uint64, error) {
129129
// Try with main connection
130130
latestBlock, err := s.AvsContractBindings.ethClient.BlockNumber(ctx)
@@ -144,10 +144,10 @@ Get the latest block number from Ethereum
144144
- Retry times (3 retries): 1 sec, 2 sec, 4 sec.
145145
*/
146146
func (s *AvsSubscriber) BlockNumberRetryable(ctx context.Context) (uint64, error) {
147-
return retry.RetryWithData(BlockNumber(s, ctx), retry.EthCallRetryConfig())
147+
return retry.RetryWithData(BlockNumberFunc(s, ctx), retry.EthCallRetryConfig())
148148
}
149149

150-
func FilterBatchV2(s *AvsSubscriber, opts *bind.FilterOpts, batchMerkleRoot [][32]byte) func() (*servicemanager.ContractAlignedLayerServiceManagerNewBatchV2Iterator, error) {
150+
func FilterBatchV2Func(s *AvsSubscriber, opts *bind.FilterOpts, batchMerkleRoot [][32]byte) func() (*servicemanager.ContractAlignedLayerServiceManagerNewBatchV2Iterator, error) {
151151
filterNewBatchV2_func := func() (*servicemanager.ContractAlignedLayerServiceManagerNewBatchV2Iterator, error) {
152152
logs, err := s.AvsContractBindings.ServiceManager.FilterNewBatchV2(opts, batchMerkleRoot)
153153
if err != nil {
@@ -165,10 +165,10 @@ Get NewBatchV2 logs from the AVS contract.
165165
- Retry times (3 retries): 1 sec, 2 sec, 4 sec.
166166
*/
167167
func (s *AvsSubscriber) FilterBatchV2Retryable(opts *bind.FilterOpts, batchMerkleRoot [][32]byte) (*servicemanager.ContractAlignedLayerServiceManagerNewBatchV2Iterator, error) {
168-
return retry.RetryWithData(FilterBatchV2(s, opts, batchMerkleRoot), retry.EthCallRetryConfig())
168+
return retry.RetryWithData(FilterBatchV2Func(s, opts, batchMerkleRoot), retry.EthCallRetryConfig())
169169
}
170170

171-
func FilterBatchV3(s *AvsSubscriber, opts *bind.FilterOpts, batchMerkleRoot [][32]byte) func() (*servicemanager.ContractAlignedLayerServiceManagerNewBatchV3Iterator, error) {
171+
func FilterBatchV3Func(s *AvsSubscriber, opts *bind.FilterOpts, batchMerkleRoot [][32]byte) func() (*servicemanager.ContractAlignedLayerServiceManagerNewBatchV3Iterator, error) {
172172
filterNewBatchV3_func := func() (*servicemanager.ContractAlignedLayerServiceManagerNewBatchV3Iterator, error) {
173173
logs, err := s.AvsContractBindings.ServiceManager.FilterNewBatchV3(opts, batchMerkleRoot)
174174
if err != nil {
@@ -186,10 +186,10 @@ Get NewBatchV3 logs from the AVS contract.
186186
- Retry times (3 retries): 1 sec, 2 sec, 4 sec.
187187
*/
188188
func (s *AvsSubscriber) FilterBatchV3Retryable(opts *bind.FilterOpts, batchMerkleRoot [][32]byte) (*servicemanager.ContractAlignedLayerServiceManagerNewBatchV3Iterator, error) {
189-
return retry.RetryWithData(FilterBatchV3(s, opts, batchMerkleRoot), retry.EthCallRetryConfig())
189+
return retry.RetryWithData(FilterBatchV3Func(s, opts, batchMerkleRoot), retry.EthCallRetryConfig())
190190
}
191191

192-
func BatchState(s *AvsSubscriber, opts *bind.CallOpts, arg0 [32]byte) func() (struct {
192+
func BatchStateFunc(s *AvsSubscriber, opts *bind.CallOpts, arg0 [32]byte) func() (struct {
193193
TaskCreatedBlock uint32
194194
Responded bool
195195
RespondToTaskFeeLimit *big.Int
@@ -220,10 +220,10 @@ func (s *AvsSubscriber) BatchesStateRetryable(opts *bind.CallOpts, arg0 [32]byte
220220
RespondToTaskFeeLimit *big.Int
221221
}, error) {
222222

223-
return retry.RetryWithData(BatchState(s, opts, arg0), retry.EthCallRetryConfig())
223+
return retry.RetryWithData(BatchStateFunc(s, opts, arg0), retry.EthCallRetryConfig())
224224
}
225225

226-
func SubscribeNewHead(s *AvsSubscriber, ctx context.Context, c chan<- *types.Header) func() (ethereum.Subscription, error) {
226+
func SubscribeNewHeadFunc(s *AvsSubscriber, ctx context.Context, c chan<- *types.Header) func() (ethereum.Subscription, error) {
227227
subscribeNewHead_func := func() (ethereum.Subscription, error) {
228228
// Try with main connection
229229
sub, err := s.AvsContractBindings.ethClient.SubscribeNewHead(ctx, c)
@@ -243,10 +243,10 @@ Subscribe to new heads from the Ethereum node.
243243
- Retry times (3 retries): 1 sec, 2 sec, 4 sec.
244244
*/
245245
func (s *AvsSubscriber) SubscribeNewHeadRetryable(ctx context.Context, c chan<- *types.Header) (ethereum.Subscription, error) {
246-
return retry.RetryWithData(SubscribeNewHead(s, ctx, c), retry.EthCallRetryConfig())
246+
return retry.RetryWithData(SubscribeNewHeadFunc(s, ctx, c), retry.EthCallRetryConfig())
247247
}
248248

249-
func SubscribeToNewTasksV2(
249+
func SubscribeToNewTasksV2Func(
250250
opts *bind.WatchOpts,
251251
serviceManager *servicemanager.ContractAlignedLayerServiceManager,
252252
newTaskCreatedChan chan *servicemanager.ContractAlignedLayerServiceManagerNewBatchV2,
@@ -270,10 +270,10 @@ func SubscribeToNewTasksV2Retryable(
270270
newTaskCreatedChan chan *servicemanager.ContractAlignedLayerServiceManagerNewBatchV2,
271271
batchMerkleRoot [][32]byte,
272272
) (event.Subscription, error) {
273-
return retry.RetryWithData(SubscribeToNewTasksV2(opts, serviceManager, newTaskCreatedChan, batchMerkleRoot), retry.EthCallRetryConfig())
273+
return retry.RetryWithData(SubscribeToNewTasksV2Func(opts, serviceManager, newTaskCreatedChan, batchMerkleRoot), retry.EthCallRetryConfig())
274274
}
275275

276-
func SubscribeToNewTasksV3(
276+
func SubscribeToNewTasksV3Func(
277277
opts *bind.WatchOpts,
278278
serviceManager *servicemanager.ContractAlignedLayerServiceManager,
279279
newTaskCreatedChan chan *servicemanager.ContractAlignedLayerServiceManagerNewBatchV3,
@@ -297,5 +297,5 @@ func SubscribeToNewTasksV3Retryable(
297297
newTaskCreatedChan chan *servicemanager.ContractAlignedLayerServiceManagerNewBatchV3,
298298
batchMerkleRoot [][32]byte,
299299
) (event.Subscription, error) {
300-
return retry.RetryWithData(SubscribeToNewTasksV3(opts, serviceManager, newTaskCreatedChan, batchMerkleRoot), retry.EthCallRetryConfig())
300+
return retry.RetryWithData(SubscribeToNewTasksV3Func(opts, serviceManager, newTaskCreatedChan, batchMerkleRoot), retry.EthCallRetryConfig())
301301
}

0 commit comments

Comments
 (0)