-
Notifications
You must be signed in to change notification settings - Fork 107
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
Beacon state import and list feature #1189
Conversation
func (s *Store) ListBeaconStates() ([]BeaconState, error) { | ||
var response []BeaconState | ||
|
||
query := `SELECT id, attested_slot, finalized_slot, attested_sync_period, finalized_sync_period, attested_state_filename, finalized_state_filename FROM beacon_state ORDER BY attested_slot` | ||
|
||
rows, err := s.db.Query(query) | ||
if err != nil { | ||
return response, fmt.Errorf("no match found") | ||
} |
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.
Do we want to implement a pagination query here?
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.
It is limited to 100 states so I thought it is not necessary yet, but will be cool for the future!
May not be relevant with change in this PR snowbridge/relayer/relays/beacon/store/datastore.go Lines 310 to 320 in 7412461
Do we want to add an unique constraint on |
Good idea! :) 65d9e68 |
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
* beacon state import and list feature * correct description * add unique constraint on finalized_slot * few fixes
* beacon state import and list feature * correct description * add unique constraint on finalized_slot * few fixes
Adds features for:
Needs to be cherry-picked into https://github.com/Snowfork/snowbridge/tree/release-v1.0.0 after merge.