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

Add the root state of storage (leveldb) to the consensus #623

Closed
Jim8y opened this issue Aug 5, 2021 · 5 comments
Closed

Add the root state of storage (leveldb) to the consensus #623

Jim8y opened this issue Aug 5, 2021 · 5 comments

Comments

@Jim8y
Copy link
Contributor

Jim8y commented Aug 5, 2021

Summary or problem description
We know that all nodes have the same block that contains exactly the same transactions after the consensus. However, we can not ensure that CNs have the same transaction execution results as neither did we put the transaction results into the consensus nor the block. Due to storage damage or other potential reasons, different nodes may have different execution results given the same transactions.

Do you have any solution you want to propose?
Add the root state of the storage of the primary to the preparerequest message, and other CNs check that value with their own storage root state, call for a change view if values do not match.

It would be even better if we could also write the storage root state into Block to make sure that all nodes not only have the same Chain Blocks, but also the same states.

Where in the software does this update applies to?

  • Consensus
  • Plugins
@roman-khimov
Copy link
Contributor

neo-project/neo#1526

@Jim8y
Copy link
Contributor Author

Jim8y commented Aug 6, 2021

neo-project/neo#1526

Its still not in the header or consensus, did you have any conclusion on that in your last discussion?

@roman-khimov
Copy link
Contributor

Well, it's all there for careful reader to go through and the net result probably can be seen in the protocol. At the same time it can be seen in StateRootInHeader protocol extension in NeoGo (that allows us also to make an extension for neo-project/neo#2373 which is a work in progress at the moment).

@Jim8y Jim8y closed this as completed Aug 6, 2021
@roman-khimov
Copy link
Contributor

@Liaojinghui, don't get me wrong, I'm all for making state root hash a part of the header (with block N containing state root for block N-1) in some Neo 3.1 and we have an extension in NeoGo for a reason, but there are also reasons why we don't have it in Neo 3.0 already.

@Jim8y
Copy link
Contributor Author

Jim8y commented Aug 6, 2021

@Liaojinghui, don't get me wrong, I'm all for making state root hash a part of the header (with block N containing state root for block N-1) in some Neo 3.1 and we have an extension in NeoGo for a reason, but there are also reasons why we don't have it in Neo 3.0 already.

@roman-khimov товарищи, i misunderstood you for one tiny second, but I realized i was wrong instantly. Please forgive my last foolish comment. I will punish myself to open more issues to keep bothering you, erik, and other neo developers as well. Thank you very much for your kindness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants