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 Store asset: "Unsupported Register instruction" #2227

Closed
0x009922 opened this issue May 18, 2022 · 3 comments
Closed

Register Store asset: "Unsupported Register instruction" #2227

0x009922 opened this issue May 18, 2022 · 3 comments
Assignees
Labels
Bug Something isn't working good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@0x009922
Copy link
Contributor

Description

When trying to register store asset through genesis, it is not committed with the following log message:

2022-05-18T13:59:12.948865Z WARN start_genesis_round: iroha_core::block: Transaction validation failed reason=Transaction rejected due to failure in instruction execution caused_by=Some(InstructionExecutionFail { instruction: Register(RegisterBox { object: EvaluatesTo { expression: Raw(Identifiable(Asset(Asset { id: Id { definition_id: DefinitionId { name: "Labadie", domain_id: Id { name: "Matthias_SCOP" } }, account_id: Id { name: "kpicard13", domain_id: Id { name: "Anicée_SCOP" } } }, value: Store(Metadata { map: {} }) }))), _value_type: PhantomData } }), reason: "Unsupported Register instruction" })

My genesis:

genesis.json
{
  "transactions": [
    {
      "isi": [
        {
          "Register": {
            "object": {
              "Raw": {
                "Identifiable": {
                  "NewDomain": {
                    "id": {
                      "name": "Matthias_SCOP"
                    },
                    "logo": null,
                    "metadata": {}
                  }
                }
              }
            }
          }
        },
        {
          "Register": {
            "object": {
              "Raw": {
                "Identifiable": {
                  "NewDomain": {
                    "id": {
                      "name": "Anicée_SCOP"
                    },
                    "logo": null,
                    "metadata": {}
                  }
                }
              }
            }
          }
        },
        {
          "Register": {
            "object": {
              "Raw": {
                "Identifiable": {
                  "NewAccount": {
                    "id": {
                      "name": "kpicard13",
                      "domain_id": {
                        "name": "Anicée_SCOP"
                      }
                    },
                    "signatories": [
                      "ed01202a400f423ff42e19fe77dc2908d5b3f0d0793663ff7e1eb6e9093d798694c377"
                    ],
                    "metadata": {}
                  }
                }
              }
            }
          }
        },
        {
          "Register": {
            "object": {
              "Raw": {
                "Identifiable": {
                  "AssetDefinition": {
                    "id": {
                      "name": "Labadie",
                      "domain_id": {
                        "name": "Matthias_SCOP"
                      }
                    },
                    "value_type": "Store",
                    "mintable": "Once",
                    "metadata": {}
                  }
                }
              }
            }
          }
        },
        {
          "Register": {
            "object": {
              "Raw": {
                "Identifiable": {
                  "Asset": {
                    "id": {
                      "definition_id": {
                        "name": "Labadie",
                        "domain_id": {
                          "name": "Matthias_SCOP"
                        }
                      },
                      "account_id": {
                        "name": "kpicard13",
                        "domain_id": {
                          "name": "Anicée_SCOP"
                        }
                      }
                    },
                    "value": {
                      "Store": {}
                    }
                  }
                }
              }
            }
          }
        }
      ]
    }
  ]
}

Iroha hash: 65592a97b2c983911a1b88297370780990efae97 (RC4, current iroha2)

@0x009922 0x009922 added Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST labels May 18, 2022
@appetrosyan appetrosyan added the good first issue Good for newcomers label May 19, 2022
@QuentinI QuentinI self-assigned this May 31, 2022
@QuentinI
Copy link
Contributor

QuentinI commented May 31, 2022

We don't actually have any implementation for registering an asset and never had any, as far as I understand.
Considering you don't need to register an asset to mint it, do we even need to support this? E.g. supplied genesis.json can be rewritten in terms of Mint to produce desired result.
My solution would be to just remove RegistrableBox::Asset variant altogether.

@QuentinI
Copy link
Contributor

Removing it isn't that easy actually, since for asset to implement Identifiable it has to have a corresponding RegistrableBox variant. But implementing any behavior for it also isn't trivial, since we would have two ways to change user's assets - minting and registering, and permission system would need to be changed to reflect that.

Actually it's not obvious for me why identification is coupled with registration in one Identifiable trait at all.

@appetrosyan
Copy link
Contributor

#2270 Decouples the Identifiable from Registrable. I do think that we should make API more consistent by not allowing minting an asset before registering.

QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 8, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 8, 2022
…count for (un)registering an asset

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 8, 2022
…g it first

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
@mversic mversic assigned mversic and unassigned QuentinI Jun 8, 2022
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 8, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 8, 2022
…count for (un)registering an asset

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 8, 2022
…g it first

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 9, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 9, 2022
…count for (un)registering an asset

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 9, 2022
…g it first

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 17, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 17, 2022
…count for (un)registering an asset

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 19, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 19, 2022
…count for (un)registering an asset

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 19, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 21, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 21, 2022
…count for (un)registering an asset

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
QuentinI pushed a commit to QuentinI/iroha that referenced this issue Jun 21, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to QuentinI/iroha that referenced this issue Jun 22, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to QuentinI/iroha that referenced this issue Jun 22, 2022
…count for (un)registering an asset

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit to QuentinI/iroha that referenced this issue Jun 22, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
appetrosyan pushed a commit that referenced this issue Jun 22, 2022
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
BAStos525 pushed a commit to BAStos525/soramitsu-iroha that referenced this issue Jul 8, 2022
…yperledger#2333)

Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
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 good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

4 participants