Skip to content

Commit a6f42d6

Browse files
authored
workaround for broken testnet hare3 protocol name (#6728)
1 parent 3127546 commit a6f42d6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

api/node/client/client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ func (s *NodeService) Publish(ctx context.Context, proto string, blob []byte) er
129129
// The `hare3.DefaultProtocolName` contains slashes which
130130
// makes it unsuitable for a path parameter,
131131
// thus we change it to hare3 here and backwards on the server side.
132+
// FIXME: we check if `proto == ""` because the testnet config has
133+
// empty hare3 proto in `config/presets/testnet.go`.
134+
// Remove it after fixing the testnet preset.
135+
if proto == "" {
136+
proto = "testnet-hare3-workaround"
137+
}
132138
if proto == hare3.DefaultProtocolName {
133139
proto = "hare3"
134140
}

api/node/server/server.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ func (s *Server) PostPublishProtocol(
261261
}
262262

263263
protocol := string(request.Protocol)
264+
// FIXME: we check if `proto == "testnet-hare3-workaround"` as a workaround for
265+
// an empty hare3 proto in `config/presets/testnet.go`.
266+
// The client set "testnet-hare3-workaround" and we change back to "".
267+
// Remove it after fixing the testnet preset.
268+
if protocol == "testnet-hare3-workaround" {
269+
protocol = ""
270+
}
264271
if protocol == "hare3" {
265272
// Revert protocol change (avoiding slashes) done on the client side.
266273
// TODO: hare3 takes that from configuration what also should be done

0 commit comments

Comments
 (0)