github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/alsp/misbehavior.go (about) 1 package alsp 2 3 import "github.com/onflow/flow-go/network" 4 5 const ( 6 // StaleMessage is a misbehavior that is reported when an engine receives a message that is deemed stale based on the 7 // local view of the engine. The decision to consider a message stale is up to the engine. 8 StaleMessage network.Misbehavior = "misbehavior-stale-message" 9 10 // ResourceIntensiveRequest is a misbehavior that is reported when an engine receives a request that takes an unreasonable amount 11 // of resources by the engine to process, e.g., a request for a large number of blocks. The decision to consider a 12 // request heavy is up to the engine. 13 ResourceIntensiveRequest network.Misbehavior = "misbehavior-resource-intensive-request" 14 15 // RedundantMessage is a misbehavior that is reported when an engine receives a message that is redundant, i.e., the 16 // message is already known to the engine. The decision to consider a message redundant is up to the engine. 17 RedundantMessage network.Misbehavior = "misbehavior-redundant-message" 18 19 // UnsolicitedMessage is a misbehavior that is reported when an engine receives a message that is not solicited by the 20 // engine. The decision to consider a message unsolicited is up to the engine. 21 UnsolicitedMessage network.Misbehavior = "misbehavior-unsolicited-message" 22 23 // InvalidMessage is a misbehavior that is reported when an engine receives a message that is invalid, i.e., 24 // the message is not valid according to the engine's validation logic. The decision to consider a message invalid 25 // is up to the engine. 26 InvalidMessage network.Misbehavior = "misbehavior-invalid-message" 27 28 // UnExpectedValidationError is a misbehavior that is reported when a validation error is encountered during message validation before the message 29 // is processed by an engine. 30 UnExpectedValidationError network.Misbehavior = "unexpected-validation-error" 31 32 // UnknownMsgType is a misbehavior that is reported when a message of unknown type is received from a peer. 33 UnknownMsgType network.Misbehavior = "unknown-message-type" 34 35 // SenderEjected is a misbehavior that is reported when a message is received from an ejected peer. 36 SenderEjected network.Misbehavior = "sender-ejected" 37 38 // UnauthorizedUnicastOnChannel is a misbehavior that is reported when a message not authorized to be sent via unicast is received via unicast. 39 UnauthorizedUnicastOnChannel network.Misbehavior = "unauthorized-unicast-on-channel" 40 41 // UnAuthorizedSender is a misbehavior that is reported when a message is sent by an unauthorized role. 42 UnAuthorizedSender network.Misbehavior = "unauthorized-sender" 43 44 // UnauthorizedPublishOnChannel is a misbehavior that is reported when a message not authorized to be sent via pubsub is received via pubsub. 45 UnauthorizedPublishOnChannel network.Misbehavior = "unauthorized-pubsub-on-channel" 46 ) 47 48 func AllMisbehaviorTypes() []network.Misbehavior { 49 return []network.Misbehavior{ 50 StaleMessage, 51 ResourceIntensiveRequest, 52 RedundantMessage, 53 UnsolicitedMessage, 54 InvalidMessage, 55 UnExpectedValidationError, 56 UnknownMsgType, 57 SenderEjected, 58 UnauthorizedUnicastOnChannel, 59 UnauthorizedPublishOnChannel, 60 UnAuthorizedSender, 61 } 62 }