-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix(consensus, blockchain): set execution payload timestamp based on CometBFT timestamp #2095
Merged
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
eea8ead
nits
abi87 49538dc
wip: extended sdk.Context use to middleware
abi87 b303196
dropped unnecessary types and file
abi87 847cd52
some more types cleanup
abi87 020cb11
some more types cleanup
abi87 92bbfae
added type for BeaconBlock with relevant consensus data
abi87 69efa86
nits
abi87 8b87b65
wip: adding consensus data to blocks to be verified
abi87 be54ae7
wip: added consensus block to blockchain service
abi87 196f1ec
wip: used consensus block type in blockchain service
abi87 55126cb
wip: fixed dispatching of consensus blocks
abi87 ce0d420
wip: rebased next payload timestamp on top of consensus block time
abi87 49b31a8
wip: rebased next payload timestamp from finalized block on top of co…
abi87 7975424
nit
abi87 70bba14
wip: fixed dispatching of finalized beacon blocks
abi87 0365941
wip: rebased next payload timestamp for building blocks on top of con…
abi87 da314f1
nits
abi87 36041e8
fixed consensus time setting
abi87 13a93ea
improved SlotData encapsulation
abi87 f13cdf7
Merge branch 'main' into consensus_decorated_events
abi87 0c6e82a
nit
abi87 20c881e
dropped minor code duplication
abi87 6b106b8
fix(blockchain): Further timestamp simplification (#2097)
abi87 e447c20
fix(state-transition): Validate execution payload timestamp (#2096)
abi87 cbc89a4
Merge branch 'main' into consensus_decorated_events
abi87 699df26
fix(consensus, beacon): let consensus tell SuggestedNextPayloadTimest…
abi87 6c256d4
fixed comment
abi87 f386d51
nit to appease rabbit + revert faulty change
abi87 e66ef6c
hardened check
abi87 0c0b3d5
Merge branch 'main' into consensus_decorated_events
abi87 8ca08fb
Merge branch 'main' into consensus_decorated_events
abi87 a8f2e07
Merge branch 'main' into consensus_decorated_events
abi87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,21 +196,17 @@ func (h *ABCIMiddleware[ | |
req *cmtabci.ProcessProposalRequest, | ||
) (*cmtabci.ProcessProposalResponse, error) { | ||
var ( | ||
err error | ||
startTime = time.Now() | ||
blk BeaconBlockT | ||
numMsgs int | ||
sidecars BlobSidecarsT | ||
awaitCtx, cancel = context.WithTimeout(ctx, AwaitTimeout) | ||
) | ||
defer cancel() | ||
// flush the channels to ensure that we are not handling old data. | ||
if numMsgs = async.ClearChan(h.subBBVerified); numMsgs > 0 { | ||
if numMsgs := async.ClearChan(h.subBBVerified); numMsgs > 0 { | ||
h.logger.Error( | ||
"WARNING: messages remaining in beacon block verification channel", | ||
"num_msgs", numMsgs) | ||
} | ||
if numMsgs = async.ClearChan(h.subSCVerified); numMsgs > 0 { | ||
if numMsgs := async.ClearChan(h.subSCVerified); numMsgs > 0 { | ||
h.logger.Error( | ||
"WARNING: messages remaining in sidecar verification channel", | ||
"num_msgs", numMsgs) | ||
|
@@ -219,32 +215,35 @@ func (h *ABCIMiddleware[ | |
defer h.metrics.measureProcessProposalDuration(startTime) | ||
|
||
// Request the beacon block. | ||
if blk, err = encoding. | ||
blk, err := encoding. | ||
UnmarshalBeaconBlockFromABCIRequest[BeaconBlockT]( | ||
req, 0, h.chainSpec.ActiveForkVersionForSlot(math.U64(req.Height)), | ||
); err != nil { | ||
req, | ||
BeaconBlockTxIndex, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: reuse constant |
||
h.chainSpec.ActiveForkVersionForSlot(math.U64(req.Height)), | ||
) | ||
if err != nil { | ||
return h.createProcessProposalResponse(errors.WrapNonFatal(err)) | ||
} | ||
|
||
// notify that the beacon block has been received. | ||
if err = h.dispatcher.Publish( | ||
async.NewEvent(ctx, async.BeaconBlockReceived, blk), | ||
); err != nil { | ||
blkEvent := async.NewEvent(ctx, async.BeaconBlockReceived, blk) | ||
if err = h.dispatcher.Publish(blkEvent); err != nil { | ||
return h.createProcessProposalResponse(errors.WrapNonFatal(err)) | ||
} | ||
|
||
// Request the blob sidecars. | ||
if sidecars, err = encoding. | ||
sidecars, err := encoding. | ||
UnmarshalBlobSidecarsFromABCIRequest[BlobSidecarsT]( | ||
req, 1, | ||
); err != nil { | ||
req, | ||
BlobSidecarsTxIndex, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: reuse constant |
||
) | ||
if err != nil { | ||
return h.createProcessProposalResponse(errors.WrapNonFatal(err)) | ||
} | ||
|
||
// notify that the sidecars have been received. | ||
if err = h.dispatcher.Publish( | ||
async.NewEvent(ctx, async.SidecarsReceived, sidecars), | ||
); err != nil { | ||
blobEvent := async.NewEvent(ctx, async.SidecarsReceived, sidecars) | ||
if err = h.dispatcher.Publish(blobEvent); err != nil { | ||
return h.createProcessProposalResponse(errors.WrapNonFatal(err)) | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
right now it looks like SlotData is used exclusively for PrepareProposal and ConsensusBlock is used exclusively for ProcessProposal. Is this always the case? If so, we should probably rename / explain their purposes more specifically
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.
Correct. Names are not super telling but i would defer the renaming to a future PR to avoid inflating scope