opened
spalladino
username_0
If the dev is upgrading from a non-GSN contract to one that is, they need to manually set the relayhub address on the contract. It is highly likely that they forget doing this.

A valid fix is assuming that the hub address is the singleton one, if it is not set. Evaluate whether this is a good solution, and if so, implement it.
Default to singleton relayhub address on GSN context if not set
issue
created
frangio
username_1
My initial thought is I would avoid adding this special case into the code. If we did, a user may never set a RelayHub address in storage and the RelayHub being used might change as a side effect of a Contracts upgrade. This might be a desirable feature but it's a different discussion.

Since the OpenZeppelin CLI already asks the user if they want to call a function after an upgrade or deployment, what I would do is add a `setDefaultRelayHub` external function that can only be called once. This is essentially what `GSNContext.initialize` does today but made so that it can also be called post-upgrade.

https://github.com/OpenZeppelin/openzeppelin-contracts-ethereum-package/blob/66a8d9600e524c70940208e4bd7e83e6da04b2de/contracts/GSN/GSNContext.sol#L21-L23
comment
created
nventuro
username_2
We'd need to make it so that it can only be called if `GSNRecipient` has not be initialized, regardless of the initialization status of the rest of the contracts. Note that this is similar to one of the migration schemes we had originally proposed, I don't recall the details that led to not moving forward with it.
comment
closed
frangio
username_1
issue