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

compare fork version hex strings #711

Merged
merged 1 commit into from
Jan 24, 2025
Merged

compare fork version hex strings #711

merged 1 commit into from
Jan 24, 2025

Conversation

bohendo
Copy link
Contributor

@bohendo bohendo commented Oct 8, 2024

resolves #638
Improves the poor error discussed here and here but does not fully resolve these issues' underlying problem.

The deposit CLI tool assigns a value of eg "01017000" to a deposit file's fork_version. It's a hex string, no leading "0x", cool.

The staking-launchpad uses an env var such as 0x01017000, strips the leading "0x" and loads it into a buffer as hex data. Cool.

But then, it compares the value from our deposit file to this buffer cast to a string. toString() defaults to an ascii string instead of a hex string. Not cool.

Ultimately, we're comparing "��p�" to "01017000", which will cause the launchpad to declare "the network isn't right" when there's actually something else wrong with the deposit file.

Fix is very simple: call toString('hex') instead.

Copy link

netlify bot commented Oct 8, 2024

👷 Deploy request for dapper-rolypoly-9814ad pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 0743e6f

Copy link
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

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

Lgtm!.. just doing some console logging when I drop a defective deposit data json, I get:

image

The toHex being your solution, and toString being what it was. Thanks @bohendo! Pulling in

@wackerow wackerow merged commit 7d79e64 into ethereum:dev Jan 24, 2025
1 check 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.

Bad error message when deposit_data.json is corrupted
2 participants