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

feat(nodeconfig)!: Default to Bech32 format for IOTA key pairs #4826

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

Alex6323
Copy link
Contributor

@Alex6323 Alex6323 commented Jan 16, 2025

Description of change

Changes the custom serialization/deserialization methods to default to Bech32. Serializes always to Bech32, but tries to deserialize from Bech32 first and if that fails, attempts to deserialize from Base64.

Links to any relevant issues

fixes #3985

How the change has been tested

I checked through a separate python script that the swapped strings (Base32/Base64) in the .snap file actually represent the same private keys.

Copy link

vercel bot commented Jan 16, 2025

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

Name Status Preview Comments Updated (UTC)
apps-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2025 5:28pm
apps-ui-kit ✅ Ready (Inspect) Visit Preview Jan 31, 2025 5:28pm
rebased-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2025 5:28pm
wallet-dashboard ✅ Ready (Inspect) Visit Preview Jan 31, 2025 5:28pm

@iota-ci iota-ci added dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group. labels Jan 16, 2025
@Alex6323 Alex6323 requested a review from a team as a code owner January 23, 2025 17:09
Co-authored-by: DaughterOfMars <[email protected]>
@Alex6323
Copy link
Contributor Author

Still don't like the module solution tbh, because serde_as is so much simpler with in Arc etc wrapped types. Don't you think, or is there a simpler way @DaughterOfMars ?

Copy link
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

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

network_config_snapshot_matches is failing

Co-authored-by: Thoralf-M <[email protected]>
@@ -6,11 +6,11 @@ validator_configs:
- authority-key-pair:
value: VTDx4HjVmRBqdqBWg2zN+zcFE20io3CrBchGy/iV1lo=
protocol-key-pair:
value: AH7M/Ot6iUd/Jj47r5aGmQROL24mxT4K8EF1Gvjhk0zT
value: iotaprivkey1qplvel8t02y5wlex8ca6l95xnyzyutmwymznuzhsg963478pjdxdxvys9a8
Copy link
Member

Choose a reason for hiding this comment

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

Wondering, was the test failing because we create a config to compare to this one? Because if we read this snapshot, base64 should still work?

Copy link
Contributor Author

@Alex6323 Alex6323 Jan 29, 2025

Choose a reason for hiding this comment

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

As far as I understand snapshot based testing, it uses line by line string comparisons (i.e. line-by-line diffs). So the test was failing, because the old snapshot https://github.com/iotaledger/iota/blob/develop/crates/iota-swarm-config/tests/snapshots/snapshot_tests__network_config_snapshot_matches.snap
diffed from the new one because it was generated with the Base64 keypair format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thibault-martinez Can we resolve?

@Thoralf-M Thoralf-M changed the title refactor(nodeconfig): Default to Bech32 format for IOTA key pairs feat(nodeconfig)!: Default to Bech32 format for IOTA key pairs Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[nodeconfig] Switch to bech32 private keys in node configuration
6 participants