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

[BUG] Iroha doesn't panic and shut down if the key pairs for IROHA_GENESIS_ACCOUNT are completely different for each peer. #3195

Closed
AlexStroke opened this issue Feb 20, 2023 · 0 comments
Assignees
Labels
Bug Something isn't working Dev defect The defect was found at the development stage. Did not have an impact on users. iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix

Comments

@AlexStroke
Copy link
Contributor

AlexStroke commented Feb 20, 2023

OS and Environment

MacOS, Docker Hub

GIT commit hash

44ec1a1

Minimum working example / Steps to reproduce

  1. Run a docker-compose with different IROHA_GENESIS_ACCOUNT key pairs for each peer
docker-compose.yml
version: "3.8"
services:
  iroha:
    image: hyperledger/iroha2:dev-nightly-fe826be88d785f83496c781b104abb871fd7a13f
    environment:
      TORII_P2P_ADDR: iroha:1337
      TORII_API_URL: iroha:8080
      TORII_TELEMETRY_URL: iroha:8180
      IROHA_PUBLIC_KEY: "ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"
      IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "282ed9f3cf92811c3818dbc4ae594ed59dc1a2f78e4241e31924e101d6b1fb831c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"}'
      SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha:1337", "public_key": "ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"}, {"address":"iroha1:1338", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "iroha2:1339", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "iroha3:1340", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'
      IROHA_GENESIS_ACCOUNT_PUBLIC_KEY: 'ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b'
      IROHA_GENESIS_ACCOUNT_PRIVATE_KEY: '{ "digest_function": "ed25519", "payload": "282ed9f3cf92811c3818dbc4ae594ed59dc1a2f78e4241e31924e101d6b1fb831c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b" }'
      WSV_WASM_RUNTIME_CONFIG: '{"FUEL_LIMIT":900000000000, "MAX_MEMORY": 524288000}'
    ports:
      - "8080:8080"
      - "8180:8180"
    volumes:
      - './configs/peer:/config'
    command: iroha --submit-genesis

  iroha1:
    image: hyperledger/iroha2:dev-nightly-fe826be88d785f83496c781b104abb871fd7a13f
    environment:
      TORII_P2P_ADDR: iroha1:1338
      TORII_API_URL: iroha1:8081
      TORII_TELEMETRY_URL: iroha1:8181
      IROHA_PUBLIC_KEY: "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"
      IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "3bac34cda9e3763fa069c1198312d1ec73b53023b8180c822ac355435edc4a24cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}'
      SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha:1337", "public_key": "ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"}, {"address":"iroha1:1338", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "iroha2:1339", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "iroha3:1340", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'
      IROHA_GENESIS_ACCOUNT_PUBLIC_KEY: 'ed01203f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255'
      WSV_WASM_RUNTIME_CONFIG: '{"FUEL_LIMIT":900000000000, "MAX_MEMORY": 524288000}'
    ports:
      - "8081:8080"
      - "8181:8180"
    volumes:
      - './configs/peer:/config'

  iroha2:
    image: hyperledger/iroha2:dev-nightly-fe826be88d785f83496c781b104abb871fd7a13f
    environment:
      TORII_P2P_ADDR: iroha2:1339
      TORII_API_URL: iroha2:8082
      TORII_TELEMETRY_URL: iroha2:8182
      IROHA_PUBLIC_KEY: "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"
      IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "1261a436d36779223d7d6cf20e8b644510e488e6a50bafd77a7485264d27197dfaca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}'
      SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha:1337", "public_key": "ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"}, {"address":"iroha1:1338", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "iroha2:1339", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "iroha3:1340", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'
      IROHA_GENESIS_ACCOUNT_PUBLIC_KEY: 'ed01203f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255'
      WSV_WASM_RUNTIME_CONFIG: '{"FUEL_LIMIT":900000000000, "MAX_MEMORY": 524288000}'
    ports:
      - "8082:8080"
      - "8182:8180"
    volumes:
      - './configs/peer:/config'

  iroha3:
    image: hyperledger/iroha2:dev-nightly-fe826be88d785f83496c781b104abb871fd7a13f
    environment:
      TORII_P2P_ADDR: iroha3:1340
      TORII_API_URL: iroha3:8083
      TORII_TELEMETRY_URL: iroha3:8183
      IROHA_PUBLIC_KEY: "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"
      IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "a70dab95c7482eb9f159111b65947e482108cfe67df877bd8d3b9441a781c7c98e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}'
      SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha:1337", "public_key": "ed01201c61faf8fe94e253b93114240394f79a607b7fa55f9e5a41ebec74b88055768b"}, {"address":"iroha1:1338", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "iroha2:1339", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "iroha3:1340", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'
      IROHA_GENESIS_ACCOUNT_PUBLIC_KEY: 'ed01203f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255'
      WSV_WASM_RUNTIME_CONFIG: '{"FUEL_LIMIT":900000000000, "MAX_MEMORY": 524288000}'
    ports:
      - "8083:8080"
      - "8183:8180"
    volumes:
      - './configs/peer:/config'

Actual result

Error and continue working.

iroha-iroha1-1  | 2023-02-20T12:29:44.555645Z ERROR run: iroha_core::sumeragi::main_loop: error=Error during transaction revalidation
iroha-iroha1-1  | 
iroha-iroha1-1  | Caused by:
iroha-iroha1-1  |    0: Failed to validate transaction
iroha-iroha1-1  |    1: Failed to verify signature condition specified in the account: Signature condition not satisfied.
iroha-iroha1-1  |    2: Failed to verify signature condition specified in the account: Signature condition not satisfied.
iroha-iroha1-1  | 
iroha-iroha1-1  | Location:
iroha-iroha1-1  |     core/src/block.rs:633:26

Expected result

Panic and shut down

Who can help to reproduce?

@astrokov7

Notes

If your original leader gives you the incorrect genesis, you can't continue. The network needs to restart with a different topology. If you're bootstrapping it's a different situation, though.

@AlexStroke AlexStroke added Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST labels Feb 20, 2023
@AlexStroke AlexStroke changed the title [BUG] Iroha doesn't panic and shut down if the key pairs for IROHA_GENESIS_ACCOUNT are completely wrong for each peer. [BUG] Iroha doesn't panic and shut down if the key pairs for IROHA_GENESIS_ACCOUNT are completely wrong for each peer. Feb 20, 2023
@AlexStroke AlexStroke added Dev defect The defect was found at the development stage. Did not have an impact on users. QA-confirmed This bug is reproduced and needs a fix labels Feb 20, 2023
@AlexStroke AlexStroke changed the title [BUG] Iroha doesn't panic and shut down if the key pairs for IROHA_GENESIS_ACCOUNT are completely wrong for each peer. [BUG] Iroha doesn't panic and shut down if the key pairs for IROHA_GENESIS_ACCOUNT are completely different for each peer. Feb 21, 2023
@SamHSmith SamHSmith self-assigned this Jun 23, 2023
SamHSmith added a commit to SamHSmith/iroha that referenced this issue Jun 23, 2023
…sis.

Signed-off-by: Sam H. Smith <sam.henning.smith@protonmail.com>
appetrosyan pushed a commit that referenced this issue Jun 23, 2023
Signed-off-by: Sam H. Smith <sam.henning.smith@protonmail.com>
@timofeevmd timofeevmd self-assigned this Jun 26, 2023
mversic pushed a commit that referenced this issue Oct 17, 2023
Signed-off-by: Sam H. Smith <sam.henning.smith@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Dev defect The defect was found at the development stage. Did not have an impact on users. iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix
Projects
None yet
Development

No branches or pull requests

3 participants