Make notary support enabled by default in morph client #905

Open
opened 2024-01-11 13:52:18 +00:00 by aarifullin · 1 comment
Member

For now notary subsystem is widely used, so, the proposal is to enable notary support by default in morph client constructor.

To make this, we need to invoke EnableNotarySupport in constructor, but at the same it would be better to make this method deprecated to notify client to stop using this invocation explictly.

I suggest to create enableNotarySupport, copy the definition to there and make

// Deprecated: Notary support is enabled by default during client construction.
func (c *Client) EnableNotarySupport(opts ...NotaryOption) error {
  return c.enableNotarySupport(opts...) // also use in the constructor
}

Also, we need to avoid throwing panic-s like here, here etc.
It is required to make morph client non-panic-prone and return error instead panic.

Since, we're getting rid of EnableNotarySupport, we need to indroduce a method to disable the notary support enabled by default:

func (c *Client) DisableNotarySupport() {
  // ...
}
For now notary subsystem is widely used, so, the proposal is to enable [notary](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/client.go#L63) support by default in morph client [constructor](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/constructor.go#L93). To make this, we need to invoke [EnableNotarySupport](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/notary.go#L81-L115) in constructor, but at the same it would be better to make this method `deprecated` to notify client to stop using this invocation explictly. I suggest to create `enableNotarySupport`, copy the definition to there and make ```go // Deprecated: Notary support is enabled by default during client construction. func (c *Client) EnableNotarySupport(opts ...NotaryOption) error { return c.enableNotarySupport(opts...) // also use in the constructor } ``` Also, we need to avoid throwing `panic`-s like [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/notary.go#L152), [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/constructor.go#L95) etc. It is required to make morph client non-panic-prone and return error instead `panic`. Since, we're getting rid of `EnableNotarySupport`, we need to indroduce a method to disable the notary support enabled by default: ```go func (c *Client) DisableNotarySupport() { // ... } ```
aarifullin added the
enhancement
label 2024-01-11 13:52:18 +00:00
fyrchik added the
frostfs-node
label 2024-01-11 17:29:44 +00:00
fyrchik added this to the v0.38.0 milestone 2024-01-11 17:30:02 +00:00
elebedeva was assigned by fyrchik 2024-01-16 11:56:27 +00:00
fyrchik modified the milestone from v0.38.0 to v0.39.0 2024-02-12 06:24:53 +00:00
fyrchik modified the milestone from v0.39.0 to vNext 2024-05-14 14:10:12 +00:00
fyrchik was assigned by elebedeva 2024-08-20 07:45:23 +00:00
elebedeva removed their assignment 2024-08-20 07:45:33 +00:00
Member

While implementing this feature faced next problem in innerring:

  1. initialization of morph client now requires proxy contract

    • notary support is enabled in client's constructor
    • notary options must be passed to constructor
    • proxy contract is required in notary option
  2. initialization of contracts requires morph client

While implementing this feature faced next problem in innerring: 1. initialization of morph client now requires proxy contract - notary support is enabled in client's constructor - notary options must be passed to constructor - proxy contract is required in notary option 2. initialization of contracts requires morph client
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#905
No description provided.