Skip to content

Commit

Permalink
remove logs index?
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Nov 8, 2023
1 parent 322a1f8 commit af599de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
14 changes: 7 additions & 7 deletions cmd/fireeth/tools_compare_blocks_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,15 @@ func toFirehoseTraces(in *rpc.BlockTransactions, logs []*rpc.LogEntry) (traces [
}
ordinal++

for li, log := range logs {
if eth.Hash(log.TransactionHash).String() == txHash {
for _, log := range logs {
if log.TransactionHash.String() == txHash {
out[i].Receipt.Logs = append(out[i].Receipt.Logs, &pbeth.Log{
Address: log.Address.Bytes(), //[]byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
Topics: hashesToBytes(log.Topics), //[][]byte `protobuf:"bytes,2,rep,name=topics,proto3" json:"topics,omitempty"`
Data: log.Data.Bytes(), //[]byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
BlockIndex: uint32(log.ToLog().BlockIndex), //uint32 `protobuf:"varint,6,opt,name=blockIndex,proto3" json:"blockIndex,omitempty"`
Address: log.Address.Bytes(), //[]byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
Topics: hashesToBytes(log.Topics), //[][]byte `protobuf:"bytes,2,rep,name=topics,proto3" json:"topics,omitempty"`
Data: log.Data.Bytes(), //[]byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
BlockIndex: log.ToLog().BlockIndex, //uint32 `protobuf:"varint,6,opt,name=blockIndex,proto3" json:"blockIndex,omitempty"`
Ordinal: ordinal,
Index: uint32(li),
//Index: uint32(li),
})
ordinal++
}
Expand Down
17 changes: 14 additions & 3 deletions devel/merged-blocks-compare/compare-merged-blocks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@ function process_block_range() {
echo "$output_file"
}

rm -f /tmp/merged-blocks-compare/*
mkdir -p /tmp/merged-blocks-compare

v1File=$(process_block_range v1 22208500 22208600)
vPollerFile=$(process_block_range vPoller 22208500 22208600)
start_block=22207900
stop_block=22208000

v1File=$(process_block_range v1 $start_block $stop_block)
vPollerFile=$(process_block_range vPoller $start_block $stop_block)

echo "Diffing $v1File and $vPollerFile"

diff -C0 "/tmp/merged-blocks-compare/$v1File" "/tmp/merged-blocks-compare/$vPollerFile"
d=$(diff -C5 "/tmp/merged-blocks-compare/$v1File" "/tmp/merged-blocks-compare/$vPollerFile")

if [ -z "$d" ]; then
echo "No diff found!"
else
echo "Diff found!"
echo "$d" > "/tmp/merged-blocks-compare/$start_block-$stop_block.diff"
fi

0 comments on commit af599de

Please sign in to comment.