mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Added a backward compatibility fix for aligning with Firehose 2.3
This commit is contained in:
parent
2ff5f62b6f
commit
3cbe387cd6
1 changed files with 19 additions and 0 deletions
|
|
@ -643,6 +643,13 @@ func (f *Firehose) completeTransaction(receipt *types.Receipt) *pbeth.Transactio
|
|||
f.removeLogBlockIndexOnStateRevertedCalls()
|
||||
f.assignOrdinalAndIndexToReceiptLogs()
|
||||
|
||||
if *f.applyBackwardCompatibility {
|
||||
// Known Firehose issue: Failed call logging a log with no topics were not fixed in the old Firehose instrumentation
|
||||
// leading to them to be rendered as `topics: [""]` instead of `topics: nil` like successful calls.
|
||||
// Here we re-apply this bogus behavior.
|
||||
f.noTopicsLogOnFailedCallSetToEmptyHash()
|
||||
}
|
||||
|
||||
if *f.applyBackwardCompatibility {
|
||||
// Known Firehose issue: This field has never been populated in the old Firehose instrumentation
|
||||
} else {
|
||||
|
|
@ -757,6 +764,18 @@ func (f *Firehose) assignOrdinalAndIndexToReceiptLogs() {
|
|||
}
|
||||
}
|
||||
|
||||
func (f *Firehose) noTopicsLogOnFailedCallSetToEmptyHash() {
|
||||
for _, call := range f.transaction.Calls {
|
||||
if call.StateReverted {
|
||||
for _, log := range call.Logs {
|
||||
if len(log.Topics) == 0 {
|
||||
log.Topics = make([][]byte, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OnCallEnter implements the EVMLogger interface to initialize the tracing operation.
|
||||
func (f *Firehose) OnCallEnter(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
|
||||
opCode := vm.OpCode(typ)
|
||||
|
|
|
|||
Loading…
Reference in a new issue