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't specify protocols for a network with a known network id #4136

Open
davidyuk opened this issue May 21, 2023 · 2 comments
Open

Can't specify protocols for a network with a known network id #4136

davidyuk opened this issue May 21, 2023 · 2 comments
Labels
need/triage New issues which need to be categorized

Comments

@davidyuk
Copy link
Member

---
peers: []

http:
  external:
    port: 3013

chain:
  hard_forks:
    "1": 0
    "6": 1

fork_management:
  network_id: "ae_test"

this config file specifies protocols

$ curl http://localhost:3013/v3/status | jq .
{
  "difficulty": 16777216,
  "genesis_key_block_hash": "kh_u67eeSHhKif1kxSyPSz1kwFQuBsYk1Q4ctoLENewGRh5zCY1o",
  "listening": true,
  "network_id": "ae_test",
  "node_revision": "a42c1b1e84dabdad350005213a2a9334113a6832",
  "node_version": "6.8.1",
  "peer_connections": {
    "inbound": 0,
    "outbound": 0
  },
  "peer_count": 0,
  "peer_pubkey": "pp_w6kXkyM856A2Abk6eRuM51smJGYHt2SZHr6Tm3crCEaiKFnZX",
  "pending_transactions_count": 0,
  "protocols": [
    {
      "effective_at_height": 1,
      "version": 6
    },
    {
      "effective_at_height": 0,
      "version": 1
    }
  ],
  "solutions": 0,
  "sync_progress": 100.0,
  "syncing": false,
  "top_block_height": 0,
  "top_key_block_hash": "kh_u67eeSHhKif1kxSyPSz1kwFQuBsYk1Q4ctoLENewGRh5zCY1o"
}

but the defined protocols get rejected if I replace ae_test with ae_uat

$ curl http://localhost:3013/v3/status | jq .
{
  "difficulty": 16777216,
  "genesis_key_block_hash": "kh_wUCideEB8aDtUaiHCtKcfywU6oHZW6gnyci8Mw6S1RSTCnCRu",
  "listening": true,
  "network_id": "ae_uat",
  "node_revision": "a42c1b1e84dabdad350005213a2a9334113a6832",
  "node_version": "6.8.1",
  "peer_connections": {
    "inbound": 0,
    "outbound": 0
  },
  "peer_count": 4,
  "peer_pubkey": "pp_24EpfgZtVbhdzABMXQ4ur3PiRGicBzuooiLj12LS3iwTjXayLj",
  "pending_transactions_count": 0,
  "protocols": [
    {
      "effective_at_height": 425900,
      "version": 5
    },
    {
      "effective_at_height": 154300,
      "version": 4
    },
    {
      "effective_at_height": 82900,
      "version": 3
    },
    {
      "effective_at_height": 40900,
      "version": 2
    },
    {
      "effective_at_height": 0,
      "version": 1
    }
  ],
  "solutions": 0,
  "sync_progress": 100,
  "syncing": false,
  "top_block_height": 0,
  "top_key_block_hash": "kh_wUCideEB8aDtUaiHCtKcfywU6oHZW6gnyci8Mw6S1RSTCnCRu"
}

I need to provide one of ae_mainnet or ae_uat to fool the middleware since it works only with these network ids. But this would be useless if I had to stick to the first protocol. In general, custom protocols for known networks can be useful for testing purposes.

@dincho
Copy link
Member

dincho commented Jun 2, 2023

This sounds like mdw problem, allowing overwriting protocols for "official" (hardcoded) networks sound like asking for troubles to me.

@dincho
Copy link
Member

dincho commented Jun 2, 2023

This, however might suggest the node needs a bit more of config validation that fails with error when trying to overwrite hardcoded network parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage New issues which need to be categorized
Projects
None yet
Development

No branches or pull requests

2 participants