Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/improve-slice-allocation' into i…
Browse files Browse the repository at this point in the history
…mprove-slice-allocation
  • Loading branch information
cristure committed Aug 26, 2024
2 parents 5978baf + e146985 commit 1f29ce0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion process/dataAggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/multiversx/mx-chain-core-go/core"
"github.com/multiversx/mx-chain-core-go/core/check"

"github.com/multiversx/mx-chain-ws-connector-firehose-go/data/hyperOutportBlocks"

data "github.com/multiversx/mx-chain-ws-connector-firehose-go/data/hyperOutportBlocks"
Expand Down Expand Up @@ -38,7 +39,7 @@ func (da *dataAggregator) ProcessHyperBlock(metaOutportBlock *hyperOutportBlocks
hyperOutportBlock := &data.HyperOutportBlock{}
hyperOutportBlock.MetaOutportBlock = metaOutportBlock

notarizedShardOutportBlocks := make([]*data.NotarizedHeaderOutportData, 0, len(outportBlock.NotarizedHeadersHashes))
notarizedShardOutportBlocks := make([]*data.NotarizedHeaderOutportData, 0, len(metaOutportBlock.NotarizedHeadersHashes))

log.Info("dataAggregator: notarizedHashes", "block hash", metaOutportBlock.BlockData.HeaderHash,
"num notarizedHashes", len(metaOutportBlock.NotarizedHeadersHashes))
Expand Down
6 changes: 2 additions & 4 deletions process/outportBlockConverter.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func (o *outportBlockConverter) HandleShardOutportBlock(outportBlock *outport.Ou
return nil, fmt.Errorf("failed to unmarshal: %w", err)
}

miniBlockHeaders := make([]*data.MiniBlockHeader, 0, len(header.Header.MiniBlockHeaders))
miniBlockHeaders := make([]*hyperOutportBlocks.MiniBlockHeader, 0, len(header.Header.MiniBlockHeaders))
for _, miniBlockHeader := range header.Header.MiniBlockHeaders {
mb := &hyperOutportBlocks.MiniBlockHeader{
Hash: miniBlockHeader.Hash,
Expand All @@ -431,7 +431,7 @@ func (o *outportBlockConverter) HandleShardOutportBlock(outportBlock *outport.Ou
miniBlockHeaders = append(miniBlockHeaders, mb)
}

peerChanges := make([]*data.PeerChange, 0, len(header.Header.PeerChanges))
peerChanges := make([]*hyperOutportBlocks.PeerChange, 0, len(header.Header.PeerChanges))
for _, peerChange := range header.Header.PeerChanges {
pc := &hyperOutportBlocks.PeerChange{
PubKey: peerChange.PubKey,
Expand Down Expand Up @@ -746,8 +746,6 @@ func (o *outportBlockConverter) HandleMetaOutportBlock(outportBlock *outport.Out
}

// unmarshall into google protobuf. This is the proto that will be used in firehose.
metaOutportBlock := &data.MetaOutportBlock{}
err = o.protoMarshalizer.Unmarshal(metaOutportBlock, bytes)
metaOutportBlock := &hyperOutportBlocks.MetaOutportBlock{}
err = o.protoMarshaller.Unmarshal(metaOutportBlock, bytes)
if err != nil {
Expand Down

0 comments on commit 1f29ce0

Please sign in to comment.