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

Replace default fmt::Display on core::Hash #2325

Merged
merged 7 commits into from
Jan 10, 2019

Conversation

eupn
Copy link
Contributor

@eupn eupn commented Jan 10, 2019

Resolves #2314

Visually:
image

?r @antiochp

src/bin/tui/mining.rs Outdated Show resolved Hide resolved
Copy link
Member

@antiochp antiochp left a comment

Choose a reason for hiding this comment

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

We show block hashes in multiple places in the TUI.
It would be nice if we could do this in once and reuse it everywhere as necessary.

@antiochp
Copy link
Member

Actually I suspect this goes beyond the tui and we should scope this to include the api and the logs and everywhere else we see a block hash displayed.

@eupn
Copy link
Contributor Author

eupn commented Jan 10, 2019

So basically change the implementation of fmt::Display for core::Hash.

My proposal is to use .to_hex() and show some number of characters from the beginning and ending of a hash.

@antiochp Is showing hash like this is good enough?

@eupn eupn changed the title [TUI] Show more characters of a block hash [WIP] Replace .to_string() on Hash instances with .show() which reveals more data Jan 10, 2019
@eupn eupn changed the title [WIP] Replace .to_string() on Hash instances with .show() which reveals more data [WIP] Replace default fmt::Display on core::Hash Jan 10, 2019
Copy link
Member

@antiochp antiochp left a comment

Choose a reason for hiding this comment

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

One small change but looks good to me.
👍

Can you post a screenshot of the tui here so we can see how it looks visually?

core/src/core/hash.rs Outdated Show resolved Hide resolved
@eupn eupn changed the title [WIP] Replace default fmt::Display on core::Hash Replace default fmt::Display on core::Hash Jan 10, 2019
@ignopeverell ignopeverell merged commit 27b4e21 into mimblewimble:master Jan 10, 2019
@eupn eupn deleted the tui-hash-widening branch January 10, 2019 21:09
@garyyu
Copy link
Contributor

garyyu commented Jan 12, 2019

Just a note here, this cause state sync always fail if connect to old version nodes, we didn't realize this PR will change the txhashset name, and it caused the old version (all before 11th Jan. 2019, including 0.5.1) in-compatible with 0.5.2 (and after).

In old version, the file name is like:

pmmr_leaf.bin.04199c70

In new version, the file name becomes:

pmmr_leaf.bin.04199c70d1ad...

Do remind users to upgrade nodes to latest version if anyone report this problem. Or try restarting multiple times to download state from a new version node.

There's no problem in mainnet, since all nodes will use new version.

@DavidBurkett
Copy link
Contributor

The filename ends in ...?? This is terrible. Windows doesn't support filenames ending with a .. Can we please revert this change?

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.

5 participants