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

Can not work for AccountId20 network #1826

Closed
AurevoirXavier opened this issue Jun 26, 2024 · 13 comments
Closed

Can not work for AccountId20 network #1826

AurevoirXavier opened this issue Jun 26, 2024 · 13 comments
Assignees
Labels
Maintenance V1 maintenance question Further information is requested

Comments

@AurevoirXavier
Copy link

Issue Description

Our session module's key should be AccountId. But it injects some AccountId32 into it.

Auto generated:

"session": {
  "keys": [
    [
      "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
      "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
      {
        "grandpa": "5DaSuaLL4oLxWGR4c1GsvNgSaUuJWw5Pg7DRna5nU2TuNQhp",
        "babe": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "im_online": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "parachain_validator": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "authority_discovery": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "para_validator": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "para_assignment": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "beefy": "KW4wR5T7oX9fZgPyLsMaNyeLZ4HaC8b1iZtuDwQXNjEHYye1x",
        "aura": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "nimbus": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "vrf": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "mixnet": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "bcsv": "5DtWrR3CkMhwy5QEnmHqqMKBqSC7fcfnvT8jUykwFoh2seic",
        "ftsv": "5DaSuaLL4oLxWGR4c1GsvNgSaUuJWw5Pg7DRna5nU2TuNQhp"
      }
    ]
  ]
}

Expected:

"session": {
  "keys": [
    [
      "0x0eef9fabb6eb6fed2ab24a842931f8950426070a",
      "0x0eef9fabb6eb6fed2ab24a842931f8950426070a",
      {
        "aura": "5HTq3xdxVEG3CL68QYaUN72LJakLyRLDiGJXJEAJVxQ7m89c"
      }
    ],
    [
      "0xa858cde8f6cf178786578a3b0becf5c27d18300c",
      "0xa858cde8f6cf178786578a3b0becf5c27d18300c",
      {
        "aura": "5CyMRgKPspo6y357ErtbTz8ZbBkqQ26MXYxCMKZdHeXAWES3"
      }
    ],
    [
      "0x986b41d07776aa48f6d7a80caad49485f9a71714",
      "0x986b41d07776aa48f6d7a80caad49485f9a71714",
      {
        "aura": "5HBWTiQEtz86oPDwWjhTkxWjNDxW8RjZ1WPhWboK8rUWskJm"
      }
    ]
  ]
}

Steps to reproduce the issue

gh repo clone darwinia-network/darwinia
cd darwinia
zombienet-macos-arm64 spawn .maintain/zombienet.toml

Describe the results you received

Error:      Error: Command failed with exit code 1: bash -c tmp/darwinia build-spec --chain /var/folders/8h/_dnjtg3j5jz6bgp1bl5bqzbw0000gn/T/zombie-af881b4658db7afbdef7f5725f328918_-54307-wK8Xq5dmN0G7/koi-genesis-2105-rococo-local-plain.json --disable-default-bootnode  --raw > /var/folders/8h/_dnjtg3j5jz6bgp1bl5bqzbw0000gn/T/zombie-af881b4658db7afbdef7f5725f328918_-54307-wK8Xq5dmN0G7/koi-genesis-2105-rococo-local-raw.json
2024-06-26 17:23:47 Building chain spec    
Error: Service(Other("Invalid JSON blob: invalid length 48, expected a (both 0x-prefixed or not) hex string or byte array containing 20 bytes at line 1 column 3955"))

Describe the results you expected

Run

Zombienet version

Any

Provider

Native

Provider version

## For binaries
Any

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

No response

Screenshots

No response

@AurevoirXavier
Copy link
Author

Is possible to not overwrite this file, and I can insert the keys manually through RPC.

@zianksm
Copy link

zianksm commented Jul 4, 2024

Yeah, im also having the same issues

@pepoviola
Copy link
Collaborator

pepoviola commented Jul 4, 2024

Hi @AurevoirXavier / @zianksm, thanks for the feedback. I think this could be solved in #1816, since this introduce a new config key force_decorator (for parachain) and you can set the decorator to generic-evm (that use eth address for session).
Can you try and ping me if doesn't works as expected?
Thanks!!


Note: This require to be documented (@pepoviola)

@pepoviola pepoviola added the question Further information is requested label Jul 4, 2024
@AurevoirXavier
Copy link
Author

AurevoirXavier commented Jul 4, 2024

After adding force_decorator = "generic-evm" I got:

substrate/frame/session/src/lib.rs:481:52:
Validator in session 1 missing keys! 

Let me check if there's any wrong on my side.

This is the newly generated spec by zombienet:

"session": {
  "keys": [
    [
      "0x7827Ef352169BAAeD812017abA7A7b5A4d8a1Ac9",
      "0x7827Ef352169BAAeD812017abA7A7b5A4d8a1Ac9",
      {
        "aura": "5HmhBLnseHNCLp2K7ANUS3g95zW7PLvLPLhh43iE4QenBRAv"
      }
    ]
  ]
},

But, originally I expected there are 3 collators.

@pepoviola
Copy link
Collaborator

Thanks for the feedback @AurevoirXavier, can you send me the network definition file (toml/json) to reproduce it on my end?
Thanks!

@AurevoirXavier
Copy link
Author

Is there a way to specify the session keys myself? We have our own staking(collator election) logic. Even this get fixed, the generated one wont work for us I think.

@AurevoirXavier
Copy link
Author

Thanks for the feedback @AurevoirXavier, can you send me the network definition file (toml/json) to reproduce it on my end? Thanks!

https://github.com/darwinia-network/darwinia/blob/main/.maintain/zombienet.toml

@pepoviola
Copy link
Collaborator

Hi @AurevoirXavier, sorry about the delay. I checked the toml and is defining multiple parachains block. Can you try with this network definition

[settings]
provider = "native"

[relaychain]
chain           = "rococo-local"
default_args    = ["--database=paritydb", "-lparachain=debug"]
default_command = "tmp/polkadot"

[[relaychain.nodes]]
name      = "alice"
validator = true
[[relaychain.nodes]]
name      = "bob"
validator = true

[[parachains]]
chain           = "koi-genesis"
force_decorator = "generic-evm"
id              = 2105
    [[parachains.collators]]
    args     = ["--database=paritydb", "--force-authoring", "-lparachain=debug"]
    command  = "tmp/darwinia"
    name     = "C1"
    rpc_port = 10000
    [[parachains.collators]]
    args     = ["--database=paritydb", "--force-authoring", "-lparachain=debug"]
    command  = "tmp/darwinia"
    name     = "C2"
    rpc_port = 10001
    [[parachains.collators]]
    args     = ["--database=paritydb", "--force-authoring", "-lparachain=debug"]
    command  = "tmp/darwinia"
    name     = "C3"
    rpc_port = 10002

Should works as expected, with 3 collators (and the keys in the session).

Thanks!! and again sorry about the delay.

@AlexD10S
Copy link

I encountered the same error using the Zombienet-SDK.

🚫 Could not launch local network: Orchestrator error: Provider error: File generation failed: 2024-08-16 17:09:39 Building chain spec    
Error: Service(Other("Invalid JSON blob: invalid length 48, expected a (both 0x-prefixed or not) hex string or byte array containing 20 bytes at line 1 column 1254"))

Does it require any additional configuration or specifications?

@pepoviola
Copy link
Collaborator

Hey @AlexD10S, does your parachain is evm based? Can you add this config to it

force_decorator = "generic-evm"

With this config should works in v1.

Thanks!

@ical10
Copy link

ical10 commented Sep 19, 2024

I'm also getting similar error:

2024-09-19 09:31:57 Building chain spec
Error: Service(Other("Invalid JSON blob: invalid length 48, expected a (both 0x-prefixed or not) hex string with length of 40 at line 38 column 56 for blob:...

Even with the force_decorator set to "generic-evm".

Here is my config file:

[settings]
timeout = 1000
force_decorator = "generic-evm"

[relaychain]
default_command = "./binaries/polkadot"
chain = "rococo-local"
chain_spec_path = "./plain.json"

[[relaychain.nodes]]
name = "alice"
validator = true

[[relaychain.nodes]]
name = "bob"
validator = true

[[parachains]]
id = 2000
chain_spec_path = "../res/niskala/live/live.json"

[[parachains.collators]]
name = "mandala-collator-1"
command = "./binaries/mandala"

[[parachains.collators]]
name = "mandala-collator-2"
command = "./binaries/mandala"

Any pointers?

@pepoviola pepoviola self-assigned this Sep 23, 2024
@pepoviola pepoviola added the Maintenance V1 maintenance label Sep 23, 2024
@pepoviola
Copy link
Collaborator

Hi @ical10,
The key force_decarator should be al parachain level, can you try with this:

[settings]
timeout = 1000


[relaychain]
default_command = "./binaries/polkadot"
chain = "rococo-local"
chain_spec_path = "./plain.json"

[[relaychain.nodes]]
name = "alice"
validator = true

[[relaychain.nodes]]
name = "bob"
validator = true

[[parachains]]
id = 2000
force_decorator = "generic-evm"
chain_spec_path = "../res/niskala/live/live.json"

[[parachains.collators]]
name = "mandala-collator-1"
command = "./binaries/mandala"

[[parachains.collators]]
name = "mandala-collator-2"
command = "./binaries/mandala"

Closing now, please re-open if doesn't works and we can debug it.
Thanks!!

@AurevoirXavier
Copy link
Author

AurevoirXavier commented Oct 14, 2024

Hi @AurevoirXavier, sorry about the delay. I checked the toml and is defining multiple parachains block. Can you try with this network definition

[settings]
provider = "native"

[relaychain]
chain           = "rococo-local"
default_args    = ["--database=paritydb", "-lparachain=debug"]
default_command = "tmp/polkadot"

[[relaychain.nodes]]
name      = "alice"
validator = true
[[relaychain.nodes]]
name      = "bob"
validator = true

[[parachains]]
chain           = "koi-genesis"
force_decorator = "generic-evm"
id              = 2105
    [[parachains.collators]]
    args     = ["--database=paritydb", "--force-authoring", "-lparachain=debug"]
    command  = "tmp/darwinia"
    name     = "C1"
    rpc_port = 10000
    [[parachains.collators]]
    args     = ["--database=paritydb", "--force-authoring", "-lparachain=debug"]
    command  = "tmp/darwinia"
    name     = "C2"
    rpc_port = 10001
    [[parachains.collators]]
    args     = ["--database=paritydb", "--force-authoring", "-lparachain=debug"]
    command  = "tmp/darwinia"
    name     = "C3"
    rpc_port = 10002

Should works as expected, with 3 collators (and the keys in the session).

Thanks!! and again sorry about the delay.

Validator in session 1 missing keys!    
Error: Service(Other("wasm call error Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:
error while executing at wasm backtrace:
    0: 0x5b2553 - <unknown>!rust_begin_unwind\n    1: 0x1ab65 - <unknown>!core::panicking::panic_fmt::h6522c6a1bf300b70
    2: 0x20f33 - <unknown>!core::option::expect_failed::h866db090481afd08
    3: 0x3a14c7 - <unknown>!<core::iter::adapters::cloned::Cloned<I> as core::iter::traits::iterator::Iterator>::fold::h5c196ac8f322ee4d
    4: 0x352cbf - <unknown>!<pallet_session::pallet::GenesisConfig<T> as frame_support::traits::hooks::BuildGenesisConfig>::build::h398e598e30bdaf43
    5: 0x37388c - <unknown>!<koi_runtime::RuntimeGenesisConfig as frame_support::traits::hooks::BuildGenesisConfig>::build::h224083950b35ad28
    6: 0x12e07f - <unknown>!frame_support::genesis_builder_helper::build_config::h9a64c05432ee768d
    7: 0x129bc6 - <unknown>!GenesisBuilder_build_config"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance V1 maintenance question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants