-
Notifications
You must be signed in to change notification settings - Fork 113
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
Streamable Snapshot #2358
Streamable Snapshot #2358
Conversation
DiffEpochIndex: committableEC.EI(), | ||
LatestECRecord: committableEC, | ||
// CreateSnapshot creates a snapshot file to the given file path. | ||
func CreateSnapshot(filePath string, |
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.
Through the producers you are extracting data over a certain amount of time; as you are not locking the notarization manager in between these producer calls, it could be possible that your header will contain data that won't match your UTXOs or Diffs. Imagine for instance that a new epoch is confirmed in between asking for the latest confirmed epoch and your epoch diffs: you will have unmatched header and snapshot contents!
I think you should make sure that the ledgerstate and the diffs of the notarization manager do not change after you determine what epochs you are going to dump into the snapshot: 1) by locking the ledgerstate so it cannot be updated in the meantime, 2) passing the epochs you want the diffs for to the producers calls.
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.
Just change the ledgerstate**s**
references to ledgerstate
. It sounds weird =)
packages/core/snapshot/snapshot.go
Outdated
return stringify.Struct("Snapshot", | ||
stringify.StructField("LedgerSnapshot", s.LedgerSnapshot), | ||
) | ||
return | ||
} | ||
|
||
func (s *Snapshot) updateConsensusManaDetails(nodeSnapshot *mana.SnapshotNode, output devnetvm.Output, outputMetadata *ledger.OutputMetadata) { |
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.
Is this function used?
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, nope, I'll remove it.
Description of change
Implement #2288
Type of change
Change checklist