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

ir: Support auto-deployment in non-local consensus launch mode #2665

Merged
merged 12 commits into from
Dec 7, 2023

Conversation

cthulhu-rider
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Attention: 214 lines in your changes are missing coverage. Please review.

Comparison is base (752d8a7) 30.22% compared to head (c92556a) 30.06%.

Files Patch % Lines
pkg/innerring/innerring.go 0.00% 80 Missing ⚠️
pkg/morph/client/client.go 0.00% 64 Missing ⚠️
pkg/innerring/deploy.go 0.00% 44 Missing ⚠️
pkg/morph/client/notifications.go 0.00% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2665      +/-   ##
==========================================
- Coverage   30.22%   30.06%   -0.16%     
==========================================
  Files         406      406              
  Lines       30025    30174     +149     
==========================================
- Hits         9075     9072       -3     
- Misses      20170    20321     +151     
- Partials      780      781       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/morph/client/notifications.go Outdated Show resolved Hide resolved
pkg/morph/client/client.go Show resolved Hide resolved
pkg/morph/client/constructor.go Outdated Show resolved Hide resolved
@cthulhu-rider cthulhu-rider force-pushed the feature/non-local-autodeploy branch 4 times, most recently from 8461331 to ec0492d Compare December 6, 2023 18:24
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: for ir-healthcheck Container "3fe89d10c8f1" is unhealthy.

client *client.Client

netmapContractMtx sync.RWMutex
netmapContract *netmap.Client

*rpcclient.WSClient
wsClient *rpcclient.WSClient
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why neoFSSidechainCommonRPC (or any other similar interface) is not enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we discussed client.Client and rpcclient.WSClient cannot share the whole needed interface due to event listening methods. Another inconvenience is that client.Client is one-time in terms of subscriptions. So, for non-local consensus we use client.Client dedicated for deployment only (opened, used, closed, then use another instance), while in local one we use single (local) rpcclient.WSClient with which we can cancel deploy subscriptions and continue as if from scratch

i could have 2 different types for these 2 modes, but decided to not do so for now

@cthulhu-rider
Copy link
Contributor Author

ERROR: for ir-healthcheck Container "3fe89d10c8f1" is unhealthy.

see docker logs ir01

guess it wants NNS e-mail config

nns:
system_email: usr@domain.io
that does not default now

@roman-khimov
Copy link
Member

roman-khimov commented Dec 6, 2023

That's dev-env and it's still deployed with neofs-adm, I expect it to work as it worked before.

And likely some default (nonexistent@nspcc.io) would be handy as well, not a lot of people care about this e-mail.

@cthulhu-rider
Copy link
Contributor Author

some default (nonexistent@nspcc.io)

done

@roman-khimov
Copy link
Member

Still isn't healthy.

There is a need to interchange single-endpoint WebSocket Neo RPC client
with the multi-endpoint one. Previously, multi-client did not expose
some needed methods or did it with other signature and/or behavior.

Inherit subset of `rpcclient.WSClient` method in multi `client.Client`.
Subscriptions are left untouched.

Refs #2195.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
The method is completely unusable because it accepts nowhere defined
subscription ID.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Transaction signer parameter is not a filter: it extends event stream
with specific notary requests, not filters out the other ones added the
same way.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Not expected in practice, but still have to be checked.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, notary request events were always filtered by main
transactions' signers, therefore it was impossible to subscribe to
all notary request events.

Newly added method `ReceiveAllNotaryRequests` will be useful for
components that want to receive all notary requests.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
All notary requests are listened, not only the committee ones.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Deploy procedure sometimes waits for a new block from the blockchain.
Previously, waiting could be interrupted by the global context only.
This did not allow waiting to be interrupted when the event stream was
interrupted (which usually means the connection was lost).

Closing the channel of new blocks will now result in a lost connection
error returned from the deployment procedure.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, `deploy.Blockchain` interface had same event subscription
interface as Neo RPC WebSocket client in Neo Go lib. Although this made
it possible to directly use `rpcclient.WSClient` as an instance, the
interface itself was over-saturated with respect to its use in the
deployment procedure. In particular, event filtering was never done and
events were never demuxed. Also, the previous version of the interface
made it impossible to use a client connected to several endpoints.
Based on these considerations, the interface is simplified. As a result,
it is now possible to provide an interface from a multi-endpoint client.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, Inner Ring app did not start Sidechain auto-deployment and
update procedure in non-local consensus launch mode. While pure remote
RPC configuration is supported, auto-deployment must not depend on
consensus locality. The only difference is that remote configuration
should support multiple endpoints.

Refs #2195.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, Inner Ring app required `nns.system_email` config to be set.
Since NNS emails are not something meaningful, it makes sense to use
some default one.

Assign `nonexistent@nspcc.io` email to the NNS domains registered during
FS chain deployment by default.

Refs #2195.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@cthulhu-rider cthulhu-rider force-pushed the feature/non-local-autodeploy branch from a18d1ba to c92556a Compare December 7, 2023 04:05
@cthulhu-rider
Copy link
Contributor Author

fixed, should work now

@roman-khimov roman-khimov merged commit c134063 into master Dec 7, 2023
5 of 10 checks passed
@roman-khimov roman-khimov deleted the feature/non-local-autodeploy branch December 7, 2023 14:54
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.

2 participants