-
Notifications
You must be signed in to change notification settings - Fork 15
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
Implement logic to clone and rollback storage for engine switching. #334
Conversation
…cting dependent components
… a lock on a store.
|
||
// Remove committee for the next epoch only if forking point is before point of no return and committee is reused. | ||
// Always remove committees for epochs that are newer than targetSlotEpoch+1. | ||
func (p *Prunable) shouldRollbackCommittee(epochIndex iotago.EpochIndex, targetSlotIndex iotago.SlotIndex) (bool, error) { |
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.
This logic is very specific and it might lead to issues if the behavior of the committee rotation changes. Maybe we can put it in the Sybilprotection
and hand it in as a callback?
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 agree. The only problem here is that the rollback also depends on the storage perception of the committee: if it was persisted and found or not. Using a callback would also force us to pass the prunable committee storage in the sybilprotection, which in turn will depend on the sybilprotection to determine if a rollback is due: creating a cycle.
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 think we should be able to put it there: PerformanceTracker
has the committee store already:
iota-core/pkg/protocol/sybilprotection/sybilprotectionv1/performance/performance.go
Line 20 in 3a3b48e
committeeStore *epochstore.Store[*account.Accounts] |
The only thing we'd need to do is expose this method on the SybilProtection
interface and hand it to the prunable. Problem here is that the storage is initialized before the entire engine.
So maybe it's okay to leave it there...
cede9c9
to
c237d8c
Compare
Fixes #313