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

Add finalized metadata field to API responses #11783

Merged
merged 7 commits into from
Dec 16, 2022

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented Dec 15, 2022

@@ -173,6 +174,7 @@ func (bs *Server) ListBlockHeaders(ctx context.Context, req *ethpbv1.BlockHeader
}

isOptimistic := false
isFinalized := true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We assume finalized and as long as we "are finalized", we update the value inside the loop.

Comment on lines +421 to -458
b1 := util.NewBeaconBlock()
b1.Block.Slot = 30
b1.Block.ParentRoot = bytesutil.PadTo([]byte{1}, 32)
util.SaveBlock(t, ctx, beaconDB, b1)
b2 := util.NewBeaconBlock()
b2.Block.Slot = 30
b2.Block.ParentRoot = bytesutil.PadTo([]byte{1}, 32)
b2.Block.ParentRoot = bytesutil.PadTo([]byte{4}, 32)
util.SaveBlock(t, ctx, beaconDB, b2)
b3 := util.NewBeaconBlock()
b3.Block.Slot = 30
b3.Block.ParentRoot = bytesutil.PadTo([]byte{4}, 32)
b3.Block.Slot = 31
b3.Block.ParentRoot = bytesutil.PadTo([]byte{1}, 32)
util.SaveBlock(t, ctx, beaconDB, b3)
b4 := util.NewBeaconBlock()
b4.Block.Slot = 31
b4.Block.Slot = 28
b4.Block.ParentRoot = bytesutil.PadTo([]byte{1}, 32)
util.SaveBlock(t, ctx, beaconDB, b4)
b5 := util.NewBeaconBlock()
b5.Block.Slot = 28
b5.Block.ParentRoot = bytesutil.PadTo([]byte{1}, 32)
util.SaveBlock(t, ctx, beaconDB, b5)
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 diff is misleading, I simply changed names of b2/b3/b4/b5 to b1/b2/b3/b4.

@rkapka rkapka added Ready For Review A pull request ready for code review API Api related tasks labels Dec 15, 2022
saolyn
saolyn previously approved these changes Dec 15, 2022
Copy link
Contributor

@saolyn saolyn left a comment

Choose a reason for hiding this comment

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

lgtm

rauljordan
rauljordan previously approved these changes Dec 15, 2022
@rkapka rkapka dismissed stale reviews from rauljordan and saolyn via 04f8ead December 15, 2022 23:22
Copy link
Contributor

@saolyn saolyn left a comment

Choose a reason for hiding this comment

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

if tests now pass, lgtm

@prylabs-bulldozer prylabs-bulldozer bot merged commit 8a2c7e4 into develop Dec 16, 2022
@delete-merged-branch delete-merged-branch bot deleted the api-finalized-metadata-part1 branch December 16, 2022 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants