Skip to content

Commit fb5582e

Browse files
authored
Merge pull request #623 from LF-Decentralized-Trust-labs/timeline-logging
Timeline logging
2 parents 25ba135 + 59a9294 commit fb5582e

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

config/pkg/pldconf/publictxmgr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,5 @@ type PublicTxManagerOrchestratorConfig struct {
172172
PersistenceRetryTime *string `json:"persistenceRetryTime"`
173173
UnavailableBalanceHandler *string `json:"unavailableBalanceHandler"`
174174
SubmissionRetry RetryConfigWithMax `json:"submissionRetry"`
175+
TimeLineLoggingEnabled bool `json:"timelineLoggingEnabled"`
175176
}

core/go/internal/publictxmgr/in_flight_transaction_stage_controller.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
"github.com/kaleido-io/paladin/core/pkg/ethclient"
3333
"github.com/kaleido-io/paladin/sdk/go/pkg/pldapi"
3434
"github.com/kaleido-io/paladin/sdk/go/pkg/pldtypes"
35-
"github.com/sirupsen/logrus"
3635
)
3736

3837
type InFlightStatus int
@@ -133,7 +132,7 @@ func NewInFlightTransactionStageController(
133132
timestamp: ptx.Created.Time(),
134133
},
135134
},
136-
timeLineLoggingEnabled: logrus.IsLevelEnabled(logrus.DebugLevel),
135+
timeLineLoggingEnabled: oc.timeLineLoggingEnabled,
137136
}
138137

139138
ift.MarkTime("wait_in_inflight_queue")

core/go/internal/publictxmgr/transaction_manager_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func newTestPublicTxManager(t *testing.T, realDBAndSigner bool, extraSetup ...fu
9898
SubmissionRetry: pldconf.RetryConfigWithMax{
9999
MaxAttempts: confutil.P(1),
100100
},
101+
TimeLineLoggingEnabled: true,
101102
},
102103
GasPrice: pldconf.GasPriceConfig{
103104
FixedGasPrice: 0,

core/go/internal/publictxmgr/transaction_orchestrator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ type orchestrator struct {
147147
// updates
148148
updates []*transactionUpdate
149149
updateMux sync.Mutex
150+
151+
timeLineLoggingEnabled bool
150152
}
151153

152154
const veryShortMinimum = 50 * time.Millisecond
@@ -182,6 +184,7 @@ func NewOrchestrator(
182184
stopProcess: make(chan bool, 1),
183185
ethClient: ptm.ethClient,
184186
bIndexer: ptm.bIndexer,
187+
timeLineLoggingEnabled: conf.Orchestrator.TimeLineLoggingEnabled,
185188
}
186189

187190
log.L(ctx).Debugf("NewOrchestrator for signing address %s created: %+v", newOrchestrator.signingAddress, newOrchestrator)
@@ -376,6 +379,7 @@ func (oc *orchestrator) pollAndProcess(ctx context.Context) (polled int, total i
376379
oc.totalCompleted = oc.totalCompleted + 1
377380
queueUpdated = true
378381
log.L(ctx).Debugf("Orchestrator poll and process, marking %s as complete after: %s", p.stateManager.GetSignerNonce(), time.Since(p.stateManager.GetCreatedTime().Time()))
382+
p.PrintTimeline()
379383
} else {
380384
log.L(ctx).Debugf("Orchestrator poll and process, continuing tx %s after: %s", p.stateManager.GetSignerNonce(), time.Since(p.stateManager.GetCreatedTime().Time()))
381385
oc.inFlightTxs = append(oc.inFlightTxs, p)

core/go/pkg/ethclient/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ func (ec *ethClient) SendRawTransaction(ctx context.Context, rawTX pldtypes.HexB
459459
if err != nil {
460460
log.L(ctx).Errorf("Invalid transaction build during signing: %s", err)
461461
} else {
462-
log.L(ctx).Errorf("Rejected TX (from=%s): %+v", addr, logJSON(decodedTX.Transaction))
462+
log.L(ctx).Errorf("Rejected TX (from=%s, nonce=%+v)", addr, decodedTX.Nonce)
463+
log.L(ctx).Tracef("Rejected TX (from=%s): %+v", addr, logJSON(decodedTX.Transaction))
463464
}
464465
return nil, fmt.Errorf("eth_sendRawTransaction failed: %+v", rpcErr)
465466
}

0 commit comments

Comments
 (0)