Skip to content

Commit 67bbfc1

Browse files
committed
fix: aftersynchook in chainlinkwrapper to get new feed addr
1 parent 8b7b3c2 commit 67bbfc1

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.23
55
// toolchain go1.23.2
66

77
require (
8-
github.com/Gearbox-protocol/sdk-go v0.0.0-20250613231646-cf7b14a0787a
8+
github.com/Gearbox-protocol/sdk-go v0.0.0-20250620092350-5cfd96d9b2d4
99
github.com/ethereum/go-ethereum v1.13.14
1010
github.com/go-playground/validator/v10 v10.4.1
1111
github.com/google/go-cmp v0.6.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
66
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
77
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
88
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
9-
github.com/Gearbox-protocol/sdk-go v0.0.0-20250613231646-cf7b14a0787a h1:ZOUEoTyJa/M3c6uPPFqlLaM68Ig+04SyRLrQiP9Kw1I=
10-
github.com/Gearbox-protocol/sdk-go v0.0.0-20250613231646-cf7b14a0787a/go.mod h1:MZsiiSAwDdnHY6GEILYtHEqhb9wmbUUE34UBQgNlUyM=
9+
github.com/Gearbox-protocol/sdk-go v0.0.0-20250620092350-5cfd96d9b2d4 h1:KjHHmRtj4P4AV9hmGQQfFt8R8dJDE3jUdrUhM9I5xyk=
10+
github.com/Gearbox-protocol/sdk-go v0.0.0-20250620092350-5cfd96d9b2d4/go.mod h1:MZsiiSAwDdnHY6GEILYtHEqhb9wmbUUE34UBQgNlUyM=
1111
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
1212
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
1313
github.com/OffchainLabs/go-ethereum v1.13.4-0.20240313010929-e5d8587e7227 h1:+/3TrD+q+BP36jGj2Bycdmrc/joKLNbc5ImePQzKRLM=

models/wrappers/chainlink_wrapper/index.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package chainlink_wrapper
33
import (
44
"encoding/hex"
55
"sort"
6+
"strings"
7+
"time"
68

79
"github.com/Gearbox-protocol/sdk-go/artifacts/multicall"
810
"github.com/Gearbox-protocol/sdk-go/core"
@@ -66,7 +68,22 @@ func (w *ChainlinkWrapper) AfterSyncHook(syncedTill int64) {
6668
CallData: aggregatorBytes,
6769
})
6870
}
69-
results := core.MakeMultiCall(w.Client, syncedTill, false, calls)
71+
results := func() []multicall.Multicall2Result {
72+
for i := 3; i >= 0; i-- {
73+
results, err := core.MakeMultiCallError(w.Client, syncedTill, false, calls)
74+
if err != nil && i == 0 {
75+
log.Fatal(err)
76+
}
77+
if err != nil && strings.Contains(err.Error(), "attempting to unmarshall an empty string while arguments are") {
78+
log.Info("sleeping in afterSynchook of chainlinkwrapper to get new feed address")
79+
time.Sleep(30 * time.Second) // wait for multicall to be ready
80+
continue
81+
}
82+
return results
83+
}
84+
log.Fatal("")
85+
return nil
86+
}()
7087
for ind, cf := range adapters {
7188
newAddr, ok := core.MulticallAnsAddress(results[ind])
7289
if !ok {

0 commit comments

Comments
 (0)