-
Notifications
You must be signed in to change notification settings - Fork 995
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
Implement Stream Duties Functionality #5685
Changes from 45 commits
29f4148
ed807b0
4efab4e
99a848d
08f37d5
bb5e60d
3be7452
aa9ea93
d893fd7
a04d738
6a3392d
31d0bc1
ac55332
3784dc2
89cdb94
6247c91
9a26622
467233d
86ab8a2
21262d1
1585c14
78bc89f
645fdfd
f616897
6161be4
33a3bc1
069c307
7a40233
9029d63
04f35d0
a8358e7
9f7b659
947c34a
419e08b
d791233
90337c8
70e91ed
320c257
a8082d7
90e9074
4cd6783
58e688e
8929e3e
e03aa1d
dfc7e36
daeddb8
c1dd9c4
23c7cf1
670dde7
21305e7
0ca6512
1b8cf21
f21c9a5
06121d7
92cd704
68a9e33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,16 @@ const ( | |
Initialized | ||
// Synced is sent when the beacon node has completed syncing and is ready to participate in the network. | ||
Synced | ||
// Reorg is an event sent when the new head state's slot after a block | ||
// transition is lower than its previous head state slot value. | ||
Reorg | ||
) | ||
|
||
// BlockProcessedData is the data sent with BlockProcessed events. | ||
type BlockProcessedData struct { | ||
// Slot is the slot of the processed block. | ||
Slot uint64 | ||
// BlockRoot is the hash of the processed block. | ||
// BlockRoot of the processed block. | ||
BlockRoot [32]byte | ||
// Verified is true if the block's BLS contents have been verified. | ||
Verified bool | ||
|
@@ -45,3 +48,11 @@ type InitializedData struct { | |
// GenesisValidatorsRoot represents ssz.HashTreeRoot(state.validators). | ||
GenesisValidatorsRoot []byte | ||
} | ||
|
||
// ReorgData is the data alongside a reorg event. | ||
type ReorgData struct { | ||
// NewSlot is the slot of new state after the reorg. | ||
NewSlot uint64 | ||
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. Is this correct ? shouldn't it be new block root instead 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. This is fine. |
||
// OldSlot is the slot of the head state before the reorg. | ||
OldSlot uint64 | ||
} |
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.
Not sure this is fully correct, while this would be one way to determine a re-org the correct way would be to check whether the incoming block is a direct child of the current head. If it's not then we can mark it as a re-org.
You could have re-orgs also when
where the new head isn't a descendant of the current chain head.
cc @terencechain
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.
Yeah my bad on this. I was only thinking reorg that affect assignments so it's not complete. Nishant is right. We can have the following:
Head can change from 101 to 102 to 103. From 102 to 103 it's a reorg but slot isn't right.
Checking the direct child sounds good to me