-
Notifications
You must be signed in to change notification settings - Fork 245
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
feat: kick all members after ownership change and auto-accept after sharing the address #4187
Conversation
P.S. Not sure that some fn naming is good, so I'm open for a renamings |
Jenkins BuildsClick to see older builds (56)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍 I have few naming improvement proposals and concerns
services/ext/api.go
Outdated
@@ -646,6 +646,10 @@ func (api *PublicAPI) DeleteCommunityCategory(request *requests.DeleteCommunityC | |||
return api.service.messenger.DeleteCommunityCategory(request) | |||
} | |||
|
|||
func (api *PublicAPI) CommunityNewOwnershipKickAllAndRequestRejoin(communityID types.HexBytes) (*protocol.MessengerResponse, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we don't want explicit endpoint for that, this should happen automatically when we set ourselves as control node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that we were planning to call it directly from the status-desktop side.
So far it is not clear to me how we will set up as an owner. Will we have a separate API for this? As I understand - we will listen for a community token on the status-desktop side
Do you mean it must be put in PromoteSelfToControlNode
?
I'm asking as I have status-desktop changes where I call this API async and if we do not need it - then I need to remove it
P.S. Anyway, it was used by me for testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The action will be triggered manually by the status-desktop client. The objective is to have a single API: PromoteSelfToControlNode
. The specifics of what this API does should be determined internally in status-go logic. If the control node changes to a new user, the API will make the current user the new control node, update the contract with itself as a signer, remove all others, and then request addresses. If the control node changes among devices, the API will make the current installation the control node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thank you. Should I implement this API or it is already in progress in some other task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. To the best of my knowledge, it hasn't been implemented yet. It would be great if you could address it within the scope of this PR 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@endulab has a PR with the call to setPubkey (to make yourself owner), you can use the same API or create a new one that's called PromoteSelfToControlNode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added API PromoteSelfToControlNode
A small reminder: please try to keep commits self-contained. If someone checks out 4a3cc37, it will not compile because it requires the subsequent commit that runs make generate. Every commit should be healthy so that it compiles and tests pass. Otherwise, things like |
I always do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!
c392e8c
to
3eebe98
Compare
Found a bug with resending requests to join during the testing. When we have a new owner, CommunityDescription can be verified with a delay (due to loop interval) and it can cause the situation when the client received CommunityDescription but did not verify it, and then it receives a resend request to join message, but he is still not kicked and current contract owner != controlNode() pubkey from his old CommunityDescription Taking into account, that the community description will be added to the verification loop only when there will be a new control node, the clients during publishing |
587fdf2
to
12f2b43
Compare
12f2b43
to
b17e98a
Compare
protocol/migrations/sqlite/1698329296_add_signature_to_revealed_addresses.up.sql
Outdated
Show resolved
Hide resolved
90b567e
to
78b7242
Compare
if newControlNode != nil { | ||
o.setControlNode(newControlNode) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…haring the address
…g requests to join
59dd24f
to
f5fce1c
Compare
status-desktop PR: status-im/status-desktop#12560
Closes: status-im/status-desktop#11969