Unify AllowedAddressConverter configuration code#10175
Draft
Conversation
975d1ae to
c95de7e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Despite the large diff, the result is just simplifying some quirks introduced when we added the CHASM-implementation of callbacks.
Background
When the CHASM callbacks code was added in #8473, it forked the configuration setting from HSM. Specifically:
chasm.callback.allowedAddressesconfig settingAddressMatchRules,AddressMatchRuletypesallowedAddressConverterfor reading dynamic configThat seemed like a reasonable approach. But unfortunately it's left the code in a kind of rickety state.
Problem
Because of this duplication there's a number of quirks:
AddressMatchRulesin two places in Hook up CHASM Scheduler to Frontend handler #8694.AddressMatchRulesin service/frontend/fx.go. And so the CHASMValidator.gouses the newer copy of the address matching code.Changes
This PR applies a few key changes to make this situation a bit easier to navigate.
AddressMatchRulesimplementation. Sincecomponents/callbacksalready had a dependency onchasm/lib/callback, thecomponents/callbacksversion was deleted. (Assuming that the two versions were functionally identical.)config_address_match[_test].go.chasm.callback.allowedAddressesconfiguration key to justcallback.allowedAddresses. Since the value was never read, I'm assuming this won't break in any non-pathological instances.Confirmation the duplicated code is still (mostly) identical
Why?
AllowedAddressesconfiguration values, things work as expected.How did you test it?
Potential risks
I'm honestly not sure. I would love your thoughts on things I may have missed.