WIP: Make notary support enabled by default in morph client #961
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#961
Loading…
Reference in a new issue
No description provided.
Delete branch "elebedeva/frostfs-node:feat/morph-default-notary-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #905
Notary support is enabled by default in morph client constructor.
EnableNotarySupport()
is marked asdeprecated
. AddedDisableNotarySupport()
method. Replaced panics with returned errors.Tested with
dev-env
.Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com
acd57e376a
to13645804b8
13645804b8
toa9b564a27e
WIP: Make notary support enabled by default in morph clientto Make notary support enabled by default in morph client@ -72,15 +72,6 @@ func initMorphComponents(ctx context.Context, c *cfg) {
lookupScriptHashesInNNS(c) // smart contract auto negotiation
if c.cfgMorph.notaryEnabled {
c.cfgMorph.notaryEnabled
is used after this? Can be deleted?replaced
c.cfgMorph.notaryEnabled
withc.cfgMorph.notaryDisabled
, it is used to skip notary-related steps in non-notary environments.@ -130,3 +122,4 @@
if !s.mainNotaryConfig.disabled {
// enable notary support in the main client
//lint:ignore SA1019 we need notary support enabled in main chain
What is the problem here?
I thought it was an appropriate case of using
EnableNotarySupport()
even if it's deprecated. Now it seems illogical (having in mind that if notary support is disabled - it must be on purpose) so i decided to return anerror
here instead.@ -287,3 +338,3 @@
if c.notary == nil {
panic(notaryNotEnabledPanicMsg)
return errors.New(notaryNotEnabledErrMsg)
What about a global
var ErrNotaryNotEnabled = errors.New
? It could exist alongside the message constant, if it is used anywhere else.fixed.
a9b564a27e
toe1301c90da
e1301c90da
todb61e5448a
@ -83,3 +75,2 @@
c.log.Info(logs.FrostFSNodeNotarySupport,
zap.Bool("sidechain_enabled", c.cfgMorph.notaryEnabled),
zap.Bool("sidechain_enabled", !c.cfgMorph.notaryDisabled),
Why not to rename
sidechain_enabled
too?fixed.
@ -78,6 +81,43 @@ func defaultNotaryConfig(c *Client) *notaryCfg {
// EnableNotarySupport creates notary structure in client that provides
// ability for client to get alphabet keys from committee or provided source
// and use proxy contract script hash to create tx for notary contract.
func (c *Client) enableNotarySupport(opts ...NotaryOption) error {
What the difference with
EnableNotarySupport
?It's the same
EnableNotarySupport()
but now it's called fromClient constructor
therefore there is no need to make it public.Why not to remove it or call private from public? Why we need to duplicate code?
@aarifullin mentions it here:
Let's do like @aarifullin suggested:
fixed.
db61e5448a
to519e988798
519e988798
to62e2e8881e
62e2e8881e
toac36ae3c23
ac36ae3c23
to318a23d820
318a23d820
toff0f029788
@ -137,3 +123,1 @@
if err != nil {
return fmt.Errorf("could not enable main chain notary support: %w", err)
}
return fmt.Errorf("main chain notary support is disabled")
Either the condition or the message is wrong, in this branch notary is enabled, but the message says it is disabled, why so?
Also, we could use
errors.New
here.Was it tested on dev-env? (container creation is enough)
Make notary support enabled by default in morph clientto WIP: Make notary support enabled by default in morph clientWhile implementing this feature faced next problem in innerring:
initialization of morph client now requires proxy contract
initialization of contracts requires morph client
Closing PR until solution is found.
Pull request closed