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

Coracle fails in scenarios where nodes aren't explicitly activated/deactivated #62

Open
niniack opened this issue Mar 17, 2021 · 0 comments
Assignees
Labels
bug Something isn't working software

Comments

@niniack
Copy link
Member

niniack commented Mar 17, 2021

Problem

sim_config.py uses node IDs generated by network_generator.py. However, since the mesh network generation is probabilistic, not the exact number of nodes are generated in the network.

So, if we want a mesh network of 5 nodes, we may actually end up with a list of node IDs in the network such as:

"nodes": [
            {
                "type": "server",
                "id": 1
            },
            {
                "type": "server",
                "id": 4
            },
            {
                "type": "server",
                "id": 5
            },
        ]

instead of

"nodes": [
            {
                "type": "server",
                "id": 1
            },
            {
                "type": "server",
                "id": 2
            },
            {
                "type": "server",
                "id": 3
            },
            {
                "type": "server",
                "id": 4
            },
            {
                "type": "server",
                "id": 5
            },
        ],

As a result, the events section will look like:

"nodes": [
                    {
                        "id": 1,
                        "active": true
                    },
                    {
                        "id": 4,
                        "active": true
                    },
                    {
                        "id": 5,
                        "active": true
                    }
                ]

but Coracle hates that and crashes when it comes across something like that. Turns out Coracle expects node IDs to be sequential and consecutive...

Potential Solutions

  1. Overwrite the node IDs so that it looks like:
"nodes": [
            {
                "type": "server",
                "id": 1
            },
            {
                "type": "server",
                "id": 2
            },
            {
                "type": "server",
                "id": 3
            },
        ]
  1. Fill in the missing nodes in the events section so that
"nodes": [
                    {
                        "id": 1,
                        "active": true
                    },
                    {
                        "id": 2,
                        "active": false
                    },
                    {
                        "id": 3,
                        "active": false
                    },
                    {
                        "id": 4,
                        "active": true
                    },
                    {
                        "id": 5,
                        "active": true
                ]
@niniack niniack added bug Something isn't working software labels Mar 17, 2021
@niniack niniack self-assigned this Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working software
Projects
None yet
Development

No branches or pull requests

1 participant