Skip to content
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

Issues with account create/update - possibly due to change in "extensions" #593

Closed
roadscape opened this issue Feb 19, 2016 · 6 comments
Closed
Milestone

Comments

@roadscape
Copy link

Users are reporting issues with creating accounts and updating votes, and it may be because "the extensions field on account create/update operations is now a struct not an array"

Source: https://bitsharestalk.org/index.php/topic,21530.msg280473.html#msg280473

When trying to register a premium name an unknown error message is shown and the console shows the following error:

!!! GrapheneApi error: get_required_fees [Array[1], "1.3.0"]0: Array[1]0: Array[2]0: 51: Objectactive: Objectextensions: Array[0]fee: Objectname: "nameredacted"options: Objectowner: Objectreferrer: "1.2.00000"referrer_percent: 0registrar: "1.2.00000"proto: Objectlength: 2__proto__: Array[0]length: 1__proto__: Array[0]1: "1.3.0"length: 2__proto__: Array[0] Object {code: 1, message: "7 bad_cast_exception: Bad Cast↵Invalid cast from t…array_type"}↵ th_a variant.cpp:575 get_object", data: Object}code: 1data: Objectmessage: "7 bad_cast_exception: Bad Cast↵Invalid cast from type 'array_type' to Object↵ {"type":"array_type"}↵ th_a variant.cpp:575 get_object"proto: Object {"code":1,"message":"7 bad_cast_exception: Bad Cast\nInvalid cast from type 'array_type' to Object\n {"type":"array_type"}\n th_a variant.cpp:575 get_object","data":{"code":7,"name":"bad_cast_exception","message":"Bad Cast","stack":[{"context":{"level":"error","file":"variant.cpp","line":575,"method":"get_object","hostname":"","thread_name":"th_a","timestamp":"2016-02-19T01:28:37"},"format":"Invalid cast from type '${type}' to Object","data":{"type":"array_type"}}]}}
app.js:102 ERROR AccountActions.createAccount Object {code: 1, message: "7 bad_cast_exception: Bad Cast↵Invalid cast from t…array_type"}↵ th_a variant.cpp:575 get_object", data: Object}code: 1data: Objectcode: 7message: "Bad Cast"name: "bad_cast_exception"stack: Array[1]0: Objectcontext: Objectdata: Objecttype: "array_type"proto: Objectformat: "Invalid cast from type '${type}' to Object"proto: Objectlength: 1__proto__: Array[0]proto: Objectmessage: "7 bad_cast_exception: Bad Cast↵Invalid cast from type 'array_type' to Object↵ {"type":"array_type"}↵ th_a variant.cpp:575 get_object"proto: Object__defineGetter__: defineGetter()defineSetter: defineSetter()lookupGetter: lookupGetter()lookupSetter: lookupSetter()constructor: Object()hasOwnProperty: hasOwnProperty()isPrototypeOf: isPrototypeOf()propertyIsEnumerable: propertyIsEnumerable()toLocaleString: toLocaleString()toString: toString()valueOf: valueOf()get proto: get proto()set proto: set proto()

User pc replies:

The reason for this is an undocumented API change in the latest release. The "extensions" field on account create/update operations is now a struct not an array. Which is precisely the reason why I think one week is far from sufficient time to introduce a hard fork!

bitshares/bitshares-core@a1e8fc0#diff-1a2d7c55b5a8f1e2bbb1c868896c94eeL117

Another one of the manifestations of this issue is that you cannot change your votes from the GUI wallet. @svk31 wonders if the appropriate changes were made in cli_wallet.

@abitmore
Copy link
Contributor

Reproduce:

  • Connect an older version of cli_wallet to witness_node-2.0.160216
  • try set_voting_proxy command
unlocked >>> set_voting_proxy abit-2fa in.abit true
set_voting_proxy abit-2fa in.abit true
1600759ms th_a       wallet.cpp:1896               sign_transaction     ] Caught exception while broadcasting tx 15915a9cc04ec88afbbda
c5c9c3f987744221cda:  0 exception: unspecified
7 bad_cast_exception: Bad Cast
Invalid cast from type 'array_type' to Object
    {"type":"array_type"}
    th_a  variant.cpp:575 get_object
    {"error":"7 bad_cast_exception: Bad Cast\nInvalid cast from type 'array_type' to Object\n    {\"type\":\"array_type\"}\n    th_a
variant.cpp:575 get_object","data":{"id":23,"error":{"code":1,"message":"7 bad_cast_exception: Bad Cast\nInvalid cast from type 'array
_type' to Object\n    {\"type\":\"array_type\"}\n    th_a  variant.cpp:575 get_object","data":{"code":7,"name":"bad_cast_exception","m
essage":"Bad Cast","stack":[{"context":{"level":"error","file":"variant.cpp","line":575,"method":"get_object","hostname":"","thread_na
me":"th_a","timestamp":"2016-02-20T15:26:40"},"format":"Invalid cast from type '${type}' to Object","data":{"type":"array_type"}}]}}}}
    th_a  state.cpp:38 handle_reply

Related issue (old cli_wallet with new witness_node as well. There is a new account registered in this block):

locked >>> get_block 3710432
get_block 3710432
7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array
    {"type":"object_type"}
    th_a  variant.cpp:530 get_array

@abitmore
Copy link
Contributor

The "Related issue" in above comment is unable to fix / won't fix, since the best is to modify the cli_wallet code, but latest cli_wallet works fine so no need to modify.

The issue in OP can probably be fixed by adding an additional judgement "|| get_type() == array_type" here, so arrays have chance to be tried to be converted to object. I will try.

Anyway, please be aware that it's dangerous to enable this new format of transaction before hard fork date, because it may probably cause network forking. please be aware that it's not dangerous to enable this new format before hard fork date if keep the extensions field empty .

@abitmore
Copy link
Contributor

Another option would be change the extensions field back to an array, so it will have better backwards compatibility. For example change the definition in this line from extension< ext > extensions to vector<extension< ext >> extensions and change related code accordingly.

  • Con: this need another hard fork.

@abitmore
Copy link
Contributor

Update: it's not dangerous to enable this new format before hard fork date if keep the extensions field empty , according to @pmconrad's comment in this thread. So GUi can be updated safely.

@theoreticalbts
Copy link
Contributor

We're aware of this issue and working on a fix

@theoreticalbts
Copy link
Contributor

Fixed in latest release.

pmconrad pushed a commit to pmconrad/graphene that referenced this issue Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants