Skip to content

Commit

Permalink
Typo fix (lavanet#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
shleikes authored Nov 23, 2023
1 parent b5a7c22 commit 61f47d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions protocol/rpcprovider/rpcprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const (
DEFAULT_ALLOWED_MISSING_CU = 0.2

ShardIDFlagName = "shard-id"
StickynessHeaderName = "sticky-header"
StickinessHeaderName = "sticky-header"
DefaultShardID uint = 0
)

Expand Down Expand Up @@ -545,9 +545,9 @@ rpcprovider 127.0.0.1:3333 COS3 tendermintrpc "wss://www.node-path.com:80,https:
for _, endpoint := range rpcProviderEndpoints {
utils.LavaFormatDebug("endpoint description", utils.Attribute{Key: "endpoint", Value: endpoint})
}
stickynessHeaderName := viper.GetString(StickynessHeaderName)
if stickynessHeaderName != "" {
RPCProviderStickynessHeaderName = stickynessHeaderName
stickinessHeaderName := viper.GetString(StickinessHeaderName)
if stickinessHeaderName != "" {
RPCProviderStickinessHeaderName = stickinessHeaderName
}
prometheusListenAddr := viper.GetString(metrics.MetricsListenFlagName)
rewardStoragePath := viper.GetString(rewardserver.RewardServerStorageFlagName)
Expand Down Expand Up @@ -579,7 +579,7 @@ rpcprovider 127.0.0.1:3333 COS3 tendermintrpc "wss://www.node-path.com:80,https:
cmdRPCProvider.Flags().Uint(ShardIDFlagName, DefaultShardID, "shard id")
cmdRPCProvider.Flags().Uint(rewardserver.RewardsSnapshotThresholdFlagName, rewardserver.DefaultRewardsSnapshotThreshold, "the number of rewards to wait until making snapshot of the rewards memory")
cmdRPCProvider.Flags().Uint(rewardserver.RewardsSnapshotTimeoutSecFlagName, rewardserver.DefaultRewardsSnapshotTimeoutSec, "the seconds to wait until making snapshot of the rewards memory")
cmdRPCProvider.Flags().String(StickynessHeaderName, RPCProviderStickynessHeaderName, "the name of the header to be attacked to requests for stickyness by consumer, used for consistency")
cmdRPCProvider.Flags().String(StickinessHeaderName, RPCProviderStickinessHeaderName, "the name of the header to be attacked to requests for stickiness by consumer, used for consistency")
cmdRPCProvider.Flags().Uint64Var(&chaintracker.PollingMultiplier, chaintracker.PollingMultiplierFlagName, 1, "when set, forces the chain tracker to poll more often, improving the sync at the cost of more queries")
return cmdRPCProvider
}
8 changes: 4 additions & 4 deletions protocol/rpcprovider/rpcprovider_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
debugLatency = false
)

var RPCProviderStickynessHeaderName = "X-Node-Sticky"
var RPCProviderStickinessHeaderName = "X-Node-Sticky"

type RPCProviderServer struct {
cache *performance.Cache
Expand Down Expand Up @@ -660,10 +660,10 @@ func (rpcps *RPCProviderServer) TryRelay(ctx context.Context, request *pairingty
if debugLatency {
utils.LavaFormatDebug("sending relay to node", utils.Attribute{Key: "GUID", Value: ctx}, utils.Attribute{Key: "specID", Value: rpcps.rpcProviderEndpoint.ChainID})
}
// add stickyness header
chainMsg.AppendHeader([]pairingtypes.Metadata{{Name: RPCProviderStickynessHeaderName, Value: common.GetUniqueToken(consumerAddr.String(), common.GetTokenFromGrpcContext(ctx))}})
// add stickiness header
chainMsg.AppendHeader([]pairingtypes.Metadata{{Name: RPCProviderStickinessHeaderName, Value: common.GetUniqueToken(consumerAddr.String(), common.GetTokenFromGrpcContext(ctx))}})
if debugConsistency {
utils.LavaFormatDebug("adding stickyness header", utils.LogAttr("tokenFromContext", common.GetTokenFromGrpcContext(ctx)), utils.LogAttr("unique_token", common.GetUniqueToken(consumerAddr.String(), common.GetIpFromGrpcContext(ctx))))
utils.LavaFormatDebug("adding stickiness header", utils.LogAttr("tokenFromContext", common.GetTokenFromGrpcContext(ctx)), utils.LogAttr("unique_token", common.GetUniqueToken(consumerAddr.String(), common.GetIpFromGrpcContext(ctx))))
}

reply, _, _, err = rpcps.chainRouter.SendNodeMsg(ctx, nil, chainMsg, request.RelayData.Extensions)
Expand Down

0 comments on commit 61f47d7

Please sign in to comment.