-
Notifications
You must be signed in to change notification settings - Fork 399
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
Uninitialized accounts are unmarshalled with invalid data #661
Comments
cc @moul Initializing and saving unknown accounts on query requests can have real side-effects on storage, so I suggest we discuss how we want to go about solving a problem like this |
Hey, thank you. @zivkovicmilos: what do you suggest? Anyone: any feedback on how other chains handle this is a manner you prefer? |
Not exactly sure what should be the appropriate fix that doesn't have any unwanted side effects. Ethereum handles these situations (querying of previously untouched accounts) in the following manner:
I honestly see no problem in doing the same on our Tendermint node, the only thing I'm worried about is the |
I like the idea of returning a pre-initialized account if the passed address doesn't exist, unfortunately as you mentioned it's not possible due to the account number, which is a global counter incremented each time a new account is created. The other way of dealing with non-existent account would be to return an error instead of |
I suggest we return an This is a straightforward issue in |
Uninitialized accounts are returned with invalid data
Description
Executing a query to
auth/accounts/<address>
for a previously unseen address returns anil
response to an ABCI query result. This can lead to an invalid account (zero address) being returned (when unmarshalling this ABCI response on the client).Your environment
Steps to reproduce
auth/accounts/<address>
from a client (ex.client.ABCIQuery
)gnoland.GnoAccount
, the data will not match what was queries (address is zero address)Expected behaviour
The account data should be returned (and filled correctly) even if the account is not found in the blockchain storage
Actual behaviour
If the account is not found,
nil
is returned, leading to an invalid unmarshal operation on ABCI clients.Logs
Proposed solution
Account fetches should never return
nil
, but rather initialize the account and return it.The text was updated successfully, but these errors were encountered: