Gsn configuration overide issue

Hi Guys,
I am on ganche and using typescript and in my tests
I am declaring the gsn configuration like this

  gsnConfig = configureGSN.configureGSN({
    gasPriceFactorPercent: 70,
    maxRelayNonceGap: 3,
    methodSuffix: '',
    jsonStringifyRequest: false,
    chainId: 1337,
    relayLookupWindowBlocks: 1e5,
    preferredRelays: [  'http://127.0.0.1:49835' ],
    relayHubAddress:
    RELAYHUB.address,
    paymasterAddress: paymaster.address,
    forwarderAddress: FORWARDER.address,
    clientId: '1',
    sliceSize: 3,
    logLevel: 1,
    minGasPrice: 0,
    relayTimeoutGrace: 1800
  })

But I get Error: Resolve cannot override passed values error I am setting all the values defined in export GSNConfig interface can anyone look into it?

the errors trace tracks to https://github.com/opengsn/gsn/blob/master/src/relayclient/GSNConfigurator.ts#L60
for reference

I have checked all values they are correct just for reference doing the same thing as done here https://github.com/opengsn/gsn/blob/b987b9e687ec4095c0875ceb0ef20ef3af38e1fa/test/Utils.test.ts#L213 still it gives the override issue cc open gsn tesm

currently, the resolveConfigurationGSN() requires you to put paymaster address, but also requires you NOT to put a relayHub address.
the reasoning is that it reads the relayhub address from the paymaster, so any value you put manually can’t help, and can only create mis-configuration.

thanks can you get the docs updated please

@drortirosh doesn’t work same error with commenting the relay hub address

gsnConfig = configureGSN({
gasPriceFactorPercent: 70,
maxRelayNonceGap: 3,
methodSuffix: ‘’,
jsonStringifyRequest: false,
chainId: 1337,
relayLookupWindowBlocks: 1e5,
preferredRelays: [ ‘http://127.0.0.1:58530’ ],
// relayHubAddress:
// RELAYHUB.address,
paymasterAddress: paymaster.address,
forwarderAddress: FORWARDER.address,
clientId: ‘1’,
sliceSize: 3,
logLevel: 1,
minGasPrice: 0,
relayTimeoutGrace: 1800
})

I think the doc does say to use:
gsnConfig = resolveConfigurationGsn ( provider, { paymasterAddress: xxxx }
That’s the only required item, since that method resolves everything from the chain.
You can add logLevel.
Depending on your ganache configuration, you may it may not need to add chainId (if you have --chainId param, then you DONT need to specify it in the configuration. If you don’t have the param, you DO have to specify it: it’s a bug in ganache that by default, it reports chainid 1337, but in assembly it’s chainId 1. They fixed it only if you add the command line param)

I was actually setting chain id but the docs mentioned this instead

gsnConfig = configureGSN({
paymasterAddress: paymaster.address,
gasPriceFactorPercent: 70,
methodSuffix: ‘_v4’,
jsonStringifyRequest: true,
chainId: ‘*’,
relayLookupWindowBlocks: 1e5,
relayHubAddress: ‘0xCA3ef05158d0dBD38cC7B49FbBc979d4cB977Ccc’,
stakeManagerAddress: ‘0x316e9B4bBBBC9B585918CD19357fA686df636D22’,
preferredRelays: [ ‘http://127.0.0.1:43027’ ],
verbose: true
})
gsnProvider = new RelayProvider(origProvider, gsnConfig)

anyways this issue is resolved now

glad it was solved. chainId. is a numeric parameter, and have a ‘*’ value
will get fixed…