-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat: Test stateless execution for cosmos-sdk baseapp using SMT-based fraudproofs #248
Conversation
16b2d33
to
4e7e590
Compare
db/types/creator.go
Outdated
// RocksDBBackend represents rocksdb (uses github.com/cosmos/gorocksdb) | ||
// - EXPERIMENTAL | ||
// - requires gcc | ||
// - use rocksdb build tag (go build -tags rocksdb) | ||
RocksDBBackend BackendType = "rocksdb" |
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.
Q: What is the reason for removing rocksdb here?
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.
011f9d1
Had local issues with dependency management in macOS so added it, apologies, will revert this before merging (adding note in description)
store/v2alpha1/smt/store.go
Outdated
func (s *Store) GetSMTProof(key []byte) (*smt.SparseMerkleProof, error) { | ||
if len(key) == 0 { | ||
return nil, errKeyEmpty | ||
} | ||
proof, err := s.tree.Prove(key) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &proof, nil | ||
} |
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.
What is wrong with above's GetProof
?
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.
The smt library accepts a raw proof only in the construction of deepSubTrees which are used when verifying a fraudProof before loading up a baseApp with it
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.
Hmm but this is about reading proofs, not writing proofs, no? Why does the SMT accepting raw proofs as writes matter?
traceListenMixin: newTraceListenMixin(), | ||
substoreTraceListenMixins: make(map[types.StoreKey]*traceListenMixin), |
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.
With the substoreTraceListenMixins
, the traceListenMixin
seems a bit redundant. Or is it still required?
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.
I view traceListenMixin
as a tracer for Multistore
and the substoreTraceListenMixins
as tracers for each individual subStore
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.
Ah OK. We can later make this a bit more explicit by renaming the variables or at least adding comments. Once the PR is feature complete.
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.
Can't wait to see a simple single-round fraud proof in action!
6c54c75
to
1c95f17
Compare
c80d9ea
to
1702a47
Compare
baseapp/baseapp_test.go
Outdated
storeKeyToSubstoreTraceBuf := make(map[stypes.StoreKey]*bytes.Buffer) | ||
storeKeyToSubstoreTraceBuf[capKey2] = subStoreTraceBuf | ||
|
||
fraudProof := generateFraudProof(cms, storeKeyToSubstoreTraceBuf) |
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.
Can you clarify a bit the order of operations to get to here? Does appB1.Commit()
above commit state changes to disk? Does generateFraudProof
get Merkle proofs against the post-execution root, or the pre-execution root?
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.
Calls to Commit()
are irrelevant here, so I removed them for clarity. app.cms
is able to access any state modified by block transactions.
generateFraudProof
gets Merkle proofs against the post-execution root. We'd like the pre-execution root which is where rolling back the app's state to the previous block is needed.
…n revert back when merging" This reverts commit 011f9d1.
266a4de
to
c088b81
Compare
everything is moved to cosmos-sdk-rollmint repo |
Description
As part of the fraudproof cycle described in #245, we'd like to be able to test stateless execution for a cosmos-sdk baseapp by using fraudproofs based on the new multistore with SMTs.
Parts covered from the cycle of a fraudproof:
Closes: #252
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change