-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
@@ -173,6 +174,7 @@ func (bs *Server) ListBlockHeaders(ctx context.Context, req *ethpbv1.BlockHeader | |||
} | |||
|
|||
isOptimistic := false | |||
isFinalized := true |
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.
We assume finalized and as long as we "are finalized", we update the value inside the loop.
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) |
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 diff is misleading, I simply changed names of b2/b3/b4/b5
to b1/b2/b3/b4
.
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.
lgtm
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.
if tests now pass, lgtm
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Implements ethereum/beacon-APIs#254 for the following endpoints:
It also simplifies some tests as they had unnecessary setup.
Which issues(s) does this PR fix?
Part of #11747