2018-07-19 16:31:50 +00:00
|
|
|
package blockchain
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2018-08-18 03:34:56 +00:00
|
|
|
"io/ioutil"
|
2018-07-19 16:31:50 +00:00
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
"github.com/ethereum/go-ethereum"
|
2018-07-22 16:58:14 +00:00
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2018-08-15 04:49:59 +00:00
|
|
|
gethTypes "github.com/ethereum/go-ethereum/core/types"
|
|
|
|
"github.com/ethereum/go-ethereum/event"
|
2018-08-18 03:34:56 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/params"
|
2018-07-22 16:58:14 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/powchain"
|
2018-08-15 04:49:59 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/types"
|
|
|
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
2018-07-30 06:14:50 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/database"
|
2018-08-18 03:34:56 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/testutil"
|
|
|
|
"github.com/sirupsen/logrus"
|
2018-07-19 16:31:50 +00:00
|
|
|
logTest "github.com/sirupsen/logrus/hooks/test"
|
|
|
|
)
|
|
|
|
|
2018-08-18 03:34:56 +00:00
|
|
|
func init() {
|
|
|
|
logrus.SetLevel(logrus.DebugLevel)
|
|
|
|
logrus.SetOutput(ioutil.Discard)
|
|
|
|
}
|
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
type mockClient struct{}
|
|
|
|
|
|
|
|
func (f *mockClient) SubscribeNewHead(ctx context.Context, ch chan<- *gethTypes.Header) (ethereum.Subscription, error) {
|
|
|
|
return new(event.Feed).Subscribe(ch), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *mockClient) BlockByHash(ctx context.Context, hash common.Hash) (*gethTypes.Block, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *mockClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- gethTypes.Log) (ethereum.Subscription, error) {
|
|
|
|
return new(event.Feed).Subscribe(ch), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *mockClient) LatestBlockHash() common.Hash {
|
|
|
|
return common.BytesToHash([]byte{'A'})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestDefaultConfig(t *testing.T) {
|
|
|
|
if DefaultConfig().BeaconBlockBuf != 10 {
|
|
|
|
t.Errorf("Default block buffer should be 10, got: %v", DefaultConfig().BeaconBlockBuf)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-19 16:31:50 +00:00
|
|
|
func TestStartStop(t *testing.T) {
|
|
|
|
ctx := context.Background()
|
|
|
|
tmp := fmt.Sprintf("%s/beacontest", os.TempDir())
|
2018-07-31 04:41:27 +00:00
|
|
|
defer os.RemoveAll(tmp)
|
|
|
|
|
2018-07-30 06:14:50 +00:00
|
|
|
config := &database.DBConfig{DataDir: tmp, Name: "beacontestdata", InMemory: false}
|
|
|
|
db, err := database.NewDB(config)
|
2018-07-19 16:31:50 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not setup beaconDB: %v", err)
|
|
|
|
}
|
2018-08-18 03:34:56 +00:00
|
|
|
|
2018-07-22 16:58:14 +00:00
|
|
|
endpoint := "ws://127.0.0.1"
|
2018-08-15 04:49:59 +00:00
|
|
|
client := &mockClient{}
|
|
|
|
web3Service, err := powchain.NewWeb3Service(ctx, &powchain.Web3ServiceConfig{Endpoint: endpoint, Pubkey: "", VrcAddr: common.Address{}}, client, client, client)
|
2018-07-22 16:58:14 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to set up web3 service: %v", err)
|
|
|
|
}
|
2018-08-09 22:54:59 +00:00
|
|
|
cfg := &Config{
|
|
|
|
BeaconBlockBuf: 0,
|
|
|
|
}
|
2018-08-15 04:49:59 +00:00
|
|
|
|
|
|
|
beaconChain, err := NewBeaconChain(db.DB())
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not register blockchain service: %v", err)
|
|
|
|
}
|
2018-08-20 15:50:11 +00:00
|
|
|
chainService, err := NewChainService(ctx, cfg, beaconChain, db, nil)
|
2018-07-19 16:31:50 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to setup chain service: %v", err)
|
|
|
|
}
|
2018-08-20 15:50:11 +00:00
|
|
|
chainService.Start()
|
2018-07-19 16:31:50 +00:00
|
|
|
|
2018-08-20 15:50:11 +00:00
|
|
|
chainService, err = NewChainService(ctx, cfg, beaconChain, db, web3Service)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to setup chain service: %v", err)
|
|
|
|
}
|
2018-07-19 16:31:50 +00:00
|
|
|
chainService.Start()
|
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
if len(chainService.ProcessedBlockHashes()) != 0 {
|
|
|
|
t.Errorf("incorrect processedBlockHashes size")
|
|
|
|
}
|
|
|
|
if len(chainService.ProcessedCrystallizedStateHashes()) != 0 {
|
|
|
|
t.Errorf("incorrect processedCrystallizedStateHashes size")
|
|
|
|
}
|
|
|
|
if len(chainService.ProcessedActiveStateHashes()) != 0 {
|
|
|
|
t.Errorf("incorrect processedActiveStateHashes size")
|
2018-07-19 16:31:50 +00:00
|
|
|
}
|
2018-08-15 04:49:59 +00:00
|
|
|
if len(chainService.CurrentActiveState().RecentBlockHashes()) != 0 {
|
|
|
|
t.Errorf("incorrect recent block hashes")
|
|
|
|
}
|
2018-08-18 03:34:56 +00:00
|
|
|
if len(chainService.CurrentCrystallizedState().Validators()) != params.BootstrappedValidatorsCount {
|
2018-08-15 04:49:59 +00:00
|
|
|
t.Errorf("incorrect default validator size")
|
|
|
|
}
|
|
|
|
if chainService.ContainsBlock([32]byte{}) {
|
|
|
|
t.Errorf("chain is not empty")
|
|
|
|
}
|
|
|
|
if chainService.ContainsCrystallizedState([32]byte{}) {
|
|
|
|
t.Errorf("cyrstallized states is not empty")
|
|
|
|
}
|
|
|
|
if chainService.ContainsActiveState([32]byte{}) {
|
|
|
|
t.Errorf("active states is not empty")
|
|
|
|
}
|
|
|
|
hasState, err := chainService.HasStoredState()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("calling HasStoredState failed")
|
|
|
|
}
|
|
|
|
if hasState {
|
|
|
|
t.Errorf("has stored state should return false")
|
|
|
|
}
|
2018-08-20 15:50:11 +00:00
|
|
|
chainService.CanonicalBlockEvent()
|
|
|
|
chainService.CanonicalCrystallizedStateEvent()
|
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
chainService, _ = NewChainService(ctx, cfg, beaconChain, db, web3Service)
|
2018-07-19 16:31:50 +00:00
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
active := types.NewActiveState(&pb.ActiveState{RecentBlockHashes: [][]byte{{'A'}}})
|
|
|
|
activeStateHash, err := active.Hash()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("Cannot hash active state: %v", err)
|
2018-07-19 16:31:50 +00:00
|
|
|
}
|
2018-08-15 04:49:59 +00:00
|
|
|
chainService.chain.SetActiveState(active)
|
2018-07-19 16:31:50 +00:00
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
crystallized := types.NewCrystallizedState(&pb.CrystallizedState{LastStateRecalc: 10000})
|
|
|
|
crystallizedStateHash, err := crystallized.Hash()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("Cannot hash crystallized state: %v", err)
|
2018-07-19 16:31:50 +00:00
|
|
|
}
|
2018-08-15 04:49:59 +00:00
|
|
|
chainService.chain.SetCrystallizedState(crystallized)
|
2018-07-19 16:31:50 +00:00
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
parentBlock := NewBlock(t, nil)
|
|
|
|
parentHash, _ := parentBlock.Hash()
|
|
|
|
|
|
|
|
block := NewBlock(t, &pb.BeaconBlock{
|
|
|
|
SlotNumber: 2,
|
|
|
|
ActiveStateHash: activeStateHash[:],
|
|
|
|
CrystallizedStateHash: crystallizedStateHash[:],
|
|
|
|
ParentHash: parentHash[:],
|
|
|
|
PowChainRef: []byte("a"),
|
|
|
|
})
|
|
|
|
if err := chainService.SaveBlock(block); err != nil {
|
|
|
|
t.Errorf("save block should have failed")
|
2018-07-19 16:31:50 +00:00
|
|
|
}
|
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
// Save states so HasStoredState state should return true.
|
|
|
|
chainService.chain.SetActiveState(types.NewActiveState(&pb.ActiveState{}))
|
|
|
|
chainService.chain.SetCrystallizedState(types.NewCrystallizedState(&pb.CrystallizedState{}))
|
|
|
|
hasState, _ = chainService.HasStoredState()
|
|
|
|
if !hasState {
|
|
|
|
t.Errorf("has stored state should return false")
|
2018-08-13 02:07:37 +00:00
|
|
|
}
|
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
if err := chainService.Stop(); err != nil {
|
|
|
|
t.Fatalf("unable to stop chain service: %v", err)
|
2018-07-31 04:41:27 +00:00
|
|
|
}
|
|
|
|
|
2018-07-19 16:31:50 +00:00
|
|
|
// The context should have been canceled.
|
|
|
|
if chainService.ctx.Err() == nil {
|
|
|
|
t.Error("context was not canceled")
|
|
|
|
}
|
|
|
|
}
|
2018-08-15 04:49:59 +00:00
|
|
|
|
|
|
|
func TestFaultyStop(t *testing.T) {
|
|
|
|
ctx := context.Background()
|
|
|
|
tmp := fmt.Sprintf("%s/beacontest", os.TempDir())
|
|
|
|
defer os.RemoveAll(tmp)
|
|
|
|
|
|
|
|
config := &database.DBConfig{DataDir: tmp, Name: "beacontestdata", InMemory: false}
|
|
|
|
db, err := database.NewDB(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not setup beaconDB: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
endpoint := "ws://127.0.0.1"
|
|
|
|
client := &mockClient{}
|
|
|
|
web3Service, err := powchain.NewWeb3Service(ctx, &powchain.Web3ServiceConfig{Endpoint: endpoint, Pubkey: "", VrcAddr: common.Address{}}, client, client, client)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to set up web3 service: %v", err)
|
|
|
|
}
|
|
|
|
cfg := &Config{
|
|
|
|
BeaconBlockBuf: 0,
|
|
|
|
}
|
|
|
|
|
|
|
|
beaconChain, err := NewBeaconChain(db.DB())
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not register blockchain service: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
chainService, err := NewChainService(ctx, cfg, beaconChain, db, web3Service)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to setup chain service: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
chainService.Start()
|
|
|
|
|
|
|
|
chainService.chain.SetActiveState(types.NewActiveState(nil))
|
|
|
|
err = chainService.Stop()
|
|
|
|
if err == nil {
|
|
|
|
t.Errorf("chain stop should have failed with persist active state")
|
|
|
|
}
|
|
|
|
|
|
|
|
chainService.chain.SetActiveState(types.NewActiveState(&pb.ActiveState{}))
|
|
|
|
chainService.chain.SetCrystallizedState(types.NewCrystallizedState(nil))
|
|
|
|
err = chainService.Stop()
|
|
|
|
if err == nil {
|
|
|
|
t.Errorf("chain stop should have failed with persist crystallized state")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestProcessingStates(t *testing.T) {
|
|
|
|
ctx := context.Background()
|
|
|
|
tmp := fmt.Sprintf("%s/beacontest", os.TempDir())
|
|
|
|
defer os.RemoveAll(tmp)
|
|
|
|
|
|
|
|
config := &database.DBConfig{DataDir: tmp, Name: "beacontestdata", InMemory: false}
|
|
|
|
db, err := database.NewDB(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not setup beaconDB: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
endpoint := "ws://127.0.0.1"
|
|
|
|
client := &mockClient{}
|
|
|
|
web3Service, err := powchain.NewWeb3Service(ctx, &powchain.Web3ServiceConfig{Endpoint: endpoint, Pubkey: "", VrcAddr: common.Address{}}, client, client, client)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to set up web3 service: %v", err)
|
|
|
|
}
|
|
|
|
cfg := &Config{
|
|
|
|
BeaconBlockBuf: 0,
|
|
|
|
}
|
|
|
|
beaconChain, err := NewBeaconChain(db.DB())
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not register blockchain service: %v", err)
|
|
|
|
}
|
|
|
|
chainService, _ := NewChainService(ctx, cfg, beaconChain, db, web3Service)
|
2018-08-18 03:34:56 +00:00
|
|
|
chainService.canonicalCrystallizedStateEvent = make(chan *types.CrystallizedState, 1)
|
2018-08-15 04:49:59 +00:00
|
|
|
if err := chainService.ProcessCrystallizedState(types.NewCrystallizedState(nil)); err == nil {
|
|
|
|
t.Errorf("processing crystallized state should have failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := chainService.ProcessActiveState(types.NewActiveState(nil)); err == nil {
|
|
|
|
t.Errorf("processing active state should have failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
chainService.ProcessCrystallizedState(types.NewCrystallizedState(&pb.CrystallizedState{}))
|
2018-08-18 03:34:56 +00:00
|
|
|
<-chainService.canonicalCrystallizedStateEvent
|
2018-08-15 04:49:59 +00:00
|
|
|
chainService.ProcessActiveState(types.NewActiveState(&pb.ActiveState{}))
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestProcessingBadBlock(t *testing.T) {
|
2018-08-18 03:34:56 +00:00
|
|
|
hook := logTest.NewGlobal()
|
2018-08-15 04:49:59 +00:00
|
|
|
ctx := context.Background()
|
|
|
|
tmp := fmt.Sprintf("%s/beacontest", os.TempDir())
|
|
|
|
defer os.RemoveAll(tmp)
|
|
|
|
|
2018-08-18 03:34:56 +00:00
|
|
|
config := &database.DBConfig{DataDir: tmp, Name: "badblockdata", InMemory: false}
|
2018-08-15 04:49:59 +00:00
|
|
|
db, err := database.NewDB(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not setup beaconDB: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
endpoint := "ws://127.0.0.1"
|
|
|
|
client := &mockClient{}
|
|
|
|
web3Service, err := powchain.NewWeb3Service(ctx, &powchain.Web3ServiceConfig{Endpoint: endpoint, Pubkey: "", VrcAddr: common.Address{}}, client, client, client)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to set up web3 service: %v", err)
|
|
|
|
}
|
|
|
|
cfg := &Config{
|
|
|
|
BeaconBlockBuf: 0,
|
|
|
|
}
|
|
|
|
beaconChain, err := NewBeaconChain(db.DB())
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not register blockchain service: %v", err)
|
|
|
|
}
|
|
|
|
chainService, _ := NewChainService(ctx, cfg, beaconChain, db, web3Service)
|
|
|
|
|
2018-08-20 15:50:11 +00:00
|
|
|
if err = chainService.ProcessBlock(&types.Block{}); err == nil {
|
|
|
|
t.Fatalf("Procss block should have failed with nil block")
|
|
|
|
}
|
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
active := types.NewActiveState(&pb.ActiveState{RecentBlockHashes: [][]byte{{'A'}}})
|
|
|
|
activeStateHash, err := active.Hash()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("Cannot hash active state: %v", err)
|
|
|
|
}
|
|
|
|
chainService.chain.SetActiveState(active)
|
|
|
|
|
|
|
|
crystallized := types.NewCrystallizedState(&pb.CrystallizedState{LastStateRecalc: 10000})
|
|
|
|
crystallizedStateHash, err := crystallized.Hash()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("Cannot hash crystallized state: %v", err)
|
|
|
|
}
|
|
|
|
chainService.chain.SetCrystallizedState(crystallized)
|
|
|
|
|
|
|
|
parentBlock := NewBlock(t, nil)
|
|
|
|
parentHash, _ := parentBlock.Hash()
|
|
|
|
|
|
|
|
block := NewBlock(t, &pb.BeaconBlock{
|
|
|
|
SlotNumber: 2,
|
|
|
|
ActiveStateHash: activeStateHash[:],
|
|
|
|
CrystallizedStateHash: crystallizedStateHash[:],
|
|
|
|
ParentHash: parentHash[:],
|
|
|
|
PowChainRef: []byte("a"),
|
|
|
|
})
|
|
|
|
|
2018-08-18 03:34:56 +00:00
|
|
|
if err = chainService.ProcessBlock(block); err != nil {
|
|
|
|
t.Fatalf("Could not setup processing block function")
|
2018-08-15 04:49:59 +00:00
|
|
|
}
|
2018-08-18 03:34:56 +00:00
|
|
|
testutil.AssertLogsContain(t, hook, "parent hash points to nil")
|
|
|
|
hook.Reset()
|
2018-08-15 04:49:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestRunningChainService(t *testing.T) {
|
|
|
|
ctx := context.Background()
|
|
|
|
tmp := fmt.Sprintf("%s/beacontest", os.TempDir())
|
|
|
|
defer os.RemoveAll(tmp)
|
|
|
|
config := &database.DBConfig{DataDir: tmp, Name: "beacontestdata", InMemory: false}
|
|
|
|
db, err := database.NewDB(config)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not setup beaconDB: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
endpoint := "ws://127.0.0.1"
|
|
|
|
client := &mockClient{}
|
|
|
|
web3Service, err := powchain.NewWeb3Service(ctx, &powchain.Web3ServiceConfig{Endpoint: endpoint, Pubkey: "", VrcAddr: common.Address{}}, client, client, client)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to set up web3 service: %v", err)
|
|
|
|
}
|
|
|
|
cfg := &Config{
|
2018-08-18 03:34:56 +00:00
|
|
|
BeaconBlockBuf: 0,
|
|
|
|
AnnouncementBuf: 1,
|
2018-08-15 04:49:59 +00:00
|
|
|
}
|
|
|
|
beaconChain, err := NewBeaconChain(db.DB())
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("could not register blockchain service: %v", err)
|
|
|
|
}
|
2018-08-18 03:34:56 +00:00
|
|
|
|
|
|
|
var validators []*pb.ValidatorRecord
|
|
|
|
for i := 0; i < 40; i++ {
|
|
|
|
validator := &pb.ValidatorRecord{Balance: 32, StartDynasty: 1, EndDynasty: 10}
|
|
|
|
validators = append(validators, validator)
|
|
|
|
}
|
|
|
|
|
|
|
|
crystallized := types.NewCrystallizedState(&pb.CrystallizedState{Validators: validators, CurrentDynasty: 5})
|
|
|
|
crystallizedStateHash, err := crystallized.Hash()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("Cannot hash crystallized state: %v", err)
|
|
|
|
}
|
|
|
|
|
2018-08-15 04:49:59 +00:00
|
|
|
testAttesterBitfield := []byte{200, 148, 146, 179, 49}
|
|
|
|
state := types.NewActiveState(&pb.ActiveState{PendingAttestations: []*pb.AttestationRecord{{AttesterBitfield: testAttesterBitfield}}})
|
|
|
|
if err := beaconChain.SetActiveState(state); err != nil {
|
|
|
|
t.Fatalf("unable to Mutate Active state: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
chainService, _ := NewChainService(ctx, cfg, beaconChain, db, web3Service)
|
2018-08-18 03:34:56 +00:00
|
|
|
chainService.chain.SetCrystallizedState(crystallized)
|
2018-08-15 04:49:59 +00:00
|
|
|
|
|
|
|
exitRoutine := make(chan bool)
|
|
|
|
go func() {
|
|
|
|
chainService.run(chainService.ctx.Done())
|
|
|
|
<-exitRoutine
|
|
|
|
}()
|
|
|
|
|
|
|
|
parentBlock := NewBlock(t, nil)
|
|
|
|
parentHash, _ := parentBlock.Hash()
|
|
|
|
|
|
|
|
activeStateHash, err := state.Hash()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("Cannot hash active state: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
block := NewBlock(t, &pb.BeaconBlock{
|
|
|
|
SlotNumber: 65,
|
|
|
|
ActiveStateHash: activeStateHash[:],
|
|
|
|
CrystallizedStateHash: crystallizedStateHash[:],
|
|
|
|
ParentHash: parentHash[:],
|
|
|
|
PowChainRef: []byte("a"),
|
|
|
|
})
|
|
|
|
|
|
|
|
chainService.latestBeaconBlock <- block
|
|
|
|
chainService.cancel()
|
2018-08-18 03:34:56 +00:00
|
|
|
<-chainService.canonicalBlockEvent
|
2018-08-15 04:49:59 +00:00
|
|
|
exitRoutine <- true
|
|
|
|
}
|