-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix issue #14986 Tool to add blocks to db #15054
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
base: develop
Are you sure you want to change the base?
Fix issue #14986 Tool to add blocks to db #15054
Conversation
|
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.
Why can't you use SaveBlock?
@@ -1150,3 +1151,59 @@ func (s *Store) deleteValidatorHashes(tx *bolt.Tx, root []byte) error { | |||
|
|||
return nil | |||
} | |||
|
|||
func (s *Store) AddBeaconBlock(ctx context.Context, serBlock []byte) error { |
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.
Please add unit tests
@@ -1150,3 +1151,59 @@ func (s *Store) deleteValidatorHashes(tx *bolt.Tx, root []byte) error { | |||
|
|||
return nil | |||
} | |||
|
|||
func (s *Store) AddBeaconBlock(ctx context.Context, serBlock []byte) error { |
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.
Please add a godoc comment
parentBlk, err := unmarshalBlock(ctx, parentExists) | ||
if err != nil { | ||
return err | ||
} |
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 you need to unmarshal the whole block to get the slot or can we read only that data from the ssz format? cc: @kasey
// Save the block | ||
if err := bkt.Put(blockRoot[:], serBlock); err != nil { | ||
return errors.Wrapf(err, "could not write block to db with root %#x", blockRoot) | ||
} |
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.
What about all of the indices we have on blocks?
Why can't you use SaveBlock?
What type of PR is this?
What does this PR do? Why is it needed?
Tool to add blocks to db
Which issues(s) does this PR fix?
#14986
Fixes #
Other notes for review
Acknowledgements