-
Notifications
You must be signed in to change notification settings - Fork 129
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
feat(dot/telemetry): Added more telemetry messages in grandpa client #2043
Merged
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ee9ec60
Added more telemetry messages in grandpa client
kishansagathiya 7bd91cc
Merge branch 'development' into kishan/telemetry/afg
kishansagathiya 1b4035f
fixed lint
kishansagathiya 472bebd
Added tests
kishansagathiya 7d06c29
Merge branch 'development' into kishan/telemetry/afg
kishansagathiya c519d66
Send afg.authority_set once every grandpa round
kishansagathiya e709f7d
Merge branch 'development' into kishan/telemetry/afg
kishansagathiya 37a0278
Merge branch 'development' into kishan/telemetry/afg
kishansagathiya 281d5cb
Addressed some reviews
kishansagathiya f274bca
Merge branch 'development' into kishan/telemetry/afg
kishansagathiya dddf967
fix linting
kishansagathiya 02c073d
addressed reviews
kishansagathiya 1f735a8
change ordering
kishansagathiya 5f6e4d1
Merge branch 'development' into kishan/telemetry/afg
kishansagathiya 6a7cdfb
addressed reviews
kishansagathiya 09e3826
Merge branch 'development' into kishan/telemetry/afg
kishansagathiya 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2021 ChainSafe Systems (ON) | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
package telemetry | ||
|
||
// afgAuthoritySetTM is a telemetry message of type `afg.authority_set` which is | ||
// meant to be sent when authority set changes (generally when a round is initiated) | ||
type afgAuthoritySetTM struct { | ||
// finalized hash and finalized number are sent by substrate, but not read by | ||
// substrate telemetry | ||
// FinalizedHash *common.Hash `json:"hash"` | ||
// FinalizedNumber string `json:"number"` | ||
AuthorityID string `json:"authority_id"` | ||
AuthoritySetID string `json:"authority_set_id"` | ||
// Substrate creates an array of string of authority IDs. It JSON-serialises | ||
// that array and send that as a string. | ||
Authorities string `json:"authorities"` | ||
} | ||
|
||
// NewAfgAuthoritySetTM creates a new afgAuthoritySetTM struct. | ||
func NewAfgAuthoritySetTM(authorityID, authoritySetID, authorities string) Message { | ||
return &afgAuthoritySetTM{ | ||
AuthorityID: authorityID, | ||
AuthoritySetID: authoritySetID, | ||
Authorities: authorities, | ||
} | ||
} | ||
|
||
func (afgAuthoritySetTM) messageType() string { | ||
return afgAuthoritySetMsg | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2021 ChainSafe Systems (ON) | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
package telemetry | ||
|
||
import ( | ||
"github.com/ChainSafe/gossamer/lib/common" | ||
) | ||
|
||
// afgFinalizedBlocksUpToTM holds telemetry message of type `afg.finalized_blocks_up_to`, | ||
// which is supposed to be sent when GRANDPA client finalises new blocks. | ||
type afgFinalizedBlocksUpToTM struct { | ||
Hash common.Hash `json:"hash"` | ||
Number string `json:"number"` | ||
} | ||
|
||
// NewAfgFinalizedBlocksUpToTM creates a new afgFinalizedBlocksUpToTM struct. | ||
func NewAfgFinalizedBlocksUpToTM(hash common.Hash, number string) Message { | ||
qdm12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return &afgFinalizedBlocksUpToTM{ | ||
Hash: hash, | ||
Number: number, | ||
} | ||
} | ||
|
||
func (afgFinalizedBlocksUpToTM) messageType() string { | ||
return afgFinalizedBlocksUpToMsg | ||
} |
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
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
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
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
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
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.
how much extra effort would it be to add these?
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.
None, hash and number can be achieved by
s.head.Hash()
ands.head.Number.String()
.I did not add them because telemetry server does not read those data. substrate also doesn't send these all the time. There is also another telemetry message through which we are sending these info
afg.finalized_blocks_up_to
Would you prefer i send hash and number?
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 either just add them, or remove this