mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 13:05:09 +00:00
types/events+evidence: emit events + metrics on evidence validation (#7802)
* event: Added Events after evidence validation; evidence: refactored AddEvidence Added context and Metrics as parameter for the pool constructor * evidence: pushed event firing into evidence pool and added metrics to represent the size of the evpool * state: fixed parameters of evpool mock functions * evidence: added test to confirm events are generated * Removed obsolete EvidenceEventPublisher interface * evidence: pool removed error on missing eventbus
This commit is contained in:
committed by
GitHub
parent
ce898a738c
commit
e80541a251
@@ -40,6 +40,10 @@ const (
|
||||
EventTimeoutWaitValue = "TimeoutWait"
|
||||
EventValidBlockValue = "ValidBlock"
|
||||
EventVoteValue = "Vote"
|
||||
|
||||
// Events emitted by the evidence reactor when evidence is validated
|
||||
// and before it is committed
|
||||
EventEvidenceValidatedValue = "EvidenceValidated"
|
||||
)
|
||||
|
||||
// Pre-populated ABCI Tendermint-reserved events
|
||||
@@ -104,6 +108,7 @@ func init() {
|
||||
jsontypes.MustRegister(EventDataTx{})
|
||||
jsontypes.MustRegister(EventDataValidatorSetUpdates{})
|
||||
jsontypes.MustRegister(EventDataVote{})
|
||||
jsontypes.MustRegister(EventDataEvidenceValidated{})
|
||||
jsontypes.MustRegister(EventDataString(""))
|
||||
}
|
||||
|
||||
@@ -223,6 +228,15 @@ type EventDataStateSyncStatus struct {
|
||||
// TypeTag implements the required method of jsontypes.Tagged.
|
||||
func (EventDataStateSyncStatus) TypeTag() string { return "tendermint/event/StateSyncStatus" }
|
||||
|
||||
type EventDataEvidenceValidated struct {
|
||||
Evidence Evidence `json:"evidence"`
|
||||
|
||||
Height int64 `json:"height,string"`
|
||||
}
|
||||
|
||||
// TypeTag implements the required method of jsontypes.Tagged.
|
||||
func (EventDataEvidenceValidated) TypeTag() string { return "tendermint/event/EvidenceValidated" }
|
||||
|
||||
// PUBSUB
|
||||
|
||||
const (
|
||||
@@ -261,6 +275,7 @@ var (
|
||||
EventQueryVote = QueryForEvent(EventVoteValue)
|
||||
EventQueryBlockSyncStatus = QueryForEvent(EventBlockSyncStatusValue)
|
||||
EventQueryStateSyncStatus = QueryForEvent(EventStateSyncStatusValue)
|
||||
EventQueryEvidenceValidated = QueryForEvent(EventEvidenceValidatedValue)
|
||||
)
|
||||
|
||||
func EventQueryTxFor(tx Tx) *tmquery.Query {
|
||||
|
||||
Reference in New Issue
Block a user