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

custom Debug impl for mix::Node and gateway::Node #3930

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

jstuczyn
Copy link
Contributor

Description

Something that has been bothering me for quite a while. The auto derived Debug for mix::Node and gateway::Node. whenever you wanted to quickly print your node details to stdout you were slammed with detailed curve point information which in 99.99% cases is not what you want. Thus I've changed it to use stringified key details instead.

Long story short for println!("{gateway:#?}") instead of:

'Node {
    owner: "n1k5uwsuewkqhf3s6n5zx9ps2wkdgs9p9fhcdujn",
    host: IpAddr(
        85.159.212.96,
    ),
    mix_host: 85.159.212.96:1789,
    clients_port: 9000,
    identity_key: PublicKey(
        PublicKey(CompressedEdwardsY: [106, 216, 165, 242, 138, 74, 126, 89, 190, 83, 92, 199, 158, 188, 152, 77, 224, 215, 117, 101, 122, 136, 49, 133, 182, 48, 80, 217, 157, 164, 25, 60]), EdwardsPoint{
        	X: FieldElement51([401081558954162, 1119876266921654, 519567740851975, 1272911700607453, 1376462587655230]),
        	Y: FieldElement51([1770810497161322, 1082931082152751, 1644180073243378, 100341588966706, 1057293338514691]),
        	Z: FieldElement51([1, 0, 0, 0, 0]),
        	T: FieldElement51([2240565687814151, 1279965419925540, 1672344571450002, 716923175485544, 446094628035297])
        }),
    ),
    sphinx_key: PublicKey(
        PublicKey(
            MontgomeryPoint(
                [
                    9,
                    62,
                    19,
                    206,
                    161,
                    63,
                    48,
                    94,
                    151,
                    136,
                    110,
                    224,
                    202,
                    91,
                    178,
                    245,
                    142,
                    162,
                    206,
                    14,
                    185,
                    70,
                    163,
                    35,
                    176,
                    109,
                    17,
                    70,
                    218,
                    237,
                    214,
                    66,
                ],
            ),
        ),
    ),
    version: Explicit(
        Version {
            major: 1,
            minor: 1,
            patch: 25,
            pre: [],
            build: [],
        },
    ),
}'

you will now be seeing

'gateway::Node {
    host: IpAddr(
        85.159.212.96,
    ),
    owner: "n1k5uwsuewkqhf3s6n5zx9ps2wkdgs9p9fhcdujn",
    mix_host: 85.159.212.96:1789,
    clients_port: 9000,
    identity_key: "8C5pc2dQyqVj6tksNQpfQs8LCSMzKjh7qUgwbfz3qo15",
    sphinx_key: "d5a7FETkQ6jCWpawEgpzJCT7iVipY3cMaBuut7ji9jP",
    version: Explicit(
        Version {
            major: 1,
            minor: 1,
            patch: 25,
            pre: [],
            build: [],
        },
    ),
}'

@jstuczyn jstuczyn requested a review from octol September 22, 2023 13:13
Copy link
Contributor

@octol octol left a comment

Choose a reason for hiding this comment

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

Slammed is very accurate description :)
And yeah it's been annoying me to so kudos for sorting this out!

@jstuczyn jstuczyn merged commit 56f3515 into develop Sep 22, 2023
16 checks passed
@jstuczyn jstuczyn deleted the feature/improved-node-Debug-impl branch September 22, 2023 13:32
@benedettadavico benedettadavico added this to the Milka milestone Sep 22, 2023
benedettadavico added a commit that referenced this pull request Oct 3, 2023
* fixed ChangeMixCostParams event deserialization (#3871)

* Wireguard listener (#3868)

* wip

* wip

* Most channels are in place

* tidy

* Send data to tunnel

* wip: adding in boringtun

* Handle timers

* Add consume_wg

* Split into mod

* Reorder

* Comments

* Refine channel handling

* Sort out dependency conflict

* Move wireguard listener in gateway beind a feature flag

* updating mixnet contract version to 1.5.1

* removed queued mixnet migration that was already run (#3872)

* Improve error handling in wireguard listener (#3881)

* Github actions: remove nightly builds workflows on latest releases

* updated mixnet contract schema files

* Update Cargo.lock that was missed during release

* fix ci failing builds on clippy errors

* fix background color on account modal

* rename redeem to claim

* add total delegations to rewards summary

* add tooltips

* update lock file

* [feat] Socks5 and Native client: run with hardcoded topology (#3866)

* allow running clients using hardcoded topology

* fixed sdk/lib/socks5-listener build

* fixed nym-connect build

* allow for both snake_case and camelCase deserialization

* fix linting

* initialize FAQ section & move faq -> mixnodes-faq

* initialize faq/smoosh-faq.md page

* gathered community questions & nym team answers

* spell check

* syntax fix

* syntax fix

* Fix all the rust warnings about ignored profile directives

You can't specify profile in the manifest of a crate when it's part of a
workspace. Move the profile directives that cargo complains about to the
top-level workspace Cargo.toml

* Remove default-features where they are ignored anyway

* Use resolver = 2 for contract workspace

* Remove ignored profile directives for contracts

* formatting quotes

* syntax fix

* integrations added to developers/faq section

* fix SUMMARY.md & links

* clarified new smooshed gateway

* steps timing explained & italic removed

* add NymAPI codebase link

* time frame in intro & ETA delete

* removed redundant .faq dir

* Error instead of crash on UDP and BIND not supported

* Deleting faq.md on develop

* Master (#3888)

* removed old wallet address flag again

* Add updates to community list projects

* Update cd-docs.yml

* Update cd-docs.yml

* [hotfix]: don't assign invalid fields when crossing the JS boundary (#3805)

* [hotfix]: don't assign invalid fields when crossing the JS boundary

* eslint

* changelog update and version bump

* changed last vers. checkout to master

* corrected path of config

* make binaries executable

* docs: typescript.md - changing variables

* docs: rust.md - changing variables

* docs: vesting-contract.md - changing variables

* docs: mixnet-contract.md - changing variables

* docs: all variables changed

* operators: all variables finished

* dev-portal: mixnet-integration.md - variable changed

* dev-portal: faq.md - variable changed

* dev-portal: moredo.md up to date w NC default

* dev-portal: telegram.md - added banner & minor fix

* dev-portal: matrix.md - added banner

* PR finished - ready for review and merge

* removed all instances of platform_release_version var

* removed all instances of platform_release_version var

* changed version bumper script: removed platform_release_version references

* changed comment

* updating changelog and bumping versions

* Docs: new post-processing for books so that assets stay relative

This commit has the same content as #3842

* Docs: add prod deploy settings

* fixed ChangeMixCostParams event deserialization (#3873)

* Merge pull request #3892 from nymtech/feature/operators/smoosh-faq

Create smoosh FAQ section & re-organize operators/faq accordingly

* corrected faq dir path

* added integrations-faq page

---------

Co-authored-by: mfahampshire <maxhampshire@pm.me>
Co-authored-by: Lorexia <alexia.lorenza.martinel@protonmail.com>
Co-authored-by: Tommy Verrall <tommy@nymtech.net>
Co-authored-by: Tommy Verrall <60836166+tommyv1987@users.noreply.github.com>
Co-authored-by: Mark Sinclair <14054343+mmsinclair@users.noreply.github.com>
Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
Co-authored-by: serinko <97586125+serinko@users.noreply.github.com>
Co-authored-by: mx <33262279+mfahampshire@users.noreply.github.com>
Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
Co-authored-by: Tommy Verrall <tommyvez@protonmail.com>

* Remove leftover .faq files

* Typescript SDK Nextra Docs (#3880)

* Remove pnpm-lock.yaml

* Add initial documentation

* updating packages and disconnecting on mixFetch when unmount

* handle the mixFetch error

* remove the mixfetch disconexion

* using now rc5 version

* Update overview

* Update installation page

* wip startong

* Copy edits and improving some of the formatting and styling

* Improve naming

* Add CosmosKit example

* Linting

* Update next.js

* Remove lock file

* More CosmosKit docs

* wip

* cleaninig a bit

* quick fix for wallet error

* wip wallet ui

* wip wallet ui

* more wallet ui

* fixing key error

* wip

* Example code

* Add custom style for code blocks to limit their height and scroll

* Change bg on darkmode

* Add styling to darkmode

* Reorg CSS - tbc

* Move example code

* Ledger support in Cosmos Kit - wip

* Change default app to Typescript

* Remove static export

* Tidy up wallet UI

* Set theme colour by hue

* Force dark mode theme

* some wallet ui

* Style buttons sidebar

* Sidebar colors

* Links styling

* Style callouts

* Add styling to button, chips, progress motion component

* Style agenda

* adding loaders

* wallet loaders

* traffic styles

* Fix colours

* Add links to methods

* Add execute code block

* Add traffic codeblock

* Add mixfetch codeblock

* Add Cosmokit codeblock

* Update info on getting started

* fixing build

* Fix build error

* Fix theme

* Fix filenames on examples

* Add copy to CosmosKit example

---------

Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
Co-authored-by: Gala <calero.vg@gmail.com>
Co-authored-by: Lorexia <alexia.lorenza.martinel@protonmail.com>

* Enable loop cover traffic by default in NR

* Tweak comments in template.rs

* Docs: make shell scripts exit on errors so that CI jobs fail on build errors

* fixed broken links

* fixed broken code path

* corrected surbs line

* DOC: smoosh-faq.md - quotation syntax fix

* DOC: smoosh-faq.md - quotation syntax fix

* DOC: smoosh-faq.md - quotation syntax fix

* DOC: smoosh-faq.md - quotation syntax fix

* Remove unused test-and-earn from nym-connect

* Feature/gateway inbuilt nr (#3877)

* changed NymConfigTemplate trait to call 'template' by reference

* network requester lib

* introduced generic parameter to 'MixTrafficController' to allow non-remote gateways

* allowing for custom gateway sender

* types cleanup

* minor gateway cmds refactor + initial NR work

* wip

* running a NR inside gateway

note: this NR isnt tied to the gateway yet

* rebase fixes

* propagating same shutdown handle

* wip

* starting NR with appropriate local transceiver

* fixed premature shutdown

* wiring up PacketRouter

* both ends wired together

* actually working

so much cleanup to do now

* started removing dead code

* wip

* temp: hardcode gateway

* further cleanup

* fixed build of other binaries

* setup-network-requester subcmd

* overriding NR config in gateway init/run

* wip making it wasm-compatible [again]

* refactored 'GatewaySetup'

* clippy and friends

* removed debug code

* rust 1.72 lints

* ensuring local gateway is available + some comments

* correctly putting network requester data in the same underlying details struct

* improved gateway errors

* changed 'network_requester_config' deserialization

* missing clap annotation for 'enabled' flag in 'setup-network-requester' command

* saving config file after 'setup-network-requester'

* removed dead code

* review comments

* make embedded NR wait for gateway to come online (for at most 70min)

* fixed shutdown on successful gateway wait

* updated NR config override

* Update index.tsx

* Update index.tsx

* Revert "Remove unused test-and-earn from nym-connect"

This reverts commit cd3d4ff.

* remove test and earn context provider

* remove test and earn from bundle

* fix linting

* Update wasm_sdk.yml

* Github Actions: enable trigger on nightly workflow

* Mix Fetch RC Release (#3910)

* Bug fix `mixFetch` build

* Batch integration tests for mixFetch

* Bump RC version

* Tidy up READMEs

* Bump version to RC4 and fix up a few interfaces

* Bump version to RC5 and fix opts

* NodeJS SDK

* mixFetch usage example

* Update internal dev tester readme

* Add NodeJS packages to publish script

* Update lock file

* Upgrade `lerna`

---------

Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>

* printing initialised gateway-NR's config path to stderr

* using correct method for converting PathBuf to impl Display

* Add a separate nightly workflow with a trigger

* added forceTls argument to 'MixFetchOptsSimple' (#3907)

* Squashing commits

added forceTls argument to 'MixFetchOptsSimple'

made forceTls flag optional in mix fetch opts

whacking those moles

* GitHub Actions: install node

---------

Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>

* Github Actions: Move nightly to custom-linux

* Initial work on splitting out nym-wallet nightliy build (#3924)

* Github Actions: Move nightly builds on dispatch to custom MacOS runner

* Fix nym-wallet-nightly-build toolchain

* nm-wallet-nightly-build: reenable steps

* nym-wallet-nightly-build: enable notification

* Feature/mixfetch disconnect (#3890)

* js error message

* Ability to explicitly disconnect mixfetch

* removed unused import

* added disconnect method directly to sdk package

* simplifying error throw

Co-authored-by: Mark Sinclair <14054343+mmsinclair@users.noreply.github.com>

* added onunload event listener handler

* Using global instance of mixfetch to disconnect

Co-authored-by: Mark Sinclair <14054343+mmsinclair@users.noreply.github.com>

* Bump RC versions

* MixFetch, move unload handler to creation and check for undefined `window`

* Bump RC version

* Force TLS on mixFetch demo

* Add info about working around mixed content errors for mixFetch

---------

Co-authored-by: Mark Sinclair <14054343+mmsinclair@users.noreply.github.com>
Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>

* Update some CI workflow names (#3926)

* Rename two workflows to fit naming scheme

* ci-build name change

* Rename 3 more workflows to ci- names

* Rename wallet.yml and nym-wallet-nightly-build to reverse naming scheme

* Rename to ci-contracts.yml

* Delete nym-wallet webdriverio workflow

* Update some workflow names

* Reverse naming for a whole bunch of workflows (#3928)

* Github Actions: Move nightly builds to custom runner

* custom Debug impl for mix::Node and gateway::Node (#3930)

* Another round of tidy gh workflows (#3931)

* Remove unused Makefile target

* Split out ci-contracts-upload-binaries

* Remove the contracts from the main workflow

* Rename build-and-upload-binaries-ci

* Rename network-explorer name

* Rename network-explorer filename and check-merge-conflicts

* Rename three more workflows

* Rename sdk-publish

* Remove deprecated clippy-all

* Rename matrix includes json and delete one that is unused

* Typo in filename

* Delete nym-wallet-release.yml

* always using port 443 for tls gateway connection (#3927)

* always using port 443 for tls gateway connection

* bumping up rc version

* hack: additional hardcoded gateways

it disables topology refresh

* Add NPM packages to tool for bumping versions

* Bump RC versions of SDK packages

* Use manual gateway details

* Add progress to `publish.sh` script

* Add docs for WSS workaround

---------

Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>

* Rename the files for release workflows (#3932)

* Add missing toolchain in ci-build-upload-binaries.yml

* update changelog and bump version

---------

Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
Co-authored-by: Jon Häggblad <jon.haggblad@gmail.com>
Co-authored-by: Tommy Verrall <60836166+tommyv1987@users.noreply.github.com>
Co-authored-by: Raphaël Walther <raphael@nymtech.net>
Co-authored-by: Tommy Verrall <tommy@nymtech.net>
Co-authored-by: fmtabbara <fmtabbara@hotmail.co.uk>
Co-authored-by: serinko <97586125+serinko@users.noreply.github.com>
Co-authored-by: mfahampshire <maxhampshire@pm.me>
Co-authored-by: Lorexia <alexia.lorenza.martinel@protonmail.com>
Co-authored-by: Mark Sinclair <14054343+mmsinclair@users.noreply.github.com>
Co-authored-by: mx <33262279+mfahampshire@users.noreply.github.com>
Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
Co-authored-by: Tommy Verrall <tommyvez@protonmail.com>
Co-authored-by: Gala <calero.vg@gmail.com>
Co-authored-by: Jess <31625607+jessgess@users.noreply.github.com>
Co-authored-by: Raphaël Walther <48209673+raphael-walther@users.noreply.github.com>
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.

None yet

3 participants