-
Notifications
You must be signed in to change notification settings - Fork 14
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
Rotation in view change #46
Conversation
6fef1d1
to
0376f0e
Compare
leader := int(prop.GetIndex()) % authority.Len() | ||
|
||
iter := authority.AddressIterator() | ||
iter.Seek(leader) |
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.
finally a way to reset an iterator \o/
cosi/mod.go
Outdated
@@ -37,6 +37,11 @@ type Actor interface { | |||
// CollectiveSigning is the interface that provides the primitives to sign a | |||
// message by members of a network. | |||
type CollectiveSigning interface { | |||
// GetSigner returns the individual signer assigned to the instance. One | |||
// should not used it to verify a collective signature but only for identity |
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.
// should not used it to verify a collective signature but only for identity | |
// should not use it to verify a collective signature but only for identity |
crypto/mod.go
Outdated
// GetNext returns the next public key only if a call to HasNext returns | ||
// true. |
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.
// GetNext returns the next public key only if a call to HasNext returns | |
// true. | |
// GetNext returns the next public key in case HasNext returns true. If not | |
// no assumption can be done. |
String() string | ||
} | ||
|
||
// AddressIterator is an iterator over the list of addresses of a membership. | ||
type AddressIterator interface { | ||
Seek(int) |
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.
There should be the same comments as in the PublicKeyIterator
interface.
blockchain/skipchain/ops.go
Outdated
@@ -138,3 +176,31 @@ func (ops *operations) catchUp(target SkipBlock, addr mino.Address) error { | |||
} | |||
} | |||
} | |||
|
|||
// waitBlock releases the catch up lock and wait for new blocks to be committed. | |||
// It will return true if the expected block index exists before the timeout. |
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 guess you changed the plan ^^
func (q *queue) Clear() { | ||
q.Lock() | ||
q.locked = false | ||
q.items = 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.
isn't it dangerous to set it to nil? I would expect a clear to empty the list, not "invalidate" 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.
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.
learned something today
Will be able to merge once the tests pass again |
a71f316
to
a310504
Compare
Rotation in view change
This implement a simple view change that rotates the leader every block.