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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

bohendo
Copy link

@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

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
1 participant