Skip to content

Conversation

@gokhan-simsek-iota
Copy link
Contributor

@gokhan-simsek-iota gokhan-simsek-iota commented Jan 13, 2025

⚠️DRAFT⚠️

[Update 24.2.2025]

Description of change

  • Changing primary_address to use TCP instead of UDP
  • Adding ip4/ip6/dns support for the output file validator.info of iota validator make-validator-info cmd. (More info Fix output of iota validator make-validator-info #4437)
  • Accept validators with both TCP and UDP primary_address for a current working network (e.g. we do not want to break current testnet) and enforce TCP (deny UDP) for next epoch primary_addr
  • Enforce TCP for primary_address at genesis
  • Upgrade Validator type

Plan/Todos

Links to any relevant issues

Fixes: #4437 Fix output of iota validator make-validator-info

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How the change has been tested

cargo t -p iota-types validator_with_

These sections to be reconsidered/updated when we do final changes:

  • Check we accept validators with both TCP and UDP primary_address for a current working network (e.g. we do not want to break current testnet) and enforce TCP (deny UDP) for next epoch primary_addr.
    cargo r -p iota -- move test -p crates/iota-framework/packages/iota-system/ test_validator_update_metadata_ok
    cargo r -p iota -- move test -p crates/iota-framework/packages/iota-system/ test_validator_update_metadata_invalid_primary_addr_udp
    cargo r -p iota -- move test -p crates/iota-framework/packages/iota-system/ test_validator_update_metadata_valid_primary_addr_tcp

  • Check we enforce TCP for primary_address at genesis
    This test checks this:
    cargo t -p iota-genesis-builder -- ceremony_with_invalid_primary_address

  • Check validator.info after each time running the cmds below, make sure primary_address uses tcp instead of udp and all addresses use this multiaddr format ip4/ip6/dns correctly depending on the address input of the cmd.

// dns
cargo r -p iota -- validator make-validator-info validator0 description https://iota.org/logo.png https://www.iota.org localhost 1000

// ip4
cargo r -p iota -- validator make-validator-info validator0 description https://iota.org/logo.png https://www.iota.org 127.0.0.1 1000

// ip6
cargo r -p iota -- validator make-validator-info validator0 description https://iota.org/logo.png https://www.iota.org 1000:0ac3:22a2:0000:0000:4b3c:0504:1234 1000

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • (how? we need a local script version of CI checks) I have checked that new and existing unit tests pass locally with my changes

@iota-ci iota-ci added core-protocol node Issues related to the Core Node team labels Jan 13, 2025
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 13, 2025
@vercel
Copy link

vercel bot commented Jan 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Visit Preview Feb 11, 2025 2:48pm
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview 💬 Add feedback Feb 11, 2025 2:48pm
rebased-explorer ⬜️ Ignored (Inspect) Visit Preview Feb 11, 2025 2:48pm
wallet-dashboard ⬜️ Ignored (Inspect) Visit Preview 💬 Add feedback Feb 11, 2025 2:48pm

@muXxer muXxer force-pushed the core-node/fix-make-validator-info-2 branch from d6c17fb to 41c66fc Compare January 14, 2025 18:23
@muXxer muXxer requested a review from a team as a code owner January 14, 2025 18:23
@muXxer muXxer changed the base branch from develop to core-protocol/procotol-version-3 January 14, 2025 18:23
@muXxer muXxer changed the title [DRAFT] fix(node): Fix output of iota validator make-validator-info fix(node): Fix output of iota validator make-validator-info Jan 14, 2025
@muXxer
Copy link
Contributor

muXxer commented Jan 14, 2025

⚠️ WARNING ⚠️
We need to check if the current validators can even start with this change, and if they can update their metadata on chain successfully.

primary_address
.to_anemo_address()
.map_err(|_| E_METADATA_INVALID_PRIMARY_ADDR)?;
if !primary_address.is_loosely_valid_tcp_addr() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess our change will break the network because I think we force the validators to already have TCP metadata?

Copy link
Contributor

Choose a reason for hiding this comment

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

And even the validators can't update in the current version, because it wouldn't be a valid anemo address without UDP 😆

@iotaledger iotaledger deleted a comment from github-actions bot Jan 27, 2025
@iotaledger iotaledger deleted a comment from github-actions bot Jan 27, 2025
@iotaledger iotaledger deleted a comment from github-actions bot Jan 27, 2025
@github-actions

This comment was marked as duplicate.

@gokhan-simsek-iota gokhan-simsek-iota changed the title fix(node): primary_address to use tcp instead of udp fix(node): primary_address to use TCP instead of UDP Jan 28, 2025
@gokhan-simsek-iota
Copy link
Contributor Author

gokhan-simsek-iota commented Jan 28, 2025

This PR will be seen as Protocol config changes, due to our changes at crates/iota-types/src/iota_system_state/iota_system_state_inner_v1.rs,
so we will also have to add something like this:

    if context
    .extensions()
    .get::<ObjectRuntime>()
    .protocol_config
    .enable_next_epoch_primary_address_tcp() {
        if let Result::Err(err_code) = validator_metadata.verify_v2() {
            return Ok(NativeResult::err(cost, err_code));
        }
    } else {
        if let Result::Err(err_code) = validator_metadata.verify_v1() {
            return Ok(NativeResult::err(cost, err_code));
        }
    }

@github-actions
Copy link
Contributor

✅ Vercel Preview Deployment is ready!

View Preview

@gokhan-simsek-iota gokhan-simsek-iota marked this pull request as draft February 4, 2025 07:19
@alexsporn alexsporn force-pushed the core-protocol/procotol-version-4 branch from 67e9904 to d0890a4 Compare February 5, 2025 10:37
@gokhan-simsek-iota gokhan-simsek-iota force-pushed the core-node/fix-make-validator-info-2 branch from bd11739 to 3b22a10 Compare February 11, 2025 14:45
@alexsporn alexsporn deleted the branch core-protocol/procotol-version-4 March 4, 2025 12:16
@alexsporn alexsporn closed this Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-protocol documentation Improvements or additions to documentation node Issues related to the Core Node team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix output of iota validator make-validator-info

7 participants