diff --git a/consensus/bor/clerk.go b/consensus/bor/clerk.go index d7e6982873..5524e249f2 100644 --- a/consensus/bor/clerk.go +++ b/consensus/bor/clerk.go @@ -23,10 +23,10 @@ type EventRecordWithTime struct { Time time.Time `json:"record_time" yaml:"record_time"` } -// String returns the string representatin of span -func (e *EventRecordWithTime) String() string { +// String returns the string representation of EventRecord +func (e *EventRecordWithTime) String(gasUsed uint64) string { return fmt.Sprintf( - "id %v, contract %v, data: %v, txHash: %v, logIndex: %v, chainId: %v, time %s", + "id %v, contract %v, data: %v, txHash: %v, logIndex: %v, chainId: %v, time %s, gasUsed %d", e.ID, e.Contract.String(), e.Data.String(), @@ -34,6 +34,7 @@ func (e *EventRecordWithTime) String() string { e.LogIndex, e.ChainID, e.Time.Format(time.RFC3339), + gasUsed, ) } diff --git a/consensus/bor/genesis_contracts_client.go b/consensus/bor/genesis_contracts_client.go index 456e3fe2e5..79a2a254c4 100644 --- a/consensus/bor/genesis_contracts_client.go +++ b/consensus/bor/genesis_contracts_client.go @@ -66,9 +66,10 @@ func (gc *GenesisContractsClient) CommitState( log.Error("Unable to pack tx for commitState", "error", err) return 0, err } - log.Info("→ committing new state", "eventRecord", event.String()) msg := getSystemMessage(common.HexToAddress(gc.StateReceiverContract), data) gasUsed, err := applyMessage(msg, state, header, gc.chainConfig, chCtx) + // Logging event log with time and individual gasUsed + log.Info("→ committing new state", "eventRecord", event.String(gasUsed)) if err != nil { return 0, err }