ethermint-archive icon indicating copy to clipboard operation
ethermint-archive copied to clipboard

Joint Consensus Analysis

Open illya13 opened this issue 9 years ago • 8 comments

I might be completely wrong BUT It looks like now we have following

  • new tx is validated by validateTx which is high level "It Is Ok to accept tx" check
  • no execution of Smart Contracts
  • no pending state modification because of Smart Contract execution
  • tendermint consensus is applied over set of tx validated above
  • we don't have any post state modifications consensus rounds over on ethereum level

So if we have compromised validator(s) what can be impact ?

  • if we have an attack applied EVM / Smart Contract level it might be not visible before / during tendermint consensus round
  • so tx will be applied, included into block, accepted by network
  • this will lead to a different state on valid / compromised nodes on ethereum level

illya13 avatar Nov 27 '17 10:11 illya13

Mh, Tendermint by design might include invalid transactions.

What do you mean by issue on EVM/SC level?

adrianbrink avatar Nov 27 '17 12:11 adrianbrink

IMO, as a business owner I might want to have consensus over state of the system after applying some modifications (i.e. transactions processing) and I don't think we can prove we have it now in ethermint.

Not sure about core tendermint. The issue is about joint application ethermint built over tendermint and ethereum.

CC: @jaekwon @ebuchman

illya13 avatar Nov 27 '17 12:11 illya13

@adrianbrink "issue on a EVM / Smart Contract level" - might be bad wording from my side I mean an attack applied on Smart Contract / EVM level

illya13 avatar Nov 27 '17 12:11 illya13

You have that consensus with the next block. So far transaction in block H you have consensus over the state at H+1.

adrianbrink avatar Nov 27 '17 16:11 adrianbrink

No I don't or I'm missing smth !- as following transactions again are validated only based on "It Is Ok to accept tx" including ONLY https://github.com/tendermint/ethermint/blob/master/app/app.go#L211

  • signature check
  • balance check
  • nonce check
  • gas check But no logical validation over EVM / Smart Contract

Example:

Given: network, 4 validators started by 2 companies A and B, by 2 each ( 2x2 ) They both agreed to run some business based on some assets or tokens Smart Contract

When: Company A internally modifies a code to fake the game rules - allow to transfer some assets or tokens for non an owner. It is visible only on Smart Contract / EVM level (i.e. not on balance / gas / nonce level).

When: Somebody sends tx to change tokens or asset ownership, all 4 nodes accept tx But internally might process them in a different way i.e.

  • tx: send token from A to B signed by A
  • 2 nodes apply this change
  • 2 nodes rejects

Then: Somebody sends another tx to change tokens or asset ownership, all 4 nodes accept tx But internally again might process them in a different way i.e.

  • tx: send token from B to C signed by B
  • 2 nodes apply this change
  • 2 nodes rejects

... It is hard for me to predict the state of the system in the future and I think this is already not a blockchain with consensus over the state

illya13 avatar Nov 27 '17 16:11 illya13

or maybe I'm just missing how we use blockHash from Commit on tendermint level https://github.com/tendermint/ethermint/blob/master/app/app.go#L173

illya13 avatar Nov 27 '17 16:11 illya13

Mh, so if one of the companies alters the Ethermint code to handle transactions differently it would result in a different state root.

So block H they all agree on a number of transactions. Then they run them against the application (ethermint) and 2 of the nodes process the txs differently resulting in a different state root. At block H+1 the consensus will fail, since half the nodes have a different state root and hence they won't come to consenus and halt.

As long as less than 1/3 of the nodes alter their source code this is safe.

adrianbrink avatar Nov 27 '17 16:11 adrianbrink

👍

illya13 avatar Nov 27 '17 16:11 illya13