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

Separate endpoint for beacon state #1191

Merged
merged 3 commits into from
May 8, 2024
Merged

Conversation

claravanstaden
Copy link
Contributor

Configure a separate endpoint for the beacon state download, because Lodestar does not backfill ssz states if the node goes offline for a period longer than the weak subjectivity period. This is problematic because we should be able to get historic states. This enables us to switch to a different consensus node for ssz states, if necessary. If all is well, both the endpoint and stateEndpoint config values can point to Lodestar.

@@ -398,7 +400,7 @@ func (b *BeaconClient) GetLatestFinalizedUpdate() (LatestFinalisedUpdateResponse

func (b *BeaconClient) GetBeaconState(stateIdOrSlot string) ([]byte, error) {
var data []byte
req, err := http.NewRequest("GET", fmt.Sprintf("%s/eth/v2/debug/beacon/states/%s", b.endpoint, stateIdOrSlot), nil)
req, err := http.NewRequest("GET", fmt.Sprintf("%s/eth/v2/debug/beacon/states/%s", b.stateEndpoint, stateIdOrSlot), nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main change.

if err != nil {
return err
}

viper.SetConfigFile("/tmp/snowbridge/beacon-relay.json")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just some cleanup to remove these hardcoded config file paths.

@claravanstaden claravanstaden marked this pull request as ready for review May 6, 2024 18:58
Copy link
Contributor

@yrong yrong left a comment

Choose a reason for hiding this comment

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

+1

@claravanstaden claravanstaden merged commit 4874972 into main May 8, 2024
1 check passed
@claravanstaden claravanstaden deleted the separate-ssz-state-url branch May 8, 2024 14:28
claravanstaden added a commit that referenced this pull request May 9, 2024
* separate endpoint for beacon state

* fix interface

* default values for config path
claravanstaden added a commit that referenced this pull request May 30, 2024
* separate endpoint for beacon state

* fix interface

* default values for config path
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