Skip to content

Commit f10455b

Browse files
authored
fix: removed unused gas calc from parsedmessages (#1056)
* fix: removed unused gas calc from parsedmessages * refactor: fix log with unrelated error
1 parent f05d6cd commit f10455b

File tree

1 file changed

+1
-13
lines changed
  • tasks/messages/parsedmessage

1 file changed

+1
-13
lines changed

tasks/messages/parsedmessage/task.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ func (t *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
8383
parsedMessageResults = make(messagemodel.ParsedMessages, 0)
8484
errorsDetected = make([]*messages.MessageError, 0)
8585
exeMsgSeen = make(map[cid.Cid]bool)
86-
totalGasLimit int64
87-
totalUniqGasLimit int64
8886
)
8987

9088
for _, msgrec := range blkMsgRec {
@@ -100,22 +98,12 @@ func (t *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
10098
return nil, nil, err
10199
}
102100

103-
// calculate total gas limit of executed messages regardless of duplicates.
104-
for itr.HasNext() {
105-
msg, _, _ := itr.Next()
106-
totalGasLimit += msg.VMMessage().GasLimit
107-
}
108-
109-
// reset the iterator to beginning
110-
itr.Reset()
111-
112101
for itr.HasNext() {
113102
m, _, r := itr.Next()
114103
if exeMsgSeen[m.Cid()] {
115104
continue
116105
}
117106
exeMsgSeen[m.Cid()] = true
118-
totalUniqGasLimit += m.VMMessage().GasLimit
119107

120108
toActorCode, found := getActorCodeFn(m.VMMessage().To)
121109
if !found && r.ExitCode == 0 {
@@ -124,7 +112,7 @@ func (t *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut
124112
// unknown type.
125113
// If the message was executed it means we are out of step with Lotus behaviour somehow. This probably
126114
// indicates that Lily actor type detection is out of date.
127-
log.Errorw("parsing message", "error", err, "cid", m.Cid().String(), "receipt", r)
115+
log.Errorw("parsing message", "cid", m.Cid().String(), "receipt", r)
128116
errorsDetected = append(errorsDetected, &messages.MessageError{
129117
Cid: m.Cid(),
130118
Error: fmt.Errorf("failed to parse message params: missing to actor code").Error(),

0 commit comments

Comments
 (0)