-
Notifications
You must be signed in to change notification settings - Fork 108
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
* separate endpoint for beacon state * fix interface * default values for config path
* separate endpoint for beacon state * fix interface * default values for config path
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
andstateEndpoint
config values can point to Lodestar.