Skip to content
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

Consider not importing default payload implementations for production applications #91

Closed
roman-khimov opened this issue Feb 9, 2024 · 0 comments · Fixed by #97
Closed
Labels
enhancement Improving existing functionality I3 Minimal impact S3 Minimally significant U4 Nothing urgent
Milestone

Comments

@roman-khimov
Copy link
Member

Is your feature request related to a problem? Please describe.

I'm always frustrated when we import/build code we don't need. We have payloads/block implementations that are imported by default, but no real application uses them. They're useful for tests, they can be provided for edge cases, but they're not needed to be present in production builds.

Describe the solution you'd like

Drop defaults for New* payload callbacks. They still can be used via payload.* methods, we can even add some method to provide the default set of options for all of them, but we can avoid importing them in NeoGo or Bane.

Describe alternatives you've considered

Keep this code in our builds. Nothing critical with this, btw.

Additional context

#89
#90

@roman-khimov roman-khimov added enhancement Improving existing functionality U4 Nothing urgent S3 Minimally significant I3 Minimal impact labels Feb 9, 2024
AnnaShaleva added a commit that referenced this issue Feb 13, 2024
A part of #2. Use generics instead of util.Uint160 and util.Uint256
types for DBFT and related components. Keep util.Uint160 and util.Uint256
only for specific DBFT implementation in testing code.

The following regressions/behaviour changes were made to properly
apply generics:
1. `dbft.Option` alias is removed since type parameters can't be defined
   on aliases (generic type aliases are prohibited). Ref.
   golang/go#46477.
2. Default dBFT configuration is reduced: all payload-specific defaults
   are removed, as described in #91.
   It is done because default dBFT configuration should not depend on any
   implementation-specific hash type.
3. DBFT configuration validation check is extended wrt point 2.
4. The check if generic `dbft.DBFT` type implements generic `dbft.Service`
   interface is removed since such check should be performed on particular
   (non-generic) DBFT implementation.

Signed-off-by: Anna Shaleva <[email protected]>
@AnnaShaleva AnnaShaleva added this to the v0.2.0 milestone Feb 13, 2024
AnnaShaleva added a commit that referenced this issue Feb 13, 2024
A part of #2. Use generics instead of util.Uint160 and util.Uint256
types for DBFT and related components. Keep util.Uint160 and util.Uint256
only for specific DBFT implementation in testing code.

The following regressions/behaviour changes were made to properly
apply generics:
1. `dbft.Option` alias is removed since type parameters can't be defined
   on aliases (generic type aliases are prohibited). Ref.
   golang/go#46477.
2. Default dBFT configuration is reduced: all payload-specific defaults
   are removed, as described in #91.
   It is done because default dBFT configuration should not depend on any
   implementation-specific hash type.
3. DBFT configuration validation check is extended wrt point 2.
4. The check if generic `dbft.DBFT` type implements generic `dbft.Service`
   interface is removed since such check should be performed on particular
   (non-generic) DBFT implementation.
5. `dbft.Service` interface is removed since it's unused.

Signed-off-by: Anna Shaleva <[email protected]>
AnnaShaleva added a commit that referenced this issue Feb 13, 2024
A part of #2. Use generics instead of util.Uint160 and util.Uint256
types for DBFT and related components. Keep util.Uint160 and util.Uint256
only for specific DBFT implementation in testing code.

The following regressions/behaviour changes were made to properly
apply generics:
1. `dbft.Option` alias is removed since type parameters can't be defined
   on aliases (generic type aliases are prohibited). Ref.
   golang/go#46477.
2. Default dBFT configuration is reduced: all payload-specific defaults
   are removed, as described in #91.
   It is done because default dBFT configuration should not depend on any
   implementation-specific hash type.
3. DBFT configuration validation check is extended wrt point 2.
4. The check if generic `dbft.DBFT` type implements generic `dbft.Service`
   interface is removed since such check should be performed on particular
   (non-generic) DBFT implementation.

Signed-off-by: Anna Shaleva <[email protected]>
AnnaShaleva added a commit that referenced this issue Feb 13, 2024
A part of #2. Use generics instead of util.Uint160 and util.Uint256
types for DBFT and related components. Keep util.Uint160 and util.Uint256
only for specific DBFT implementation in testing code.

The following regressions/behaviour changes were made to properly
apply generics:
1. `dbft.Option` alias is removed since type parameters can't be defined
   on aliases (generic type aliases are prohibited). Ref.
   golang/go#46477.
2. Default dBFT configuration is reduced: all payload-specific defaults
   are removed, as described in #91.
   It is done because default dBFT configuration should not depend on any
   implementation-specific hash type.
3. DBFT configuration validation check is extended wrt point 2.
4. The check if generic `dbft.DBFT` type implements generic `dbft.Service`
   interface is removed since such check should be performed on particular
   (non-generic) DBFT implementation.

Signed-off-by: Anna Shaleva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality I3 Minimal impact S3 Minimally significant U4 Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants