Commit 498e78ce authored by Sebastian Stammler's avatar Sebastian Stammler

op-batcher: Add timeout trigger logging to channelManager

parent 43d516dd
...@@ -211,7 +211,7 @@ func (s *channelManager) TxData(l1Head eth.L1BlockRef) ([]byte, txID, error) { ...@@ -211,7 +211,7 @@ func (s *channelManager) TxData(l1Head eth.L1BlockRef) ([]byte, txID, error) {
return nil, txID{}, err return nil, txID{}, err
} }
s.pendingChannel.TriggerTimeout(l1Head.Time) s.triggerTimeout(l1Head)
if err := s.addBlocks(); err != nil { if err := s.addBlocks(); err != nil {
return nil, txID{}, err return nil, txID{}, err
...@@ -239,6 +239,16 @@ func (s *channelManager) ensurePendingChannel(l1Head eth.L1BlockRef) error { ...@@ -239,6 +239,16 @@ func (s *channelManager) ensurePendingChannel(l1Head eth.L1BlockRef) error {
return nil return nil
} }
func (s *channelManager) triggerTimeout(l1Head eth.L1BlockRef) {
s.pendingChannel.TriggerTimeout(l1Head.Time)
ferr := s.pendingChannel.FullErr()
s.log.Debug("timeout triggered",
"l1Head", l1Head,
"timed_out", errors.Is(ferr, ErrChannelTimedOut),
"full_reason", ferr,
)
}
// addBlocks adds blocks from the blocks queue to the pending channel until // addBlocks adds blocks from the blocks queue to the pending channel until
// either the queue got exhausted or the channel is full. // either the queue got exhausted or the channel is full.
func (s *channelManager) addBlocks() error { func (s *channelManager) addBlocks() error {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment