fix rebase conflicts

pull/4465/head
“GheisMohammadi” 1 year ago
parent 135c7da455
commit 3fcfad4531
No known key found for this signature in database
GPG Key ID: 15073AED3829FE90
  1. 2
      api/service/stagedstreamsync/block_manager.go
  2. 2
      api/service/stagedstreamsync/stage_statesync.go
  3. 2
      core/blockchain.go
  4. 21
      p2p/stream/protocols/sync/stream_test.go

@ -126,7 +126,7 @@ func (gbm *blockDownloadManager) GetDownloadDetails(blockNumber uint64) (loopID
if dm, exist := gbm.bdd[blockNumber]; exist {
return dm.loopID, dm.streamID, nil
}
return 0, sttypes.StreamID(0), fmt.Errorf("there is no download details for the block number: %d", blockNumber)
return 0, sttypes.StreamID(fmt.Sprint(0)), fmt.Errorf("there is no download details for the block number: %d", blockNumber)
}
// SetRootHash sets the root hash for a specific block

@ -104,7 +104,7 @@ func (sss *StageStateSync) Exec(ctx context.Context, bool, invalidBlockRevert bo
}
// Fetch states from neighbors
pivotRootHash := s.state.status.pivotBlock.Root()
// pivotRootHash := s.state.status.pivotBlock.Root()
currentBlockRootHash := s.state.bc.CurrentFastBlock().Root()
sdm := newStateDownloadManager(tx, sss.configs.bc, sss.configs.concurrency, s.state.logger)
sdm.setRootHash(currentBlockRootHash)

@ -130,7 +130,7 @@ type BlockChain interface {
// transaction and receipt data.
InsertReceiptChain(blockChain types.Blocks, receiptChain []types.Receipts) (int, error)
// LeaderRotationMeta returns the number of continuous blocks by the leader.
LeaderRotationMeta() (publicKeyBytes []byte, epoch, count, shifts uint64, err error)
LeaderRotationMeta() LeaderRotationMeta
// BadBlocks returns a list of the last 'bad blocks' that
// the client has seen on the network.
BadBlocks() []BadBlock

@ -296,27 +296,6 @@ func TestSyncStream_HandleGetTrieNodes(t *testing.T) {
}
}
func TestSyncStream_HandleGetNodeData(t *testing.T) {
st, remoteSt := makeTestSyncStream()
go st.run()
defer close(st.closeC)
req := testGetNodeDataRequestMsg
b, _ := protobuf.Marshal(req)
err := remoteSt.WriteBytes(b)
if err != nil {
t.Fatal(err)
}
time.Sleep(200 * time.Millisecond)
receivedBytes, _ := remoteSt.ReadBytes()
if err := checkGetNodeDataResult(receivedBytes, testGetNodeData); err != nil {
t.Fatal(err)
}
}
func makeTestSyncStream() (*syncStream, *testRemoteBaseStream) {
localRaw, remoteRaw := makePairP2PStreams()
remote := newTestRemoteBaseStream(remoteRaw)

Loading…
Cancel
Save