Skip to content

Reject endpoints that are not http or https - #999

Merged
dmytrotkk merged 1 commit into
developfrom
reject-ws-endpoints
Nov 12, 2026
Merged

dmytrotkk merged 1 commit into
developfrom
reject-ws-endpoints

Conversation

@dmytrotkk

Copy link
Copy Markdown
Member

skale.py 8 (skalenetwork/skale.py#697) supports only http and https endpoints: get_provider raises Wrong endpoint option. Supported endpoint schemes: http/https for any other scheme. skale-admin, transaction-manager and bounty-agent build their web3 provider from the node's endpoint through skale.py, so a ws:// or wss:// ENDPOINT makes them fail with that error. node-cli still accepted such an endpoint, because skale_core declares endpoint as AnyUrl and node-cli had no scheme check: skale node init, update, restore, turn-on and skale passive-node init and update wrote it to node.toml and ran the operation that brings the containers up.

Change

  • validate_and_save_node_settings exits with Endpoint must be an http or https URL (exit code 1) when the endpoint scheme is not http or https, before node.toml is written and before any operation runs. Every command that saves node settings goes through it: the six commands above and the fair commands.
  • tests/utils/settings_test.py checks that ws:// and wss:// endpoints are rejected with this message and leave node.toml unchanged. It fails on develop.

Tested locally

  • Through CliRunner with the mocks the existing tests use, for each of the six commands: a ws:// or wss:// endpoint exits 1 with the message, the operation is not called and node.toml is not written. On develop each of them exits 0, writes the ws/wss endpoint to node.toml and calls the operation. http:// and https:// endpoints exit 0, write node.toml and call the operation, as on develop.
  • On an inited node, a rejected update, turn-on or passive-node update leaves every file under ~/.skale unchanged (CLI logs excluded). save_internal_settings still runs before the check, as on develop, so a rejected init, restore or passive-node init on a fresh host creates internal.toml (the node stays not inited, so init can be run again), and a rejected update --pull-config X writes pull_config_for_schain = "X" to internal.toml.
  • The skale binary, built with scripts/build.sh and run in an Ubuntu 24.04 container: with a wss:// endpoint, skale node update ENV --yes --unsafe and skale node turn-on ENV --yes on an inited node exit 1 with the message and change no file under ~/.skale (CLI logs excluded); skale node init ENV and skale passive-node init ENV on a fresh host exit 1 with the message and do not create node.toml.
  • validate_and_save_node_settings with NodeType.FAIR, active and passive, rejects ws:// and wss:// the same way and accepts http:// and https://.
  • The steps of the Test workflow, in containers: ruff check passes; the skale and fair binaries build and print the usage; the nftables tests pass (45); the test suite passes (291), run as a non-root user in the docker group against a private Docker daemon.

Release notes: node-cli rejects an ENDPOINT that is not http or https, such as ws:// or wss://. Nodes with a WebSocket ETH endpoint must switch to an http or https endpoint before updating, since skale.py 8 no longer supports WebSocket endpoints.

Part of skalenetwork/skale-node#891

@dmytrotkk dmytrotkk self-assigned this Nov 11, 2026
@dmytrotkk
dmytrotkk merged commit 2744364 into develop Nov 12, 2026
3 checks passed
@dmytrotkk
dmytrotkk deleted the reject-ws-endpoints branch November 12, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants