-
Notifications
You must be signed in to change notification settings - Fork 83
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
The Address type is a compatibility hazard #738
Comments
100%. See also: |
I did some playing around and came up with this: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0191e82bcb54280bba0f0fcb03d13003 I really like how I'm not fully set on the implementatoin of GenericAddress, i think there can be some improvement such as using an inlined vec, but its better than using a buf of the fully encoded size. I also havent decided how to expose a "validate is one of these type" sort of thing, but i suppose it can just be return the type enum and let the caller do a match. |
How does this solve the problem stated here? Basically, what we need here is a type that can deal with "unknown" address classes. |
|
The real concern here is that existing actors (per-compiled) might start rejecting addresses from the system (if the system introduces new addresses). |
Currently, the
Address
type validates the underlying address format and understands all the different protocols. Unfortunately, this is a compatibility hazard that could make it difficult to add new address types to the system.E.g.:
One solution would be to make the address type care less about the actual address format (potentially adding a "validate" method to be called where absolutely necessary).
The text was updated successfully, but these errors were encountered: