Skip to content

Commit

Permalink
chore: add more logs to damgr and altda_data_source
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf authored and gastonponti committed Feb 11, 2025
1 parent 2fc43bd commit 6a2e742
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions op-alt-da/damgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ func (d *DA) fetchChallengeLogs(ctx context.Context, l1 L1Fetcher, block eth.Blo
}
for _, log := range rec.Logs {
if log.Address == d.cfg.DAChallengeContractAddress && len(log.Topics) > 0 && log.Topics[0] == ChallengeStatusEventABIHash {
d.log.Info("found challenge event", "block", block.Number, "log", log.Index)
logs = append(logs, log)
}
}
Expand Down
5 changes: 4 additions & 1 deletion op-node/rollup/derive/altda_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ func (s *AltDADataSource) Next(ctx context.Context) (eth.Data, error) {
// there is not commitment in the current origin.
if err := s.fetcher.AdvanceL1Origin(ctx, s.l1, s.id.ID()); err != nil {
if errors.Is(err, altda.ErrReorgRequired) {
s.log.Warn("reorg required, resetting altDA L1 origin", "origin", s.id)
return nil, NewResetError(errors.New("new expired challenge"))
}
s.log.Warn("failed to advance altDA L1 origin", "err", err)
return nil, NewTemporaryError(fmt.Errorf("failed to advance altDA L1 origin: %w", err))
}

Expand All @@ -58,6 +60,7 @@ func (s *AltDADataSource) Next(ctx context.Context) (eth.Data, error) {
// If the tx data type is not altDA, we forward it downstream to let the next
// steps validate and potentially parse it as L1 DA inputs.
if data[0] != params.DerivationVersion1 {
s.log.Info("forwarding downstream non altDA data", "version_byte", data[0])
return data, nil
}

Expand All @@ -79,7 +82,7 @@ func (s *AltDADataSource) Next(ctx context.Context) (eth.Data, error) {
return nil, NewResetError(err)
} else if errors.Is(err, altda.ErrExpiredChallenge) {
// this commitment was challenged and the challenge expired.
s.log.Warn("challenge expired, skipping batch", "comm", s.comm)
s.log.Warn("challenge expired, skipping batch", "comm", s.comm, "err", err)
s.comm = nil
// skip the input
return s.Next(ctx)
Expand Down

0 comments on commit 6a2e742

Please sign in to comment.