-
Notifications
You must be signed in to change notification settings - Fork 28
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
Move VRF proof from Header to Entropy for compatibity #559
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #559 +/- ##
==========================================
- Coverage 66.23% 66.09% -0.15%
==========================================
Files 278 278
Lines 36943 36999 +56
==========================================
- Hits 24471 24456 -15
- Misses 10713 10783 +70
- Partials 1759 1760 +1
|
dfc7bad
to
f9e8761
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using following rule about all import ordering?
- go default library like
fmt
. - external library not line
- other line library, ex: github.com/line/tm-db
- ostracon itself library
I have a simple question. Please tell me why this file |
@kokeshiM0chi Yes. The evidence proto became the same as Tendermint. For compatibility, the Tendermint proto should be used as much as possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* move proof and round to entropy * fix abci * remove duplicated proto * fix mocks * fix import ordering * fix proto number * fix test
Abstract
This PR move VRF proof and round from Header to new field, Entropy for Tendermint compatibity.
Background
Like #543 and #546, Ostracon should be as compatible as possible with IBC and Cosmos-SDK. However the compatibility is low for light client, since Ostracon's header structure is different from Tendermint's one. Therefore, the Ostracon header should be identical to the Tendermint.
Main Changes
proof
andround
are removed from the header and added to a new field Entropy. This makes the ostracon header identical to the Tendermint. Removing the proof from the header has various effects. Therefore, there are the following considerations, and fixes have been made where necessary.Considerations and Minor Changes
Can Entropy be trusted?
Yes. There is no VRF proof in Header. However, block id contains Markle root hash of the entire block and validators sign to block id, so it guarantees that Entropy is single at every height.
How is Entropy used securely?
BlockID.Hash is the Header hash. Also Header does not contain Entropy or Entropy hash. Therefore, validating BlockID.Hash is not enough to securely handle Entropy, and it is necessary to validate the Merkle root hash of the block. PartSetHeader validation is added, because PartSetHeader contains the Merkle root hash. This PR adds PartSetHeader validation at:
Is Entropy used in light clients?
Yes. However, since there is no Entropy or Entropy hash in the Header, light clients need to download the block to use Entropy securely. But light clients doesn't validate the proposer, so it doesn't matter.
Is Entropy used in ABCI apps?
Yes. ABCI apps need to be able to use VRF proofs for validator election, however VRF proof has been removed from the Header. This PR adds Entropy to RequestBeginBlock in order to use Entropy in ABCI apps.
Is the statesync able to be executed?
Yes. The statesync is executed using the light client. Nodes need the LastProofHash to reconstruct the state, however it can't be got from the LightBlock. This PR makes it possible to get LastProofHash by getting block using rpc client.
Result
Header and commit are now identical to Tendermint. This theoretically allows us to use the Tendermint light client as is.
Closes: #554