-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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!: Add hooks to allow app modules to add things to state-sync #10961
Changes from 10 commits
67087bb
d9f3482
80862d1
7190df2
893a661
9aa2b24
d105e94
a41b06d
fb15629
451d2b5
c0bf26f
869593e
81fde71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,39 @@ message Snapshot { | |
// Metadata contains SDK-specific snapshot metadata. | ||
message Metadata { | ||
repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes | ||
} | ||
} | ||
|
||
// SnapshotItem is an item contained in a rootmulti.Store snapshot. | ||
message SnapshotItem { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's moved to snapshot package to avoid cyclic import. |
||
// item is the specific type of snapshot item. | ||
oneof item { | ||
SnapshotStoreItem store = 1; | ||
SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; | ||
SnapshotExtensionMeta extension = 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to send There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
SnapshotExtensionPayload extension_payload = 4; | ||
} | ||
} | ||
|
||
// SnapshotStoreItem contains metadata about a snapshotted store. | ||
message SnapshotStoreItem { | ||
string name = 1; | ||
} | ||
|
||
// SnapshotIAVLItem is an exported IAVL node. | ||
message SnapshotIAVLItem { | ||
bytes key = 1; | ||
bytes value = 2; | ||
int64 version = 3; | ||
int32 height = 4; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we really need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this EDIT: I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, let's add a comment please. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done, I just copied the comments from #10794 shamelessly. |
||
} | ||
|
||
// SnapshotExtensionMeta contains metadata about an external snapshotter. | ||
message SnapshotExtensionMeta { | ||
string name = 1; | ||
uint32 format = 2; | ||
} | ||
|
||
// SnapshotExtensionPayload contains payloads of an external snapshotter. | ||
message SnapshotExtensionPayload { | ||
bytes payload = 1; | ||
} |
This file was deleted.
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.
maybe prefix comment with UNSAFE to users know not to use this for just anything.
Im happy this is added, I was working on something that needs this
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 we bundle store into
SnapshotManager
? I'm not sure if we should export this function.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.
It's for supporting code like this, and not all extension snapshotter need the
cms
, I don't see a more elegant way to support this: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 found a function like this useful for debugging app hash non-determinism sources.
I think it should be there but needs a more extensive comment.
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 do you think if we add:
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.
on second thought I have already started to use this for another feature and bez added it in on of his prs. Lets leave it as is.