dojo icon indicating copy to clipboard operation
dojo copied to clipboard

[BUG] torii panic on start

Open zsluedem opened this issue 1 year ago • 2 comments

Describe the bug A clear and concise description of what the bug is. When I start torri it should panic

2024-05-06T01:02:39.837458Z  INFO torii::relay::server: Relay peer id. peer_id=12D3KooWBnHbK76yzpCUFfFeAuAWiqUyxWtxQGJgbiiKP2x1DZoc
2024-05-06T01:02:39.843185Z  INFO libp2p_swarm: local_peer_id=12D3KooWBnHbK76yzpCUFfFeAuAWiqUyxWtxQGJgbiiKP2x1DZoc
2024-05-06T01:02:39.846104Z  INFO torii::cli: Starting torii endpoint. endpoint=http://0.0.0.0:8080
2024-05-06T01:02:39.846117Z  INFO torii::cli: Serving Graphql playground. endpoint=http://0.0.0.0:8080/graphql
2024-05-06T01:02:39.846122Z  INFO torii::cli: Serving World Explorer. url=https://worlds.dev/torii?url=http%3A%2F%2Flocalhost%3A8080%2Fgraphql
2024-05-06T01:02:39.848297Z  INFO torii::relay::server: New listen address. address=/ip4/127.0.0.1/tcp/9090
2024-05-06T01:02:39.848325Z  INFO torii::relay::server: New listen address. address=/ip4/192.168.1.88/tcp/9090
2024-05-06T01:02:39.848336Z  INFO torii::relay::server: New listen address. address=/ip4/172.17.0.1/tcp/9090
2024-05-06T01:02:39.848399Z  INFO torii::relay::server: New listen address. address=/ip4/127.0.0.1/udp/9090/quic-v1
2024-05-06T01:02:39.848414Z  INFO torii::relay::server: New listen address. address=/ip4/192.168.1.88/udp/9090/quic-v1
2024-05-06T01:02:39.848423Z  INFO torii::relay::server: New listen address. address=/ip4/172.17.0.1/udp/9090/quic-v1
2024-05-06T01:02:39.848717Z  INFO torii::relay::server: New listen address. address=/ip4/127.0.0.1/udp/9091/webrtc-direct/certhash/uEiC5fd_5O9EPhBNqaCn5cPD6lQHtWFzXb5vWDAN7AoqQ7g
2024-05-06T01:02:39.848739Z  INFO torii::relay::server: New listen address. address=/ip4/192.168.1.88/udp/9091/webrtc-direct/certhash/uEiC5fd_5O9EPhBNqaCn5cPD6lQHtWFzXb5vWDAN7AoqQ7g
2024-05-06T01:02:39.848751Z  INFO torii::relay::server: New listen address. address=/ip4/172.17.0.1/udp/9091/webrtc-direct/certhash/uEiC5fd_5O9EPhBNqaCn5cPD6lQHtWFzXb5vWDAN7AoqQ7g
2024-05-06T01:02:39.857466Z  INFO tori_core::engine: Processed block. block_number=3
2024-05-06T01:02:39.859199Z  INFO tori_core::engine: Processed block. block_number=39
2024-05-06T01:02:39.875434Z  INFO torii_core::processors::register_model: Registered model. name=SpawnStatus
2024-05-06T01:02:39.884844Z  INFO torii_core::processors::register_model: Registered model. name=Barn
2024-05-06T01:02:39.895394Z  INFO torii_core::processors::register_model: Registered model. name=BarnStorage
2024-05-06T01:02:39.901754Z  INFO torii_core::processors::register_model: Registered model. name=Barrack
2024-05-06T01:02:39.906637Z  INFO torii_core::processors::register_model: Registered model. name=BarrackUnderTraining
2024-05-06T01:02:39.911644Z  INFO torii_core::processors::register_model: Registered model. name=BarrackWaitingToTrain
2024-05-06T01:02:39.922614Z  INFO torii_core::processors::register_model: Registered model. name=Troops
2024-05-06T01:02:39.933563Z  INFO torii_core::processors::register_model: Registered model. name=AmbushInfo
2024-05-06T01:02:39.939486Z  INFO torii_core::processors::register_model: Registered model. name=CityBuilding
2024-05-06T01:02:39.944639Z  INFO torii_core::processors::register_model: Registered model. name=CityHall
2024-05-06T01:02:39.950255Z  INFO torii_core::processors::register_model: Registered model. name=UnderUpgrading
2024-05-06T01:02:39.955976Z  INFO torii_core::processors::register_model: Registered model. name=WaitingToUpgrade
2024-05-06T01:02:39.961578Z  INFO torii_core::processors::register_model: Registered model. name=CityWall
2024-05-06T01:02:39.967955Z  INFO torii_core::processors::register_model: Registered model. name=College
2024-05-06T01:02:39.973326Z  INFO torii_core::processors::register_model: Registered model. name=Config
2024-05-06T01:02:39.978423Z  INFO torii_core::processors::register_model: Registered model. name=Embassy
thread 'main' panicked at crates/dojo-types/src/packing.rs:190:24:
index out of bounds: the len is 1 but the index is 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/Mississippi-Labs/kingdom_and_lord
  2. start katana
  3. sozo migrate apply
  4. start torri

Expected behavior A clear and concise description of what you expected to happen.

It should work.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

zsluedem avatar May 06 '24 01:05 zsluedem

sozo model schema GlobeLocation --world 0x533fd2059bab1c37eef74dfb76b5ca8e4c7ddcfdfa84229c77eb060b9633ace is an easier way to reproduce.

It seems dojo doesn't have good support for enum with value

zsluedem avatar May 06 '24 03:05 zsluedem

#[derive(Introspect, Copy, Drop, Serde, PartialEq)]
enum LocationKind{
    Nothing: ContractAddress,
    Village: ContractAddress,
    Army: ContractAddress,
    Block: ContractAddress,
}

something wrong with this kind of enum

zsluedem avatar May 06 '24 04:05 zsluedem

We should now support complex enums with the new layout work I've been pushing for torii. Closing this.

Larkooo avatar May 28 '24 19:05 Larkooo