Skip to content

Commit 7f8d544

Browse files
authored
fix: use mpc address from config if keyshare missing (#109)
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> ## Related Issue Or Context <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Otherwise, describe context and motivation for change herre --> Closes: #<issue> ## How Has This Been Tested? Testing details. <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have ensured that all acceptance criteria (or expected behavior) from issue are met - [ ] I have updated the documentation locally and in docs. - [ ] I have added tests to cover my changes. - [ ] I have ensured that all the checks are passing and green, I've signed the CLA bot
1 parent 459a2e0 commit 7f8d544

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

app/app.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ func Run() error {
119119
}
120120
blockstore := store.NewBlockStore(db)
121121
keyshareStore := keyshare.NewECDSAKeyshareStore(configuration.RelayerConfig.MpcConfig.KeysharePath)
122-
keyshare, err := keyshareStore.GetKeyshare()
123-
panicOnError(err)
124122

125123
mp, err := observability.InitMetricProvider(context.Background(), configuration.RelayerConfig.OpenTelemetryCollectorURL)
126124
panicOnError(err)
@@ -163,6 +161,14 @@ func Run() error {
163161
solverConfig, err := solverConfig.FetchSolverConfig(ctx, solverConfigOpts...)
164162
panicOnError(err)
165163

164+
keyshare, err := keyshareStore.GetKeyshare()
165+
var mpcAddress common.Address
166+
if err != nil {
167+
mpcAddress = ethereumCrypto.PubkeyToAddress(*keyshare.Key.ECDSAPub.ToBtcecPubKey().ToECDSA())
168+
} else {
169+
mpcAddress = common.HexToAddress(solverConfig.ProtocolsMetadata.Sprinter.MpcAddress)
170+
}
171+
166172
var hubPoolContract across.TokenMatcher
167173
acrossPools := make(map[uint64]common.Address)
168174
mayanPools := make(map[uint64]common.Address)
@@ -303,7 +309,7 @@ func Run() error {
303309

304310
lifiMh := evmMessage.NewLifiEscrowMessageHandler(
305311
*c.GeneralChainConfig.Id,
306-
ethereumCrypto.PubkeyToAddress(*keyshare.Key.ECDSAPub.ToBtcecPubKey().ToECDSA()),
312+
mpcAddress,
307313
lifiOutputSettlers,
308314
coordinator,
309315
host,

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/spf13/cobra v1.8.1
2222
github.com/spf13/viper v1.9.0
2323
github.com/sprintertech/lifi-solver v1.0.5
24-
github.com/sprintertech/solver-config/go v0.0.0-20251107123115-0ea5f862cab9
24+
github.com/sprintertech/solver-config/go v0.0.0-20251113121131-2347b1712859
2525
github.com/stretchr/testify v1.10.0
2626
github.com/sygmaprotocol/sygma-core v0.0.0-20250304150334-bd39ac4f7b82
2727
go.opentelemetry.io/otel v1.16.0

go.sum

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -950,14 +950,10 @@ github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
950950
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
951951
github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk=
952952
github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4=
953-
github.com/sprintertech/lifi-solver v0.0.0-20251107154632-5c22e7948a82 h1:Nq9wH4wU4W+3UXfeTqGwMBxr+yKDkz0wO6XzpSRkamg=
954-
github.com/sprintertech/lifi-solver v0.0.0-20251107154632-5c22e7948a82/go.mod h1:d5/fytopwudQUE9ojF54XwtqLRFD3JbpBlri7ygb3ng=
955-
github.com/sprintertech/lifi-solver v0.0.0-20251111111837-7cc93b43397c h1:MGoXgZ0yNYSWanDSZAGiluR9OOZxrLb/FyPlkT3EvNM=
956-
github.com/sprintertech/lifi-solver v0.0.0-20251111111837-7cc93b43397c/go.mod h1:d5/fytopwudQUE9ojF54XwtqLRFD3JbpBlri7ygb3ng=
957953
github.com/sprintertech/lifi-solver v1.0.5 h1:Qc4E/q8/xfXV8MZPcHIv48tEJBGt23P9pqRy4a2KGMg=
958954
github.com/sprintertech/lifi-solver v1.0.5/go.mod h1:d5/fytopwudQUE9ojF54XwtqLRFD3JbpBlri7ygb3ng=
959-
github.com/sprintertech/solver-config/go v0.0.0-20251107123115-0ea5f862cab9 h1:oo4/4LvkYMVVl/u9+iqEY91iCDFJ05pGwUJNX+6APnA=
960-
github.com/sprintertech/solver-config/go v0.0.0-20251107123115-0ea5f862cab9/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ=
955+
github.com/sprintertech/solver-config/go v0.0.0-20251113121131-2347b1712859 h1:PKQlVVUTPih7WqorHHYzJHON3LlaqAQ4S7fLuioxTgc=
956+
github.com/sprintertech/solver-config/go v0.0.0-20251113121131-2347b1712859/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ=
961957
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
962958
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
963959
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

0 commit comments

Comments
 (0)