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

Fix incorrect variable syntax Update fetch-blocks.sh #8842

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

famouswizard
Copy link
Contributor

PR Description

In the provided script, there was an issue with the URL used for downloading the state. Specifically, the following line was incorrect:

curl --fail -H 'Accept: application/octet-stream' http://localhost:$PORT/eth/v2/debug/beacon/states/{$START} -o "${OUT}/state.ssz" &

The variable $START was incorrectly enclosed in curly braces {}. In Bash, variable substitution requires the use of ${} (with no additional characters inside the braces), and thus the correct syntax is:

curl --fail -H 'Accept: application/octet-stream' http://localhost:$PORT/eth/v2/debug/beacon/states/${START} -o "${OUT}/state.ssz" &

Importance of the fix:

This fix is critical because the incorrect syntax would prevent the variable $START from being substituted properly within the URL. As a result, the script would fail to download the required state, potentially causing issues with subsequent operations or making the script unreliable. By correcting this syntax, the variable is properly interpolated, ensuring the script functions as intended and that the state is downloaded correctly.

Summary:

  • Fixed the incorrect variable syntax in the state download URL.
  • Ensured correct variable interpolation for Bash compatibility.

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Fix incorrect variable syntax in state download request
@CLAassistant
Copy link

CLAassistant commented Nov 21, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for the contribution, and writeup.

@rolfyone rolfyone merged commit e24934d into Consensys:master Nov 22, 2024
17 checks 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.

3 participants