Standardize sub-keeper usage within the ibc keeper #6058
Labels
type: refactor
Architecture, code or CI improvements that may or may not tackle technical debt.
Milestone
Summary
Currently, there is a mix of both reference and value types used for keepers in the app.go wiring. This has been problematic when the same keeper instance is expected to be passed to different keepers.
For example, the
clientKeeper
is passed to theconnectionKeeper
as well as theibcKeeper
. If a mutable field is added to the clientKeeper, this field will be discarded if the keeper is de-referenced and passed by value to one, and passed by reference to another.This has caused multiple subtle bugs, recently we ran into an issue with the consensus host validation where the overridden validation implementation was correctly assigned to
ibcKeeper
'sclientKeeper
but was not overridden in theconnectionKeeper
'sclientKeeper
.There was also a previous issue where the router was being discarded due to the same de-referencing issue.
Because the intent is that all sub-keepers of the ibc keeper refer to the same instances, I propose we simply make all keeper references pointers, instead of values.
I think this will effectively remove this class of error from the codebase.
For Admin Use
The text was updated successfully, but these errors were encountered: