eos icon indicating copy to clipboard operation
eos copied to clipboard

Local node state is updated before a transaction is included in a block

Open michaeljyeates opened this issue 8 years ago • 2 comments

When a producer misses their schedule, transactions made during that time will update the local state of the receiving node as if the transaction was successful. Once the next block is produced the state is reversed.

Accessing the same node and reading state provides incorrect data, even from other clients.

executed transaction: fc109efd07a1e54aa3de06a5a29b5292714ff3ca5d1fd63ff2304d543972d8fc  144 bytes  1001 us
#   eosio.token <= eosio.token::transfer        {"from":"eos42freedom","to":"theeosdublin","quantity":"100.0000 EOS","memo":"missing-test"}
#  eos42freedom <= eosio.token::transfer        {"from":"eos42freedom","to":"theeosdublin","quantity":"100.0000 EOS","memo":"missing-test"}
#  theeosdublin <= eosio.token::transfer        {"from":"eos42freedom","to":"theeosdublin","quantity":"100.0000 EOS","memo":"missing-test"}
warning: transaction executed locally, but may not be confirmed by the network yet
charles@eos42-bp1-ghostbusters:/Ghostbusters/ghostbusters-eos42freedom$ ./cleos.sh get currency balance eosio.token eos42freedom
50355.2902 EOS
charles@eos42-bp1-ghostbusters:/Ghostbusters/ghostbusters-eos42freedom$ ./cleos.sh get currency balance eosio.token eos42freedom
50355.2902 EOS
charles@eos42-bp1-ghostbusters:/Ghostbusters/ghostbusters-eos42freedom$ ./cleos.sh get currency balance eosio.token eos42freedom
50455.2902 EOS```

michaeljyeates avatar Jun 07 '18 21:06 michaeljyeates

This is not a bug. If you are running a node in speculative mode the state will always represent the head block + all transactions you know. We even warn the user!

warning: transaction executed locally, but may not be confirmed by the network yet

Using the history plugin you can get the state of all your transfers and whether they are reversible and/or how many confirmations they have.

Alternatively we could configure a node to not apply speculative transactions, but it would still apply potentially reversible blocks.

bytemaster avatar Jun 07 '18 22:06 bytemaster

A third party accessing the same node will also see the unconfirmed balance, they have not seen the warning and do not know that there is a transaction included which will not reach it to a block

michaeljyeates avatar Jun 07 '18 23:06 michaeljyeates