Simplex reconfiguration framework - Part I (Helpers) - #363
Conversation
815daf2 to
76dca27
Compare
| canotoData canotoData_SimplexEpochInfo | ||
| } | ||
|
|
||
| func (sei *SimplexEpochInfo) IsZero() bool { |
There was a problem hiding this comment.
IsEmpty naming matches the blacklists pattern.
There was a problem hiding this comment.
True, but I actually think that was a mistake and we should've used IsZero for the blacklist as well.
I suggest we change it at a later time and just keep SimplexEpochInfo's IsZero as it's more more idiomatic and it's not a container (stack, list, slice) so it makes no sense to give it an "empty" adjective.
There was a problem hiding this comment.
sounds good, created an issue to remember this
#375
| }) | ||
| } | ||
|
|
||
| func (nbms NodeBLSMappings) ForEach(selector func(int, NodeBLSMapping)) { |
There was a problem hiding this comment.
i think we should remove this method
There was a problem hiding this comment.
are we adding these to a seperate pr? i thought we decided to update this pr with its comments
|
|
||
| type ValidatorSetApprovals []ValidatorSetApproval | ||
|
|
||
| func (vsa ValidatorSetApprovals) ForEach(f func(int, ValidatorSetApproval)) { |
This commit adds some helpers for the Simplex reconfiguration framework. This commit entails: - README.md changes to align with latest implementation - misc.go contains helpers which will be removed once we moved the code to avalanchego. - builds_decision.go contains a wrapper to the mempool that also listens to P-chain changes, and returns either when the mempool needs to build a block or re-configuration is in order. - encoding.go contains the types that encode Simplex metadata and blocks. Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
samliok
left a comment
There was a problem hiding this comment.
looks good to me, one comment but not needed. i think there are a couple unresolved comments from my previous review but when those are resolved i'll hit approve
| maxBlockBuildingWaitTime time.Duration | ||
| pChainListener PChainProgressListener | ||
| waitForPendingBlock func(ctx context.Context) | ||
| shouldTransitionEpoch func(pChainHeight uint64) (bool, error) |
There was a problem hiding this comment.
can we have a more detailed comment on what this callback expects? i feel like this should be named hasValidatorSetChanged to be more clear. and if we are doing hasValidatorSetChanged then the parameters of the callback should be prevPChainHeight, currentPChainHeight.
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
This commit adds some helpers for the Simplex reconfiguration framework.
This commit entails:
and returns either when the mempool needs to build a block or re-configuration is in order.