Conversation
|
|
| // State witness with a list of all witness data | ||
| message StateWitness { | ||
| // store level proof | ||
| tendermint.crypto.ProofOp proof_op = 1; |
There was a problem hiding this comment.
Consider renaming to just proof (as in WitnessData).
There was a problem hiding this comment.
This has to be updated in https://github.com/celestiaorg/tendermint, and then pulled to rollmint with get_deps.sh.
| @@ -0,0 +1,24 @@ | |||
| syntax = "proto3"; | |||
There was a problem hiding this comment.
Is this file needed? Or it's just side-effect of running ./proto/get_deps.sh?
There was a problem hiding this comment.
it's just side-effect of running ./proto/get_deps.sh
There was a problem hiding this comment.
But can we remove this file safely?
| } | ||
| // TODO: gossip fraudProof to P2P network | ||
| // fraudTx: current DeliverTx | ||
| _ = fraudProof |
There was a problem hiding this comment.
Gossiping code is ready - are there any blockers to execute it here?
| if fraudProofsEnabled { | ||
| isr, err := e.getAppHash() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| ISRs = append(ISRs, isr) | ||
| isFraud := e.checkFraudProofTrigger(isr, currentIsrs, currentIsrIndex) | ||
| if isFraud { | ||
| fraudProof, err := e.generateFraudProof(&beginBlockRequest, deliverTxRequests, nil) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| // TODO: gossip fraudProof to P2P network | ||
| // fraudTx: current DeliverTx | ||
| _ = fraudProof | ||
| } | ||
| currentIsrIndex++ | ||
| } |
There was a problem hiding this comment.
This (more or less) should be extracted as function as it's repeated 3 times.
|
|
||
| // Represents a single-round fraudProof | ||
| type FraudProof struct { | ||
| // The block height to load state of | ||
| blockHeight int64 | ||
|
|
||
| appHash []byte | ||
| // A map from module name to state witness | ||
| stateWitness map[string]StateWitness | ||
|
|
||
| // Fraudulent state transition has to be one of these | ||
| // Only one have of these three can be non-nil | ||
| fraudulentBeginBlock *abci.RequestBeginBlock | ||
| fraudulentDeliverTx *abci.RequestDeliverTx | ||
| fraudulentEndBlock *abci.RequestEndBlock | ||
| } | ||
|
|
||
| // State witness with a list of all witness data | ||
| type StateWitness struct { | ||
| // store level proof | ||
| Proof tmcrypto.ProofOp | ||
| RootHash []byte | ||
| // List of witness data | ||
| WitnessData []WitnessData | ||
| } | ||
|
|
||
| // Witness data containing a key/value pair and a SMT proof for said key/value pair | ||
| type WitnessData struct { | ||
| Key []byte | ||
| Value []byte | ||
| Proof tmcrypto.ProofOp | ||
| } |
There was a problem hiding this comment.
This could be moved to separate file (fraud_proofs.go or similar).
|
|
Co-authored-by: Tomasz Zdybał <tomek@zdybal.lap.pl>
|
|
|
|
Currently we need to use Manav's branch from celestiaorg/tendermint fork.
|
|
|
|
Co-authored-by: Tomasz Zdybał <tomek@zdybal.lap.pl>
|
|
|
|
|
|
|
|
|
|
| github.com/spf13/viper v1.13.0 | ||
| github.com/stretchr/testify v1.8.0 | ||
| github.com/tendermint/tendermint v0.34.21 | ||
| github.com/tendermint/tendermint v0.34.14 |
There was a problem hiding this comment.
We shouldn't downgrade tendermint.
|
|
||
| replace ( | ||
| github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4 | ||
| github.com/tendermint/tendermint => github.com/celestiaorg/tendermint v0.34.18-0.20220826223854-50069357d918 |
There was a problem hiding this comment.
We need our tendermint version rebased on top of v0.34.21.
| require.NoError(err) | ||
| nodeBlock, err := nodes[i].Store.LoadBlock(h) | ||
| require.NoError(err) | ||
| // Only Intermediate state roots set by block aggregator are relevant, removed for sake of comparison |
There was a problem hiding this comment.
Why we need to remove this? Is there any discrepancy between ISRs between aggregator and full nodes?
There was a problem hiding this comment.
Test fails without explicit clearing of RawRootsList, which is strange. It's a part of a block data, so it has to be the same in all blocks. We need to figure out why it differs.
| assert.GreaterOrEqual(endCnt, adjustedHeight) | ||
| assert.GreaterOrEqual(commitCnt, adjustedHeight) | ||
|
|
||
| assert.Equal(generateFraudProofCnt, beginCnt+endCnt+clientNodes) |
There was a problem hiding this comment.
- First argument is "expected", second is "actual", so you should swap arguments to
Equal. - It's not obvious why
beginCnt+endCnt+clientNodes- please add comment with explanation.
There was a problem hiding this comment.
Updated and added comment with explanation.
| @@ -0,0 +1,24 @@ | |||
| syntax = "proto3"; | |||
There was a problem hiding this comment.
But can we remove this file safely?
|
|
|
|
Co-authored-by: Tomasz Zdybał <tomek@zdybal.lap.pl>
|
|
|
|
|
All comments on this PR was resolved, but we need to close it, as I created it, instead of @Manav-Aggarwal, so I can't accept it. |
This PR wraps up entire Fraud Proof related work into single PR. It might be easier to review / apply comments this way.
Replaces: #375, #498, #500.