From c93350a3e1c69beacf214fb2776537af5a5f4914 Mon Sep 17 00:00:00 2001 From: Elad Gildnur Date: Sun, 24 Nov 2024 16:10:30 +0200 Subject: [PATCH] Fix a bug that caused the provider to not extract the consumer address --- protocol/rpcprovider/rpcprovider_server.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/protocol/rpcprovider/rpcprovider_server.go b/protocol/rpcprovider/rpcprovider_server.go index 53765c3b6b..6a778cf235 100644 --- a/protocol/rpcprovider/rpcprovider_server.go +++ b/protocol/rpcprovider/rpcprovider_server.go @@ -328,7 +328,13 @@ func (rpcps *RPCProviderServer) initRelay(ctx context.Context, request *pairingt } // we only need the chainMessage for a static provider if rpcps.StaticProvider { - return nil, nil, chainMessage, nil + // extract consumer address from signature + extractedConsumerAddress, err := rpcps.ExtractConsumerAddress(ctx, request.RelaySession) + if err != nil { + return nil, nil, nil, err + } + + return nil, extractedConsumerAddress, chainMessage, nil } relayCU := chainMessage.GetApi().ComputeUnits virtualEpoch := rpcps.stateTracker.GetVirtualEpoch(uint64(request.RelaySession.Epoch)) @@ -601,7 +607,7 @@ func (rpcps *RPCProviderServer) ExtractConsumerAddress(ctx context.Context, rela } else { extractedConsumerAddress, err = sigs.ExtractSignerAddress(relaySession) if err != nil { - return nil, utils.LavaFormatWarning("extract signer address from relay", err, utils.Attribute{Key: "GUID", Value: ctx}) + return nil, utils.LavaFormatWarning("failed to extract signer address from relay session", err, utils.LogAttr("GUID", ctx)) } } return extractedConsumerAddress, nil