-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Milestone
Description
When reading a name from JSON,
Lines 154 to 158 in 232600c
| template <typename S> | |
| void from_json(name& obj, S& stream) { | |
| auto r = stream.get_string(); | |
| obj = name(hash_name(r)); | |
| } |
abieos first checks if it's a valid name and uses it, but if it's not a valid name it makes it a valid name by murmur hashing it,
Lines 145 to 149 in 232600c
| inline constexpr uint64_t hash_name( std::string_view str ) { | |
| auto r = try_string_to_name_strict(str); | |
| if( r ) return r.value(); | |
| return murmur64( str.data(), str.size() ); | |
| } |
This yields (imo) surprising behavior for someone using abieos to serialize actions from JSON. For example, someone using abieos' JSON->bin serialization may pass abieos
{"from":"bob bob bob","to":"carol","quantity":"2.0000 EOS","memo":"sup"}what would you expect to happen here? nodeos will disallow serialization in this case because bob bob bob isn't a valid name. but abieos will serialize it, with from being the murmur hash output of bob bob bob. I consider nodeos the canonical abi behavior and abieos should match it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Icebox