Added bootstrapping notifications to VMs

This commit is contained in:
StephenButtolph 2020-06-01 23:24:21 -04:00
parent 7671cab972
commit cd669a3d98
16 changed files with 448 additions and 75 deletions

View File

@ -90,6 +90,11 @@ func (b *bootstrapper) FilterAccepted(containerIDs ids.Set) ids.Set {
// ForceAccepted ...
func (b *bootstrapper) ForceAccepted(acceptedContainerIDs ids.Set) error {
if err := b.VM.Bootstrapping(); err != nil {
return fmt.Errorf("failed to notify VM that bootstrapping has started: %w",
err)
}
for _, vtxID := range acceptedContainerIDs.List() {
if err := b.fetch(vtxID); err != nil {
return err
@ -259,6 +264,11 @@ func (b *bootstrapper) finish() error {
return err
}
if err := b.VM.Bootstrapped(); err != nil {
return fmt.Errorf("failed to notify VM that bootstrapping has finished: %w",
err)
}
// Start consensus
if err := b.onFinished(); err != nil {
return err

View File

@ -82,7 +82,7 @@ func newConfig(t *testing.T) (BootstrapConfig, ids.ShortID, *common.SenderTest,
}
func TestBootstrapperSingleFrontier(t *testing.T) {
config, peerID, sender, state, _ := newConfig(t)
config, peerID, sender, state, vm := newConfig(t)
vtxID0 := ids.Empty.Prefix(0)
vtxID1 := ids.Empty.Prefix(1)
@ -150,8 +150,12 @@ func TestBootstrapperSingleFrontier(t *testing.T) {
vtxIDToReqID[vtxKey] = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
vm.CantBootstrapping = true
state.getVertex = nil
sender.GetF = nil
@ -196,6 +200,7 @@ func TestBootstrapperSingleFrontier(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
for vtxKey, reqID := range vtxIDToReqID {
vtxID := ids.NewID(vtxKey)
@ -215,6 +220,7 @@ func TestBootstrapperSingleFrontier(t *testing.T) {
state.parseVertex = nil
state.edge = nil
bs.onFinished = nil
vm.CantBootstrapped = true
if !*finished {
t.Fatalf("Bootstrapping should have finished")
@ -231,7 +237,7 @@ func TestBootstrapperSingleFrontier(t *testing.T) {
}
func TestBootstrapperUnknownByzantineResponse(t *testing.T) {
config, peerID, sender, state, _ := newConfig(t)
config, peerID, sender, state, vm := newConfig(t)
vtxID0 := ids.Empty.Prefix(0)
vtxID1 := ids.Empty.Prefix(1)
@ -285,8 +291,12 @@ func TestBootstrapperUnknownByzantineResponse(t *testing.T) {
*requestID = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
vm.CantBootstrapping = true
state.getVertex = nil
state.parseVertex = func(vtxBytes []byte) (avalanche.Vertex, error) {
@ -314,10 +324,13 @@ func TestBootstrapperUnknownByzantineResponse(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
bs.Put(peerID, *requestID, vtxID1, vtxBytes1)
bs.Put(peerID, *requestID, vtxID0, vtxBytes0)
vm.CantBootstrapped = true
state.parseVertex = nil
state.edge = nil
bs.onFinished = nil
@ -334,7 +347,7 @@ func TestBootstrapperUnknownByzantineResponse(t *testing.T) {
}
func TestBootstrapperVertexDependencies(t *testing.T) {
config, peerID, sender, state, _ := newConfig(t)
config, peerID, sender, state, vm := newConfig(t)
vtxID0 := ids.Empty.Prefix(0)
vtxID1 := ids.Empty.Prefix(1)
@ -389,8 +402,12 @@ func TestBootstrapperVertexDependencies(t *testing.T) {
*reqIDPtr = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
vm.CantBootstrapping = true
state.getVertex = nil
sender.GetF = nil
@ -461,11 +478,13 @@ func TestBootstrapperVertexDependencies(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
bs.Put(peerID, *reqIDPtr, vtxID0, vtxBytes0)
state.parseVertex = nil
bs.onFinished = nil
vm.CantBootstrapped = true
if !*finished {
t.Fatalf("Bootstrapping should have finished")
@ -563,8 +582,12 @@ func TestBootstrapperTxDependencies(t *testing.T) {
*reqIDPtr = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
vm.CantBootstrapping = true
state.getVertex = nil
sender.GetF = nil
@ -653,11 +676,13 @@ func TestBootstrapperTxDependencies(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
bs.Put(peerID, *reqIDPtr, vtxID0, vtxBytes0)
state.parseVertex = nil
bs.onFinished = nil
vm.CantBootstrapped = true
if !*finished {
t.Fatalf("Should have finished bootstrapping")
@ -758,11 +783,13 @@ func TestBootstrapperMissingTxDependency(t *testing.T) {
*reqIDPtr = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
state.getVertex = nil
sender.GetF = nil
vm.CantBootstrapping = true
state.parseVertex = func(vtxBytes []byte) (avalanche.Vertex, error) {
switch {
@ -845,11 +872,13 @@ func TestBootstrapperMissingTxDependency(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
bs.Put(peerID, *reqIDPtr, vtxID0, vtxBytes0)
state.parseVertex = nil
bs.onFinished = nil
vm.CantBootstrapped = true
if !*finished {
t.Fatalf("Bootstrapping should have finished")
@ -958,7 +987,7 @@ func TestBootstrapperFilterAccepted(t *testing.T) {
}
func TestBootstrapperPartialFetch(t *testing.T) {
config, _, sender, state, _ := newConfig(t)
config, _, sender, state, vm := newConfig(t)
vtxID0 := ids.Empty.Prefix(0)
vtxID1 := ids.Empty.Prefix(1)
@ -995,6 +1024,7 @@ func TestBootstrapperPartialFetch(t *testing.T) {
}
sender.CantGet = false
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
@ -1008,7 +1038,7 @@ func TestBootstrapperPartialFetch(t *testing.T) {
}
func TestBootstrapperWrongIDByzantineResponse(t *testing.T) {
config, peerID, sender, state, _ := newConfig(t)
config, peerID, sender, state, vm := newConfig(t)
vtxID0 := ids.Empty.Prefix(0)
vtxID1 := ids.Empty.Prefix(1)
@ -1061,11 +1091,13 @@ func TestBootstrapperWrongIDByzantineResponse(t *testing.T) {
*requestID = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
state.getVertex = nil
sender.GetF = nil
vm.CantBootstrapping = true
state.parseVertex = func(vtxBytes []byte) (avalanche.Vertex, error) {
switch {
@ -1093,6 +1125,7 @@ func TestBootstrapperWrongIDByzantineResponse(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
sender.CantGet = false
vm.CantBootstrapped = false
bs.Put(peerID, *requestID, vtxID0, vtxBytes1)
@ -1103,6 +1136,7 @@ func TestBootstrapperWrongIDByzantineResponse(t *testing.T) {
state.parseVertex = nil
state.edge = nil
bs.onFinished = nil
vm.CantBootstrapped = true
if !*finished {
t.Fatalf("Bootstrapping should have finished")

View File

@ -2167,6 +2167,9 @@ func TestEngineBootstrappingIntoConsensus(t *testing.T) {
vm.Default(true)
vm.CantBootstrapping = false
vm.CantBootstrapped = false
utxos := []ids.ID{GenerateID(), GenerateID()}
txID0 := GenerateID()

View File

@ -19,19 +19,22 @@ var (
type VMTest struct {
T *testing.T
CantInitialize, CantShutdown, CantCreateHandlers, CantCreateStaticHandlers bool
CantInitialize, CantBootstrapping, CantBootstrapped, CantShutdown, CantCreateHandlers, CantCreateStaticHandlers bool
InitializeF func(*snow.Context, database.Database, []byte, chan<- Message, []*Fx) error
ShutdownF func() error
CreateHandlersF func() map[string]*HTTPHandler
CreateStaticHandlersF func() map[string]*HTTPHandler
InitializeF func(*snow.Context, database.Database, []byte, chan<- Message, []*Fx) error
BootstrappingF, BootstrappedF, ShutdownF func() error
CreateHandlersF func() map[string]*HTTPHandler
CreateStaticHandlersF func() map[string]*HTTPHandler
}
// Default ...
func (vm *VMTest) Default(cant bool) {
vm.CantInitialize = cant
vm.CantBootstrapping = cant
vm.CantBootstrapped = cant
vm.CantShutdown = cant
vm.CantCreateHandlers = cant
vm.CantCreateStaticHandlers = cant
}
// Initialize ...
@ -45,6 +48,32 @@ func (vm *VMTest) Initialize(ctx *snow.Context, db database.Database, initState
return errInitialize
}
// Bootstrapping ...
func (vm *VMTest) Bootstrapping() error {
if vm.BootstrappingF != nil {
return vm.BootstrappingF()
} else if vm.CantBootstrapping {
if vm.T != nil {
vm.T.Fatalf("Unexpectedly called Bootstrapping")
}
return errors.New("Unexpectedly called Bootstrapping")
}
return nil
}
// Bootstrapped ...
func (vm *VMTest) Bootstrapped() error {
if vm.BootstrappedF != nil {
return vm.BootstrappedF()
} else if vm.CantBootstrapped {
if vm.T != nil {
vm.T.Fatalf("Unexpectedly called Bootstrapped")
}
return errors.New("Unexpectedly called Bootstrapped")
}
return nil
}
// Shutdown ...
func (vm *VMTest) Shutdown() error {
if vm.ShutdownF != nil {

View File

@ -12,8 +12,7 @@ import (
type VM interface {
// Initialize this VM.
// [ctx]: Metadata about this VM.
// [ctx.networkID]: The ID of the network this VM's chain is running
// on.
// [ctx.networkID]: The ID of the network this VM's chain is running on.
// [ctx.chainID]: The unique ID of the chain this VM is running on.
// [ctx.Log]: Used to log messages
// [ctx.NodeID]: The unique staker ID of this node.
@ -37,6 +36,12 @@ type VM interface {
fxs []*Fx,
) error
// Bootstrapping is called when the node is starting to bootstrap.
Bootstrapping() error
// Bootstrapped is called when the node is exiting bootstrapping.
Bootstrapped() error
// Shutdown is called when the node is shutting down.
Shutdown() error

View File

@ -76,6 +76,11 @@ func (b *bootstrapper) FilterAccepted(containerIDs ids.Set) ids.Set {
// ForceAccepted ...
func (b *bootstrapper) ForceAccepted(acceptedContainerIDs ids.Set) error {
if err := b.VM.Bootstrapping(); err != nil {
return fmt.Errorf("failed to notify VM that bootstrapping has started: %w",
err)
}
for _, blkID := range acceptedContainerIDs.List() {
if err := b.fetch(blkID); err != nil {
return err
@ -216,6 +221,11 @@ func (b *bootstrapper) finish() error {
return err
}
if err := b.VM.Bootstrapped(); err != nil {
return fmt.Errorf("failed to notify VM that bootstrapping has finished: %w",
err)
}
// Start consensus
if err := b.onFinished(); err != nil {
return err

View File

@ -125,11 +125,13 @@ func TestBootstrapperSingleFrontier(t *testing.T) {
*reqID = innerReqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
vm.GetBlockF = nil
sender.GetF = nil
vm.CantBootstrapping = true
vm.ParseBlockF = func(blkBytes []byte) (snowman.Block, error) {
switch {
@ -142,11 +144,13 @@ func TestBootstrapperSingleFrontier(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
bs.Put(peerID, *reqID, blkID1, blkBytes1)
vm.ParseBlockF = nil
bs.onFinished = nil
vm.CantBootstrapped = true
if !*finished {
t.Fatalf("Bootstrapping should have finished")
@ -218,10 +222,12 @@ func TestBootstrapperUnknownByzantineResponse(t *testing.T) {
*requestID = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
vm.GetBlockF = nil
vm.CantBootstrapping = true
vm.ParseBlockF = func(blkBytes []byte) (snowman.Block, error) {
switch {
@ -236,11 +242,13 @@ func TestBootstrapperUnknownByzantineResponse(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
bs.Put(peerID, *requestID, blkID2, blkBytes2)
bs.Put(peerID, *requestID, blkID1, blkBytes1)
vm.ParseBlockF = nil
vm.CantBootstrapped = true
if !*finished {
t.Fatalf("Bootstrapping should have finished")
@ -315,11 +323,13 @@ func TestBootstrapperDependency(t *testing.T) {
*requestID = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
vm.GetBlockF = nil
sender.GetF = nil
vm.CantBootstrapping = true
vm.ParseBlockF = func(blkBytes []byte) (snowman.Block, error) {
switch {
@ -336,6 +346,7 @@ func TestBootstrapperDependency(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
bs.Put(peerID, *requestID, blkID1, blkBytes1)
@ -410,6 +421,7 @@ func TestBootstrapperFilterAccepted(t *testing.T) {
t.Fatal(errUnknownBlock)
return nil, errUnknownBlock
}
vm.CantBootstrapping = false
accepted := bs.FilterAccepted(blkIDs)
@ -466,6 +478,7 @@ func TestBootstrapperPartialFetch(t *testing.T) {
sender.CantGet = false
bs.onFinished = func() error { return nil }
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
@ -540,11 +553,13 @@ func TestBootstrapperWrongIDByzantineResponse(t *testing.T) {
*requestID = reqID
}
vm.CantBootstrapping = false
bs.ForceAccepted(acceptedIDs)
vm.GetBlockF = nil
sender.GetF = nil
vm.CantBootstrapping = true
vm.ParseBlockF = func(blkBytes []byte) (snowman.Block, error) {
switch {
@ -572,10 +587,12 @@ func TestBootstrapperWrongIDByzantineResponse(t *testing.T) {
finished := new(bool)
bs.onFinished = func() error { *finished = true; return nil }
vm.CantBootstrapped = false
bs.Put(peerID, *requestID, blkID1, blkBytes1)
vm.ParseBlockF = nil
vm.CantBootstrapped = true
if !*finished {
t.Fatalf("Bootstrapping should have finished")

View File

@ -197,6 +197,12 @@ func (vm *VM) Initialize(
return vm.db.Commit()
}
// Bootstrapping marks this VM as bootstrapping
func (vm *VM) Bootstrapping() error { return nil }
// Bootstrapped marks this VM as bootstrapped
func (vm *VM) Bootstrapped() error { return nil }
// Shutdown implements the avalanche.DAGVM interface
func (vm *VM) Shutdown() error {
if vm.timer == nil {

View File

@ -81,6 +81,12 @@ func (svm *SnowmanVM) GetBlock(ID ids.ID) (snowman.Block, error) {
return nil, errBadData // Should never happen
}
// Bootstrapping marks this VM as bootstrapping
func (svm *SnowmanVM) Bootstrapping() error { return nil }
// Bootstrapped marks this VM as bootstrapped
func (svm *SnowmanVM) Bootstrapped() error { return nil }
// Shutdown this vm
func (svm *SnowmanVM) Shutdown() error {
if svm.DB == nil {

View File

@ -399,6 +399,12 @@ func (vm *VM) createChain(tx *CreateChainTx) {
vm.chainManager.CreateChain(chainParams)
}
// Bootstrapping marks this VM as bootstrapping
func (vm *VM) Bootstrapping() error { return nil }
// Bootstrapped marks this VM as bootstrapped
func (vm *VM) Bootstrapped() error { return nil }
// Shutdown this blockchain
func (vm *VM) Shutdown() error {
if vm.timer == nil {

View File

@ -129,6 +129,18 @@ func (vm *VMClient) startMessengerServer(opts []grpc.ServerOption) *grpc.Server
return server
}
// Bootstrapping ...
func (vm *VMClient) Bootstrapping() error {
_, err := vm.client.Bootstrapping(context.Background(), &vmproto.BootstrappingRequest{})
return err
}
// Bootstrapped ...
func (vm *VMClient) Bootstrapped() error {
_, err := vm.client.Bootstrapped(context.Background(), &vmproto.BootstrappedRequest{})
return err
}
// Shutdown ...
func (vm *VMClient) Shutdown() error {
vm.lock.Lock()

View File

@ -84,8 +84,18 @@ func (vm *VMServer) Initialize(_ context.Context, req *vmproto.InitializeRequest
return &vmproto.InitializeResponse{}, nil
}
// Bootstrapping ...
func (vm *VMServer) Bootstrapping(context.Context, *vmproto.BootstrappingRequest) (*vmproto.BootstrappingResponse, error) {
return &vmproto.BootstrappingResponse{}, vm.vm.Bootstrapping()
}
// Bootstrapped ...
func (vm *VMServer) Bootstrapped(context.Context, *vmproto.BootstrappedRequest) (*vmproto.BootstrappedResponse, error) {
return &vmproto.BootstrappedResponse{}, vm.vm.Bootstrapped()
}
// Shutdown ...
func (vm *VMServer) Shutdown(_ context.Context, _ *vmproto.ShutdownRequest) (*vmproto.ShutdownResponse, error) {
func (vm *VMServer) Shutdown(context.Context, *vmproto.ShutdownRequest) (*vmproto.ShutdownResponse, error) {
vm.lock.Lock()
defer vm.lock.Unlock()

View File

@ -110,6 +110,130 @@ func (m *InitializeResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_InitializeResponse proto.InternalMessageInfo
type BootstrappingRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BootstrappingRequest) Reset() { *m = BootstrappingRequest{} }
func (m *BootstrappingRequest) String() string { return proto.CompactTextString(m) }
func (*BootstrappingRequest) ProtoMessage() {}
func (*BootstrappingRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{2}
}
func (m *BootstrappingRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BootstrappingRequest.Unmarshal(m, b)
}
func (m *BootstrappingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BootstrappingRequest.Marshal(b, m, deterministic)
}
func (m *BootstrappingRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_BootstrappingRequest.Merge(m, src)
}
func (m *BootstrappingRequest) XXX_Size() int {
return xxx_messageInfo_BootstrappingRequest.Size(m)
}
func (m *BootstrappingRequest) XXX_DiscardUnknown() {
xxx_messageInfo_BootstrappingRequest.DiscardUnknown(m)
}
var xxx_messageInfo_BootstrappingRequest proto.InternalMessageInfo
type BootstrappingResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BootstrappingResponse) Reset() { *m = BootstrappingResponse{} }
func (m *BootstrappingResponse) String() string { return proto.CompactTextString(m) }
func (*BootstrappingResponse) ProtoMessage() {}
func (*BootstrappingResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{3}
}
func (m *BootstrappingResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BootstrappingResponse.Unmarshal(m, b)
}
func (m *BootstrappingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BootstrappingResponse.Marshal(b, m, deterministic)
}
func (m *BootstrappingResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_BootstrappingResponse.Merge(m, src)
}
func (m *BootstrappingResponse) XXX_Size() int {
return xxx_messageInfo_BootstrappingResponse.Size(m)
}
func (m *BootstrappingResponse) XXX_DiscardUnknown() {
xxx_messageInfo_BootstrappingResponse.DiscardUnknown(m)
}
var xxx_messageInfo_BootstrappingResponse proto.InternalMessageInfo
type BootstrappedRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BootstrappedRequest) Reset() { *m = BootstrappedRequest{} }
func (m *BootstrappedRequest) String() string { return proto.CompactTextString(m) }
func (*BootstrappedRequest) ProtoMessage() {}
func (*BootstrappedRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{4}
}
func (m *BootstrappedRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BootstrappedRequest.Unmarshal(m, b)
}
func (m *BootstrappedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BootstrappedRequest.Marshal(b, m, deterministic)
}
func (m *BootstrappedRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_BootstrappedRequest.Merge(m, src)
}
func (m *BootstrappedRequest) XXX_Size() int {
return xxx_messageInfo_BootstrappedRequest.Size(m)
}
func (m *BootstrappedRequest) XXX_DiscardUnknown() {
xxx_messageInfo_BootstrappedRequest.DiscardUnknown(m)
}
var xxx_messageInfo_BootstrappedRequest proto.InternalMessageInfo
type BootstrappedResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BootstrappedResponse) Reset() { *m = BootstrappedResponse{} }
func (m *BootstrappedResponse) String() string { return proto.CompactTextString(m) }
func (*BootstrappedResponse) ProtoMessage() {}
func (*BootstrappedResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{5}
}
func (m *BootstrappedResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BootstrappedResponse.Unmarshal(m, b)
}
func (m *BootstrappedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BootstrappedResponse.Marshal(b, m, deterministic)
}
func (m *BootstrappedResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_BootstrappedResponse.Merge(m, src)
}
func (m *BootstrappedResponse) XXX_Size() int {
return xxx_messageInfo_BootstrappedResponse.Size(m)
}
func (m *BootstrappedResponse) XXX_DiscardUnknown() {
xxx_messageInfo_BootstrappedResponse.DiscardUnknown(m)
}
var xxx_messageInfo_BootstrappedResponse proto.InternalMessageInfo
type ShutdownRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@ -120,7 +244,7 @@ func (m *ShutdownRequest) Reset() { *m = ShutdownRequest{} }
func (m *ShutdownRequest) String() string { return proto.CompactTextString(m) }
func (*ShutdownRequest) ProtoMessage() {}
func (*ShutdownRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{2}
return fileDescriptor_cab246c8c7c5372d, []int{6}
}
func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error {
@ -151,7 +275,7 @@ func (m *ShutdownResponse) Reset() { *m = ShutdownResponse{} }
func (m *ShutdownResponse) String() string { return proto.CompactTextString(m) }
func (*ShutdownResponse) ProtoMessage() {}
func (*ShutdownResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{3}
return fileDescriptor_cab246c8c7c5372d, []int{7}
}
func (m *ShutdownResponse) XXX_Unmarshal(b []byte) error {
@ -182,7 +306,7 @@ func (m *CreateHandlersRequest) Reset() { *m = CreateHandlersRequest{} }
func (m *CreateHandlersRequest) String() string { return proto.CompactTextString(m) }
func (*CreateHandlersRequest) ProtoMessage() {}
func (*CreateHandlersRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{4}
return fileDescriptor_cab246c8c7c5372d, []int{8}
}
func (m *CreateHandlersRequest) XXX_Unmarshal(b []byte) error {
@ -214,7 +338,7 @@ func (m *CreateHandlersResponse) Reset() { *m = CreateHandlersResponse{}
func (m *CreateHandlersResponse) String() string { return proto.CompactTextString(m) }
func (*CreateHandlersResponse) ProtoMessage() {}
func (*CreateHandlersResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{5}
return fileDescriptor_cab246c8c7c5372d, []int{9}
}
func (m *CreateHandlersResponse) XXX_Unmarshal(b []byte) error {
@ -255,7 +379,7 @@ func (m *Handler) Reset() { *m = Handler{} }
func (m *Handler) String() string { return proto.CompactTextString(m) }
func (*Handler) ProtoMessage() {}
func (*Handler) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{6}
return fileDescriptor_cab246c8c7c5372d, []int{10}
}
func (m *Handler) XXX_Unmarshal(b []byte) error {
@ -307,7 +431,7 @@ func (m *BuildBlockRequest) Reset() { *m = BuildBlockRequest{} }
func (m *BuildBlockRequest) String() string { return proto.CompactTextString(m) }
func (*BuildBlockRequest) ProtoMessage() {}
func (*BuildBlockRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{7}
return fileDescriptor_cab246c8c7c5372d, []int{11}
}
func (m *BuildBlockRequest) XXX_Unmarshal(b []byte) error {
@ -341,7 +465,7 @@ func (m *BuildBlockResponse) Reset() { *m = BuildBlockResponse{} }
func (m *BuildBlockResponse) String() string { return proto.CompactTextString(m) }
func (*BuildBlockResponse) ProtoMessage() {}
func (*BuildBlockResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{8}
return fileDescriptor_cab246c8c7c5372d, []int{12}
}
func (m *BuildBlockResponse) XXX_Unmarshal(b []byte) error {
@ -394,7 +518,7 @@ func (m *ParseBlockRequest) Reset() { *m = ParseBlockRequest{} }
func (m *ParseBlockRequest) String() string { return proto.CompactTextString(m) }
func (*ParseBlockRequest) ProtoMessage() {}
func (*ParseBlockRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{9}
return fileDescriptor_cab246c8c7c5372d, []int{13}
}
func (m *ParseBlockRequest) XXX_Unmarshal(b []byte) error {
@ -435,7 +559,7 @@ func (m *ParseBlockResponse) Reset() { *m = ParseBlockResponse{} }
func (m *ParseBlockResponse) String() string { return proto.CompactTextString(m) }
func (*ParseBlockResponse) ProtoMessage() {}
func (*ParseBlockResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{10}
return fileDescriptor_cab246c8c7c5372d, []int{14}
}
func (m *ParseBlockResponse) XXX_Unmarshal(b []byte) error {
@ -488,7 +612,7 @@ func (m *GetBlockRequest) Reset() { *m = GetBlockRequest{} }
func (m *GetBlockRequest) String() string { return proto.CompactTextString(m) }
func (*GetBlockRequest) ProtoMessage() {}
func (*GetBlockRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{11}
return fileDescriptor_cab246c8c7c5372d, []int{15}
}
func (m *GetBlockRequest) XXX_Unmarshal(b []byte) error {
@ -529,7 +653,7 @@ func (m *GetBlockResponse) Reset() { *m = GetBlockResponse{} }
func (m *GetBlockResponse) String() string { return proto.CompactTextString(m) }
func (*GetBlockResponse) ProtoMessage() {}
func (*GetBlockResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{12}
return fileDescriptor_cab246c8c7c5372d, []int{16}
}
func (m *GetBlockResponse) XXX_Unmarshal(b []byte) error {
@ -582,7 +706,7 @@ func (m *SetPreferenceRequest) Reset() { *m = SetPreferenceRequest{} }
func (m *SetPreferenceRequest) String() string { return proto.CompactTextString(m) }
func (*SetPreferenceRequest) ProtoMessage() {}
func (*SetPreferenceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{13}
return fileDescriptor_cab246c8c7c5372d, []int{17}
}
func (m *SetPreferenceRequest) XXX_Unmarshal(b []byte) error {
@ -620,7 +744,7 @@ func (m *SetPreferenceResponse) Reset() { *m = SetPreferenceResponse{} }
func (m *SetPreferenceResponse) String() string { return proto.CompactTextString(m) }
func (*SetPreferenceResponse) ProtoMessage() {}
func (*SetPreferenceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{14}
return fileDescriptor_cab246c8c7c5372d, []int{18}
}
func (m *SetPreferenceResponse) XXX_Unmarshal(b []byte) error {
@ -651,7 +775,7 @@ func (m *LastAcceptedRequest) Reset() { *m = LastAcceptedRequest{} }
func (m *LastAcceptedRequest) String() string { return proto.CompactTextString(m) }
func (*LastAcceptedRequest) ProtoMessage() {}
func (*LastAcceptedRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{15}
return fileDescriptor_cab246c8c7c5372d, []int{19}
}
func (m *LastAcceptedRequest) XXX_Unmarshal(b []byte) error {
@ -683,7 +807,7 @@ func (m *LastAcceptedResponse) Reset() { *m = LastAcceptedResponse{} }
func (m *LastAcceptedResponse) String() string { return proto.CompactTextString(m) }
func (*LastAcceptedResponse) ProtoMessage() {}
func (*LastAcceptedResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{16}
return fileDescriptor_cab246c8c7c5372d, []int{20}
}
func (m *LastAcceptedResponse) XXX_Unmarshal(b []byte) error {
@ -722,7 +846,7 @@ func (m *BlockVerifyRequest) Reset() { *m = BlockVerifyRequest{} }
func (m *BlockVerifyRequest) String() string { return proto.CompactTextString(m) }
func (*BlockVerifyRequest) ProtoMessage() {}
func (*BlockVerifyRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{17}
return fileDescriptor_cab246c8c7c5372d, []int{21}
}
func (m *BlockVerifyRequest) XXX_Unmarshal(b []byte) error {
@ -760,7 +884,7 @@ func (m *BlockVerifyResponse) Reset() { *m = BlockVerifyResponse{} }
func (m *BlockVerifyResponse) String() string { return proto.CompactTextString(m) }
func (*BlockVerifyResponse) ProtoMessage() {}
func (*BlockVerifyResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{18}
return fileDescriptor_cab246c8c7c5372d, []int{22}
}
func (m *BlockVerifyResponse) XXX_Unmarshal(b []byte) error {
@ -792,7 +916,7 @@ func (m *BlockAcceptRequest) Reset() { *m = BlockAcceptRequest{} }
func (m *BlockAcceptRequest) String() string { return proto.CompactTextString(m) }
func (*BlockAcceptRequest) ProtoMessage() {}
func (*BlockAcceptRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{19}
return fileDescriptor_cab246c8c7c5372d, []int{23}
}
func (m *BlockAcceptRequest) XXX_Unmarshal(b []byte) error {
@ -830,7 +954,7 @@ func (m *BlockAcceptResponse) Reset() { *m = BlockAcceptResponse{} }
func (m *BlockAcceptResponse) String() string { return proto.CompactTextString(m) }
func (*BlockAcceptResponse) ProtoMessage() {}
func (*BlockAcceptResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{20}
return fileDescriptor_cab246c8c7c5372d, []int{24}
}
func (m *BlockAcceptResponse) XXX_Unmarshal(b []byte) error {
@ -862,7 +986,7 @@ func (m *BlockRejectRequest) Reset() { *m = BlockRejectRequest{} }
func (m *BlockRejectRequest) String() string { return proto.CompactTextString(m) }
func (*BlockRejectRequest) ProtoMessage() {}
func (*BlockRejectRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{21}
return fileDescriptor_cab246c8c7c5372d, []int{25}
}
func (m *BlockRejectRequest) XXX_Unmarshal(b []byte) error {
@ -900,7 +1024,7 @@ func (m *BlockRejectResponse) Reset() { *m = BlockRejectResponse{} }
func (m *BlockRejectResponse) String() string { return proto.CompactTextString(m) }
func (*BlockRejectResponse) ProtoMessage() {}
func (*BlockRejectResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cab246c8c7c5372d, []int{22}
return fileDescriptor_cab246c8c7c5372d, []int{26}
}
func (m *BlockRejectResponse) XXX_Unmarshal(b []byte) error {
@ -924,6 +1048,10 @@ var xxx_messageInfo_BlockRejectResponse proto.InternalMessageInfo
func init() {
proto.RegisterType((*InitializeRequest)(nil), "vmproto.InitializeRequest")
proto.RegisterType((*InitializeResponse)(nil), "vmproto.InitializeResponse")
proto.RegisterType((*BootstrappingRequest)(nil), "vmproto.BootstrappingRequest")
proto.RegisterType((*BootstrappingResponse)(nil), "vmproto.BootstrappingResponse")
proto.RegisterType((*BootstrappedRequest)(nil), "vmproto.BootstrappedRequest")
proto.RegisterType((*BootstrappedResponse)(nil), "vmproto.BootstrappedResponse")
proto.RegisterType((*ShutdownRequest)(nil), "vmproto.ShutdownRequest")
proto.RegisterType((*ShutdownResponse)(nil), "vmproto.ShutdownResponse")
proto.RegisterType((*CreateHandlersRequest)(nil), "vmproto.CreateHandlersRequest")
@ -950,46 +1078,49 @@ func init() {
func init() { proto.RegisterFile("vm.proto", fileDescriptor_cab246c8c7c5372d) }
var fileDescriptor_cab246c8c7c5372d = []byte{
// 617 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x6d, 0x6f, 0xd2, 0x50,
0x14, 0x4e, 0x21, 0x32, 0x3c, 0xc0, 0x06, 0x17, 0xd8, 0xb0, 0x6e, 0x13, 0x1b, 0xb3, 0x60, 0x62,
0xf8, 0x30, 0x7f, 0xc0, 0x22, 0x8a, 0x6e, 0xf1, 0x6d, 0x96, 0x84, 0x98, 0xe8, 0x97, 0x42, 0x0f,
0x5b, 0x95, 0xb5, 0xf5, 0xde, 0x0b, 0x73, 0xfe, 0x23, 0xff, 0xa5, 0xa1, 0xbd, 0x6d, 0xef, 0xbd,
0xb4, 0x59, 0xe2, 0xb7, 0x9e, 0x73, 0x9e, 0xf3, 0x9c, 0x97, 0x7b, 0x9e, 0x42, 0x75, 0x7d, 0x33,
0x0c, 0x69, 0xc0, 0x03, 0xb2, 0xb3, 0xbe, 0x89, 0x3e, 0xac, 0x5b, 0x68, 0x5d, 0xf8, 0x1e, 0xf7,
0x9c, 0xa5, 0xf7, 0x07, 0x6d, 0xfc, 0xb5, 0x42, 0xc6, 0x89, 0x09, 0x55, 0x77, 0x36, 0x41, 0xba,
0x46, 0xda, 0x33, 0xfa, 0xc6, 0xa0, 0x61, 0xa7, 0x36, 0xb1, 0xa0, 0x7e, 0x85, 0x3e, 0x32, 0x8f,
0x8d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 0x40, 0xa5, 0xd1, 0x72, 0x74, 0x3a, 0x06, 0xc8, 0xa4, 0x23, 0xd1, 0x6c, 0x49,
0x4f, 0xa2, 0xc9, 0xd1, 0xda, 0x19, 0x54, 0x13, 0x11, 0x48, 0x1b, 0xd2, 0xa4, 0x23, 0x6d, 0x68,
0x4b, 0x31, 0x9f, 0xa0, 0xa1, 0xdc, 0x2f, 0x39, 0xca, 0xb6, 0x99, 0x73, 0xff, 0xe6, 0x71, 0x51,
0x58, 0xf0, 0xbd, 0x87, 0xba, 0x7c, 0xdf, 0xe4, 0x30, 0xc5, 0xe7, 0xa8, 0xc1, 0x3c, 0x2a, 0x88,
0x0a, 0xb2, 0x73, 0xa8, 0x49, 0xe7, 0x4d, 0xa4, 0x85, 0x6e, 0x49, 0xc3, 0x3c, 0xcc, 0x0f, 0x6a,
0x4c, 0x71, 0x09, 0x9d, 0x49, 0xd1, 0x89, 0xce, 0xa4, 0xca, 0x23, 0x65, 0x8a, 0x0f, 0x5f, 0x67,
0x52, 0x44, 0xa3, 0x33, 0xa9, 0x5a, 0x99, 0x55, 0xa2, 0xd0, 0xcb, 0x7f, 0x01, 0x00, 0x00, 0xff,
0xff, 0xbb, 0xac, 0x5b, 0xc8, 0x65, 0x07, 0x00, 0x00,
// 672 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x61, 0x4f, 0x13, 0x41,
0x10, 0x4d, 0x4b, 0x84, 0x3a, 0xb4, 0x40, 0x97, 0x16, 0xea, 0x09, 0x5a, 0x2f, 0x86, 0x60, 0x62,
0xf8, 0x80, 0x3f, 0x80, 0x58, 0x45, 0x21, 0x2a, 0xe2, 0x91, 0x10, 0x13, 0xfd, 0x72, 0xf4, 0x06,
0x38, 0x2d, 0x77, 0xe7, 0xee, 0xb6, 0x88, 0x3f, 0xd0, 0xdf, 0x65, 0xee, 0x6e, 0xef, 0x6e, 0x76,
0xb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x11, 0x2c, 0x13, 0xed, 0x31, 0xb2,
0xd0, 0x39, 0xdd, 0x3a, 0x5b, 0xf6, 0xa4, 0xc1, 0x94, 0xb7, 0x30, 0x99, 0x34, 0x11, 0x9b, 0x4c,
0xba, 0x76, 0x4b, 0xa6, 0x5c, 0x95, 0x26, 0x93, 0xa6, 0x68, 0x93, 0x49, 0x17, 0xf2, 0xc5, 0x62,
0x96, 0x7a, 0xf5, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x92, 0xa7, 0x99, 0xc8, 0x62, 0x08, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -1005,6 +1136,8 @@ const _ = grpc.SupportPackageIsVersion6
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type VMClient interface {
Initialize(ctx context.Context, in *InitializeRequest, opts ...grpc.CallOption) (*InitializeResponse, error)
Bootstrapping(ctx context.Context, in *BootstrappingRequest, opts ...grpc.CallOption) (*BootstrappingResponse, error)
Bootstrapped(ctx context.Context, in *BootstrappedRequest, opts ...grpc.CallOption) (*BootstrappedResponse, error)
Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error)
CreateHandlers(ctx context.Context, in *CreateHandlersRequest, opts ...grpc.CallOption) (*CreateHandlersResponse, error)
BuildBlock(ctx context.Context, in *BuildBlockRequest, opts ...grpc.CallOption) (*BuildBlockResponse, error)
@ -1034,6 +1167,24 @@ func (c *vMClient) Initialize(ctx context.Context, in *InitializeRequest, opts .
return out, nil
}
func (c *vMClient) Bootstrapping(ctx context.Context, in *BootstrappingRequest, opts ...grpc.CallOption) (*BootstrappingResponse, error) {
out := new(BootstrappingResponse)
err := c.cc.Invoke(ctx, "/vmproto.VM/Bootstrapping", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *vMClient) Bootstrapped(ctx context.Context, in *BootstrappedRequest, opts ...grpc.CallOption) (*BootstrappedResponse, error) {
out := new(BootstrappedResponse)
err := c.cc.Invoke(ctx, "/vmproto.VM/Bootstrapped", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *vMClient) Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error) {
out := new(ShutdownResponse)
err := c.cc.Invoke(ctx, "/vmproto.VM/Shutdown", in, out, opts...)
@ -1127,6 +1278,8 @@ func (c *vMClient) BlockReject(ctx context.Context, in *BlockRejectRequest, opts
// VMServer is the server API for VM service.
type VMServer interface {
Initialize(context.Context, *InitializeRequest) (*InitializeResponse, error)
Bootstrapping(context.Context, *BootstrappingRequest) (*BootstrappingResponse, error)
Bootstrapped(context.Context, *BootstrappedRequest) (*BootstrappedResponse, error)
Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
CreateHandlers(context.Context, *CreateHandlersRequest) (*CreateHandlersResponse, error)
BuildBlock(context.Context, *BuildBlockRequest) (*BuildBlockResponse, error)
@ -1146,6 +1299,12 @@ type UnimplementedVMServer struct {
func (*UnimplementedVMServer) Initialize(ctx context.Context, req *InitializeRequest) (*InitializeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented")
}
func (*UnimplementedVMServer) Bootstrapping(ctx context.Context, req *BootstrappingRequest) (*BootstrappingResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Bootstrapping not implemented")
}
func (*UnimplementedVMServer) Bootstrapped(ctx context.Context, req *BootstrappedRequest) (*BootstrappedResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Bootstrapped not implemented")
}
func (*UnimplementedVMServer) Shutdown(ctx context.Context, req *ShutdownRequest) (*ShutdownResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Shutdown not implemented")
}
@ -1199,6 +1358,42 @@ func _VM_Initialize_Handler(srv interface{}, ctx context.Context, dec func(inter
return interceptor(ctx, in, info, handler)
}
func _VM_Bootstrapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BootstrappingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VMServer).Bootstrapping(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vmproto.VM/Bootstrapping",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VMServer).Bootstrapping(ctx, req.(*BootstrappingRequest))
}
return interceptor(ctx, in, info, handler)
}
func _VM_Bootstrapped_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BootstrappedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VMServer).Bootstrapped(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vmproto.VM/Bootstrapped",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VMServer).Bootstrapped(ctx, req.(*BootstrappedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _VM_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ShutdownRequest)
if err := dec(in); err != nil {
@ -1387,6 +1582,14 @@ var _VM_serviceDesc = grpc.ServiceDesc{
MethodName: "Initialize",
Handler: _VM_Initialize_Handler,
},
{
MethodName: "Bootstrapping",
Handler: _VM_Bootstrapping_Handler,
},
{
MethodName: "Bootstrapped",
Handler: _VM_Bootstrapped_Handler,
},
{
MethodName: "Shutdown",
Handler: _VM_Shutdown_Handler,

View File

@ -9,6 +9,14 @@ message InitializeRequest {
message InitializeResponse {}
message BootstrappingRequest {}
message BootstrappingResponse {}
message BootstrappedRequest {}
message BootstrappedResponse {}
message ShutdownRequest {}
message ShutdownResponse {}
@ -86,6 +94,8 @@ message BlockRejectResponse {}
service VM {
rpc Initialize(InitializeRequest) returns (InitializeResponse);
rpc Bootstrapping(BootstrappingRequest) returns (BootstrappingResponse);
rpc Bootstrapped(BootstrappedRequest) returns (BootstrappedResponse);
rpc Shutdown(ShutdownRequest) returns (ShutdownResponse);
rpc CreateHandlers(CreateHandlersRequest) returns (CreateHandlersResponse);
rpc BuildBlock(BuildBlockRequest) returns (BuildBlockResponse);
@ -97,4 +107,4 @@ service VM {
rpc BlockVerify(BlockVerifyRequest) returns (BlockVerifyResponse);
rpc BlockAccept(BlockAcceptRequest) returns (BlockAcceptResponse);
rpc BlockReject(BlockRejectRequest) returns (BlockRejectResponse);
}
}

View File

@ -116,6 +116,12 @@ func (vm *VM) Initialize(
return nil
}
// Bootstrapping marks this VM as bootstrapping
func (vm *VM) Bootstrapping() error { return nil }
// Bootstrapped marks this VM as bootstrapped
func (vm *VM) Bootstrapped() error { return nil }
// Shutdown implements the snowman.ChainVM interface
func (vm *VM) Shutdown() error {
if vm.timer == nil {

View File

@ -128,6 +128,12 @@ func (vm *VM) Initialize(
return vm.db.Commit()
}
// Bootstrapping marks this VM as bootstrapping
func (vm *VM) Bootstrapping() error { return nil }
// Bootstrapped marks this VM as bootstrapped
func (vm *VM) Bootstrapped() error { return nil }
// Shutdown implements the avalanche.DAGVM interface
func (vm *VM) Shutdown() error {
if vm.timer == nil {