Skip to content

Commit

Permalink
Fix a bug that caused the provider to not extract the consumer address (
Browse files Browse the repository at this point in the history
  • Loading branch information
shleikes authored Nov 24, 2024
1 parent f41ce88 commit 6fff40e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions protocol/rpcprovider/rpcprovider_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6fff40e

Please sign in to comment.