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

Register a role and grant it to an account #2081

Closed
arndey opened this issue Apr 11, 2022 · 2 comments
Closed

Register a role and grant it to an account #2081

arndey opened this issue Apr 11, 2022 · 2 comments
Assignees
Labels
Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@arndey
Copy link

arndey commented Apr 11, 2022

I'm trying to create a role with permissions to can_set_key_value_in_user_metadata and can_remove_key_value_in_user_metadata (bob) and then grant it to other user (alice).

But I got error invalid: 400 Bad Request. Text: "Error: 0: Failed to accept transaction: Failed to verify transaction signatures".

Instructions(vec=[Register(registerBox=RegisterBox(object=EvaluatesTo(expression=Raw(value=Identifiable(identifiableBox=Role(role=Role(id=Id(name=Name(string=USER_METADATA_ACCESS)), 
permissions=[PermissionToken(name=Name(string=can_set_key_value_in_user_metadata), 
params={Name(string=account_id)=Id(idBox=AccountId(id=Id(name=Name(string=bob), 
domainId=Id(name=Name(string=wonderland)))))}), 
PermissionToken(name=Name(string=can_remove_key_value_in_user_metadata), 
params={Name(string=account_id)=Id(idBox=AccountId(id=Id(name=Name(string=bob), 
domainId=Id(name=Name(string=wonderland)))))})]))))))), 
Grant(grantBox=GrantBox(object=EvaluatesTo(expression=Raw(value=Id(idBox=AccountId(id=Id(name=Name(string=alice), 
domainId=Id(name=Name(string=wonderland))))))), 
destinationId=EvaluatesTo(expression=Raw(value=Id(idBox=RoleId(id=Id(name=Name(string=USER_METADATA_ACCESS))))))))])

Also I've tried to add the same role and grant it via genesis and find it by findRolesByAccountId query, but an error was returned:
invalid: 404 Not Found. Text: "��(wonderland"

"transactions" : [ {
    "isi" : [ {
      "Register" : {
        "object" : {
          "Raw" : {
            "Identifiable" : {
              "Domain" : {
                "id" : {
                  "name" : "wonderland"
                },
                "accounts" : { },
                "asset_definitions" : { },
                "metadata" : { },
                "logo" : null
              }
            }
          }
        }
      }
    }, {
      "Register" : {
        "object" : {
          "Raw" : {
            "Identifiable" : {
              "NewAccount" : {
                "id" : {
                  "name" : "alice",
                  "domain_id" : {
                    "name" : "wonderland"
                  }
                },
                "signatories" : [ "ed0120cc4b25eafdccd1147955018021aa5b4632cea868f94aad7a326360823cf6ee47" ],
                "metadata" : { }
              }
            }
          }
        }
      }
    }, {
      "Register" : {
        "object" : {
          "Raw" : {
            "Identifiable" : {
              "NewAccount" : {
                "id" : {
                  "name" : "bob",
                  "domain_id" : {
                    "name" : "wonderland"
                  }
                },
                "signatories" : [ "ed0120c548ec8390f18c9fb74cebae1ab1ed26428190828850ed62dd9248f7bcb0e934" ],
                "metadata" : { }
              }
            }
          }
        }
      }
    }, {
      "Register" : {
        "object" : {
          "Raw" : {
            "Identifiable" : {
              "Role" : {
                "id" : {
                  "name" : "USER_METADATA_ACCESS"
                },
                "permissions" : [ {
                  "name" : "can_set_key_value_in_user_metadata",
                  "params" : {
                    "account_id" : {
                      "Id" : {
                        "AccountId" : {
                          "name" : "bob",
                          "domain_id" : {
                            "name" : "wonderland"
                          }
                        }
                      }
                    }
                  }
                }, {
                  "name" : "can_remove_key_value_in_user_metadata",
                  "params" : {
                    "account_id" : {
                      "Id" : {
                        "AccountId" : {
                          "name" : "bob",
                          "domain_id" : {
                            "name" : "wonderland"
                          }
                        }
                      }
                    }
                  }
                } ]
              }
            }
          }
        }
      }
    }, {
      "Grant" : {
        "object" : {
          "Raw" : {
            "Id" : {
              "AccountId" : {
                "name" : "alice",
                "domain_id" : {
                  "name" : "wonderland"
                }
              }
            }
          }
        },
        "destination_id" : {
          "Raw" : {
            "Id" : {
              "RoleId" : {
                "name" : "USER_METADATA_ACCESS"
              }
            }
          }
        }
      }
    } ]
  } ]
}
@arndey arndey added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Apr 11, 2022
@appetrosyan appetrosyan added Bug Something isn't working and removed iroha2-dev The re-implementation of a BFT hyperledger in RUST labels Apr 13, 2022
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 15, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 15, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 15, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 15, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 15, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 16, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 16, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 18, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 18, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 18, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 20, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 20, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 24, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue Apr 25, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit that referenced this issue Apr 27, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
mversic pushed a commit to mversic/iroha that referenced this issue May 2, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 4, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
appetrosyan added a commit to appetrosyan/iroha that referenced this issue May 12, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
mversic pushed a commit to mversic/iroha that referenced this issue May 13, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
mversic pushed a commit to mversic/iroha that referenced this issue May 13, 2022
Signed-off-by: Aleksandr Petrosyan <a-p-petrosyan@yandex.ru>
@appetrosyan appetrosyan added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label May 16, 2022
@s8sato s8sato self-assigned this Jun 3, 2022
s8sato added a commit to s8sato/iroha that referenced this issue Jun 3, 2022
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
s8sato added a commit to s8sato/iroha that referenced this issue Jun 3, 2022
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
s8sato added a commit to s8sato/iroha that referenced this issue Jun 3, 2022
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
s8sato added a commit that referenced this issue Jun 4, 2022
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
@s8sato
Copy link
Contributor

s8sato commented Jun 6, 2022

I think I've confirmed in #2312 that the reported bug is no longer reproducible.
Could you check if this bug still occurs @arndey ?

@s8sato s8sato reopened this Jun 8, 2022
@s8sato
Copy link
Contributor

s8sato commented Jun 8, 2022

S. Sato, [2022/06/07 14:05]
[In reply to Aleksandr Petrosyan]
I just checked it with the test in Rust.
Given #2081 (#2081) is still a issue, something happens in SignaturesOf::verify.
I guess the transaction hash is different between client and peer

use case

Arjentix added a commit to Arjentix/iroha that referenced this issue Jun 21, 2022
…a#2371)

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Arjentix added a commit that referenced this issue Jun 21, 2022
Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
BAStos525 pushed a commit to BAStos525/soramitsu-iroha that referenced this issue Jul 8, 2022
Signed-off-by: Shunkichi Sato <49983831+s8sato@users.noreply.github.com>
Signed-off-by: BAStos525 <jungle.vas@yandex.ru>
BAStos525 pushed a commit to BAStos525/soramitsu-iroha that referenced this issue Jul 8, 2022
…a#2371)

Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Signed-off-by: BAStos525 <jungle.vas@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

4 participants