EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.28k stars 3.76k forks source link

New accounts get normalized from invalid names when created #9481

Closed AdB9 closed 3 years ago

AdB9 commented 4 years ago

Version of EOSJS: 21.0.3 EOSIO version 2.0.7

In eosjs v21.0.3, eosio v2.0.7 when trying to create an account it is accepting "0287cha66yyr" and directly creating an account in its normalized form i.e. ".2..cha..yyr", created without any error.

Clear guidelines of eosio account naming states that "Each account is identified by a human readable name between 1 and 12 characters in length. The characters can include a-z, 1-5, and optional dots (.) except the last character." But when trying to create an account with characters other than this, error should be thrown. But right now, it is automatically normalizing it and created an account with the normalized name without any warning or error thrown. This can be misleading as user might think the account has been created by the name he has passed. This issue is inconsistent i.e. It throws error sometimes and sometimes it doesn't.

Previously I used to get this error:
 Error 3010001: Invalid name
Name should be less than 13 characters and only contains the following 
symbol .12345abcdefghijklmnopqrstuvwxyz
Error Details:
Name not properly normalized (name: 0, normalized: ) 

Expected behavior

But now it simply creates the account by its normalized name, I'm unable to find about this in the release notes. I think account shouldn't be created and a proper error should be thrown consistently.

dimas1185 commented 4 years ago

@AdB9 hi, I can't reproduce this with v2.0.7 using cleos create account API:

cleos create account eosio 0287cha66yyr
Error 3010001: Invalid name
Name should be less than 13 characters and only contains the following symbol .12345abcdefghijklmnopqrstuvwxyz
Error Details:
Name not properly normalized (name: 0287cha66yyr, normalized: .2..cha..yyr) 

and as per our code base cleos create account should throw error on any erroneous name you provide to API. can you tell me the way you create an account?

sanaraufx commented 3 years ago

Cannot reproduce