-
Notifications
You must be signed in to change notification settings - Fork 669
/
message.go
37 lines (30 loc) · 1014 Bytes
/
message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package common
import "fmt"
// TODO: Consider renaming Message to, say, VMMessage
// Message is an enum of the message types that vms can send to consensus
type Message uint32
const (
// PendingTxs notifies a consensus engine that its VM has pending
// transactions.
//
// The consensus engine must eventually call BuildBlock at least once after
// receiving this message. If the consensus engine receives multiple
// PendingTxs messages between calls to BuildBlock, the engine may only call
// BuildBlock once.
PendingTxs Message = iota + 1
// StateSyncDone notifies the state syncer engine that the VM has finishing
// syncing the requested state summary.
StateSyncDone
)
func (msg Message) String() string {
switch msg {
case PendingTxs:
return "Pending Transactions"
case StateSyncDone:
return "State Sync Done"
default:
return fmt.Sprintf("Unknown Message: %d", msg)
}
}