Skip to content

chore/tn-12#3

Merged
biryukovmaxim merged 12 commits into
aspectron:masterfrom
IzioDev:chore/tn-12
May 6, 2026
Merged

chore/tn-12#3
biryukovmaxim merged 12 commits into
aspectron:masterfrom
IzioDev:chore/tn-12

Conversation

@IzioDev
Copy link
Copy Markdown
Contributor

@IzioDev IzioDev commented Jan 5, 2026

work in pair with: aspectron/kaspa-resolver#5

  • add testnet-12 with config
  • make network either supported or deprecated (testnet-11), only allow deprecated network interactions if it's to disable them
  • once disabled (and systemd service not running), deprecated network are removed from the local khost config file
  • add a small warning at startup to inform the usage of deprecated network

I initially didn't want to mess with deprecated network (mostly because impact is a bit wide), but it seemed wrong to stop systemd service on behalf of user operator

@IzioDev
Copy link
Copy Markdown
Contributor Author

IzioDev commented Feb 9, 2026

New branch name is covpp-reset1

@aspect
Copy link
Copy Markdown
Contributor

aspect commented Feb 9, 2026

@IzioDev why don’t you install VirtualBox with Ubuntu. That would be a proper environment for testing, other than a cheap VM at hetzner.

@aspect
Copy link
Copy Markdown
Contributor

aspect commented Feb 9, 2026

The problem is the branch name. “covpp” is “some branch”. If another branch appears then we will need to 1) republish khost 2) ask everyone to upgrade

vs anyone running khost and it detecting new latest commit hash.

so there needs to be an official “tn12” branch that would be pulled into whenever tn12 is updated.

also kaspa-resolver needs to be updated before that to support tn12.

I saw someone talking about resetting tn12 when sufficient updates come in and thus I think it will be better to hold off. (we do have to ping many ppl to run updates).

@IzioDev

@IzioDev
Copy link
Copy Markdown
Contributor Author

IzioDev commented Feb 9, 2026

The problem is the branch name. “covpp” is “some branch”. If another branch appears then we will need to 1) republish khost 2) ask everyone to upgrade

vs anyone running khost and it detecting new latest commit hash.

so there needs to be an official “tn12” branch that would be pulled into whenever tn12 is updated.

also kaspa-resolver needs to be updated before that to support tn12.

I saw someone talking about resetting tn12 when sufficient updates come in and thus I think it will be better to hold off. (we do have to ping many ppl to run updates).

@IzioDev

There already is a PR on the resolver: aspectron/kaspa-resolver#5

tn-12 just got reset for information, that's why I posted a comment here.

About having a dedicated branch for tn-12, I'll start the discussion.

@demisrael
Copy link
Copy Markdown
Contributor

Thanks for the PR! Built and ran clippy on the branch — both clean. A few findings to flag before merge:

1. Port collision in src/kaspad.rs (likely a typo)

Network::Mainnet   => (16110, 17110, 18110),
Network::Testnet10 => (16210, 17210, 18210),
Network::Testnet12 => (16311, 17210, 18210),

wrpc_borsh and wrpc_json for tn-12 are identical to tn-10's, so kaspad will fail to bind if both networks are enabled at once. The previous tn-11 entry was (16310, 17310, 18310), so (16312, 17312, 18312) looks like the intended pattern. The 16311 grpc port also seems to mix the new "12" with the old "11" suffix.

2. No config migration for existing testnet11 entries

CONFIG_VERSION is still 2, and Config::load() only handles v1→v2 (omega→pnn-v1). Existing users with a config.json containing a "testnet11" kaspad entry will get a serde error on startup, since the variant was renamed (#[serde(rename_all = "lowercase")] makes the JSON tag testnet11testnet12). Bumping to v3 with a migration that rewrites testnet11testnet12 (and flips the origin to covpp for that entry) would keep upgrades smooth.

3. .gitignore adds .khost-data but the code uses .khost

folders.rs defines DATA_FOLDER_NAME = ".khost" (Linux) / 00-khost-dev (other). .khost-data doesn't match either — looks like a stray from local Docker testing.

4. Minor: redundant clone in config.rs

let selected_origin = match network {};
kaspad::Config::new(selected_origin.clone(), network)

The match arms already produce owned Origin values, so the trailing .clone() is unnecessary.


Verified to compile cleanly on:

  • Linux: Ubuntu 24.04 LTS, kernel 6.8.0 x86_64, rustc/cargo 1.95.0
  • macOS: 15.6.1, Darwin 24.6.0 arm64, rustc/cargo 1.81.0

…nore

- src/kaspad.rs: tn-12 wrpc-borsh/json ports collided with tn-10
  (17210/18210). Use (16312, 17312, 18312) following the
  netsuffix-numbered pattern.
- Use the official `tn12` branch on kaspanet/rusty-kaspa (the `covpp`
  branch has been removed). Rename Preset::Covpp -> Preset::Tn12 in
  src/git.rs for consistency.
- src/config.rs: drop redundant `.clone()` on selected_origin (match
  arms already produce owned values).
- .gitignore: remove `.khost-data` — code uses `.khost` /
  `00-khost-dev` per folders.rs.
@IzioDev
Copy link
Copy Markdown
Contributor Author

IzioDev commented May 4, 2026

Thanks for the good review and test @demisrael, on it.

@IzioDev
Copy link
Copy Markdown
Contributor Author

IzioDev commented May 4, 2026

Oh I just saw you impl fixes, thanks! ❤️

IzioDev and others added 3 commits May 4, 2026 14:06
fix tn-12 branch + ports, drop redundant clone, remove .khost-data ignore
* wip

* wip: legacy network handling

* wip

* wip

* wip

* wip

---------

Co-authored-by: IzioDev <9900846+IzioDev@users.noreply.github.com>
Comment thread src/git.rs Outdated
Comment on lines 203 to 205
Preset::PNNv1 => {
Origin::try_new("https://github.com/aspectron/rusty-kaspa", Some("pnn-v1"))?
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt we add master here too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed, rolled back to aspectron origins: roll back origins to aspectron/*

Comment thread src/kaspad.rs Outdated
Comment on lines +91 to +92
Supported(Testnet12) => (16312, 17312, 18312),
Deprecated(Testnet11) => (16311, 17311, 18311),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these correct ports? looks non canonical

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

difficulty is that on kaspad, we use same default ports for tn11 and tn12 (tn11 support has been removed).

khost can have its own independent default ports, they are opaque to clients (because of nginx reverse-proxy).

what ports would you suggest to set here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tn11 can keep 310. tn12 probably 410

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/git.rs Outdated
@biryukovmaxim biryukovmaxim merged commit 9194eb1 into aspectron:master May 6, 2026
3 checks passed
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.

4 participants