-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BCI-3991] - Remove CR from relayer struct #14146
Conversation
@@ -132,7 +129,7 @@ func (p *mercuryProvider) MercuryServerFetcher() mercurytypes.ServerFetcher { | |||
} | |||
|
|||
func (p *mercuryProvider) ChainReader() commontypes.ContractReader { | |||
return p.chainReader | |||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this panic? Or better, remove the ChainReader
function from the provider interface? Returning nil might cause confusion or errors downstream where a reader is expected and no nil checks are done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method override is coming from the PluginProvider it can't be removed, all other product providers just return nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm
@@ -281,7 +280,6 @@ func (r *Relayer) NewPluginProvider(rargs commontypes.RelayArgs, pargs commontyp | |||
} | |||
|
|||
return NewPluginProvider( | |||
r.chainReader, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to update the (r *Relayer) NewPluginProvider()
method to initalise Contract Reader from relayArgs. Wrong assumption was made that the ChainReader would be initialised in the relayer body so they tried to use that to initialise PluginProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ilija42 this is what you mean? 0e9a5b0
(#14146)
Do I need to bind a contract in the initialization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ilija42 this is what you mean? 0e9a5b0 (#14146)
Yes, looks good!
Do I need to bind a contract in the initialization?
No, I just wanted to avoid unexpected behaviour here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tagging @DeividasK since he worked on PluginProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Message from @DeividasK
👋 hey, we only use relayer.NewContractReader in core/services/relay/evm/write_target.go, so it should be ok to remove the chainReader field.
Quality Gate passedIssues Measures |
Task Description:
Chain Reader shouldn’t be part of the Relayer struct since it will never have a global config.
This PR:
chainReader
from Relayer structureNewPluginProvider
andNewMercuryProvider
so they don't receive unusedchainReader
anymoreChainReader()
method return nilTicket:
Notes: