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

Created on 7 Jun 2018  ยท  2Comments  ยท  Source: EOSIO/eos

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.

```./cleos.sh push action eosio.token transfer '["eos42freedom", "theeosdublin", "100.0000 EOS", "missing-test"]' -p eos42freedom
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```

wontfix

Most helpful comment

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.

All 2 comments

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

congnghebitcoin picture congnghebitcoin  ยท  3Comments

dimakomar picture dimakomar  ยท  3Comments

bezalel picture bezalel  ยท  3Comments

jcalfee picture jcalfee  ยท  3Comments

christola picture christola  ยท  3Comments