Skip to content

Commit

Permalink
Merge branch 'v0.34.x-celestia' into v0.34.x-celestia
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp authored Sep 5, 2024
2 parents d6d1f8e + 44dea31 commit 7d87a82
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 2 additions & 4 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ func (cs *State) updateRoundStep(round int32, step cstypes.RoundStepType) {
}
if cs.Step != step {
cs.metrics.MarkStep(cs.Step)
schema.WriteRoundState(cs.traceClient, cs.Height, round, uint8(step))
}
}
cs.Round = round
Expand Down Expand Up @@ -706,10 +707,6 @@ func (cs *State) newStep() {

cs.nSteps++

step := uint8(cs.RoundState.Step)

schema.WriteRoundState(cs.traceClient, cs.Height, cs.Round, step)

// newStep is called by updateToState in NewState before the eventBus is set!
if cs.eventBus != nil {
if err := cs.eventBus.PublishEventNewRoundStep(rs); err != nil {
Expand Down Expand Up @@ -1518,6 +1515,7 @@ func (cs *State) enterPrecommitWait(height int64, round int32) {
defer func() {
// Done enterPrecommitWait:
cs.TriggeredTimeoutPrecommit = true
cs.updateRoundStep(round, cstypes.RoundStepPrecommitWait)
cs.newStep()
}()

Expand Down
3 changes: 2 additions & 1 deletion mempool/cat/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (memR *Reactor) ReceiveEnvelope(e p2p.Envelope) {
for _, tx := range protoTxs {
ntx := types.Tx(tx)
key := ntx.Key()
schema.WriteMempoolTx(memR.traceClient, string(e.Src.ID()), key[:], schema.Download)
schema.WriteMempoolTx(memR.traceClient, string(e.Src.ID()), key[:], len(tx), schema.Download)
// If we requested the transaction we mark it as received.
if memR.requests.Has(peerID, key) {
memR.requests.MarkReceived(peerID, key)
Expand Down Expand Up @@ -331,6 +331,7 @@ func (memR *Reactor) ReceiveEnvelope(e p2p.Envelope) {
memR.traceClient,
string(e.Src.ID()),
txKey[:],
len(tx),
schema.Upload,
)
}
Expand Down
2 changes: 2 additions & 0 deletions mempool/v1/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func (memR *Reactor) ReceiveEnvelope(e p2p.Envelope) {
memR.traceClient,
string(e.Src.ID()),
ntx.Hash(),
len(tx),
schema.Download,
)
err = memR.mempool.CheckTx(ntx, nil, txInfo)
Expand Down Expand Up @@ -303,6 +304,7 @@ func (memR *Reactor) broadcastTxRoutine(peer p2p.Peer) {
memR.traceClient,
string(peer.ID()),
memTx.tx.Hash(),
len(memTx.tx),
schema.Upload,
)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/trace/schema/mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (m MempoolTx) Table() string {

// WriteMempoolTx writes a tracing point for a tx using the predetermined
// schema for mempool tracing.
func WriteMempoolTx(client trace.Tracer, peer string, txHash []byte, transferType TransferType) {
func WriteMempoolTx(client trace.Tracer, peer string, txHash []byte, size int, transferType TransferType) {
// this check is redundant to what is checked during client.Write, although it
// is an optimization to avoid allocations from the map of fields.
if !client.IsCollecting(MempoolTxTable) {
Expand All @@ -44,7 +44,7 @@ func WriteMempoolTx(client trace.Tracer, peer string, txHash []byte, transferTyp
client.Write(MempoolTx{
TxHash: bytes.HexBytes(txHash).String(),
Peer: peer,
Size: len(txHash),
Size: size,
TransferType: transferType,
})
}
Expand Down

0 comments on commit 7d87a82

Please sign in to comment.