Skip to content

Conversation

@meling
Copy link
Member

@meling meling commented Dec 31, 2021

  • Added Configuration.Contains(nodeID)
  • Changed WithNodeIDs(ids []uint32) to ids ...uint32
  • Custom subconfigurations for a tree

This makes it easier to use with single entry node IDs.
This implements methods for constructing subconfigurations.
The example implementation provided herein is for a binary tree
that can be used for signature aggregation such as Handle.
This makes it easier to use with single entry node IDs.
This implements methods for constructing subconfigurations.
The example implementation provided herein is for a binary tree
that can be used for signature aggregation such as Handle.
@johningve
Copy link
Member

Looking at the SubConfigurations function, the mgr parameter could easily be replaced by an interface returning the raw manager instead of passing the raw manager directly:

// AsRawManager provides access to the underlying RawManager of a generated Manager.
type AsRawManager interface {
	// AsRaw returns a pointer to the underlying RawManager.
	AsRaw() *RawManager
}
 // Derive subconfigurations from the manager's base configuration.
-func SubConfigurations(mgr *RawManager, opt SubConfigOption) ([]RawConfiguration, error) {
+func SubConfigurations(mgr AsRawManager, opt SubConfigOption) ([]RawConfiguration, error) {
        if opt == nil {
                return nil, ConfigCreationError(fmt.Errorf("missing required subconfiguration option"))
        }
-       return opt.subConfig(mgr)
+       return opt.subConfig(mgr.AsRaw())
 }

This makes it possible to pass a generated manager as the argument to the function, but then there is the problem of converting the raw configurations returned by the function back into generated configurations. Do you have any ideas on how to make this work?

@johningve
Copy link
Member

Of course, one solution is to move this function into the generated code, but that would necessitate changes to the SubConfigOption interface and further increase the number of APIs exposed by gorums that are not intended to be used outside of generated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants