-
Notifications
You must be signed in to change notification settings - Fork 51
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
After changing group_id treasurer stops working #224
Comments
hi @astroseger with the latest change in snet-cli from what I understand it is not possible to modify an existing group_id right in metadata ? |
Yes. service provider should never do it. If your really need it you can force it by removing and adding service again. But all payment channels will became invalid, and we still have a bug in daemon #224, so your daemon will also stop working. |
@anandrgitnirman |
Keep the Group ID check Optional (specially during claim). Refer Issue below singnet#224
We have the approaches to bypass the group ID check at the time of Claim snet-daemon/escrow/payment_channel_api.go Lines 40 to 42 in e9ff650
then check for this flag at snet-daemon/escrow/payment_channel_storage.go Line 130 in e9ff650
We can re name PaymentChannelKey to PaymentChannelKeyOptions Introduce a new param in the 2 core API methods to take an additional parameter snet-daemon/escrow/payment_channel_api.go Line 111 in 6005fdf
snet-daemon/escrow/payment_channel_api.go Line 126 in 6005fdf
Move the functionality on recipient check and Group ID checks to separate methods out of the method GetChannelStateFromBlockchain ( ideally this method should just read from Block chain based on the description ?) snet-daemon/escrow/payment_channel_storage.go Lines 118 to 154 in e9ff650
Ignore the Recipient check when deliberately |
@anandrgitnirman, I think we need to have a clear description why |
Hi @vsbogd
the group ID on step 1 and 2 are different thus throwing back an error as pointed out by Sergey . |
Thanks @anandrgitnirman. I would like to explain some group and Group of daemons (or service replicas) is some set of daemons which use the same etcd storage to keep off-chain channel state. It means that if some service is deployed using two groups of replicas (A and B) then daemons in group A doesn't have access to off-chain channel state for channels used by daemons in group B. It is the only reason why daemon groups exist. Typical use case is having groups of daemons in different geographical locations like UK and Singapoor. Then it is too slow to have shared etcd storage for them and we can introduce two local storages and two groups of daemons.
|
Returning to the issue use case. Service publisher published service using In other words I would propose to remove following check from configGroupID, err := reader.replicaGroupID()
if err != nil {
return nil, false, err
}
recipientPaymentAddress := reader.recipientPaymentAddress()
if ch.GroupId != configGroupID {
log.WithField("configGroupId", configGroupID).Warn("Channel received belongs to another group of replicas")
return nil, false, fmt.Errorf("Channel received belongs to another group of replicas, current group: %v, channel group: %v", configGroupID, ch.GroupId)
} and move it to |
Group ID check should only apply at the time of storing channel state in etcd for the first time
Ensure Group ID check should only apply at the time of storing channel state in etcd for the first time Moved the group ID check from BlockchainChannelReader to lockingPaymentChannelService.PaymentChannel()
fixed released on Daemon, closing this issue |
Way to reproduce the bug:
--force
option). In order to change group_id your could simplemetadata-init
which will reinitialize group_id, and after you update metadata in Registry bysnet service update-metadata
(but in the last version you will need to use force here).snet treasurer claim-all
, and it will fail with "Channel received belongs to another group of replicas,...." error from the daemon...The possible cause of the problem is following: then daemon execute treasurer related commands it sometime verify that group_id of the channel corresponds to the current group_id and sometimes not...:
GetListUnclaimed
return list of all payment channels (including channels with old group_id)StartClaim
works only with channels with new group_idI would suggest that in
controle_service
daemon should work with all channels with correct payment_address. The owner ofpayment_address
(and we verify it with the signature) has right to do anything with his channels. So we shouldn't verify that group_id is still correct..(even though the changing of group_id is not recommended)
The text was updated successfully, but these errors were encountered: