Skip to content
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion op-node/rollup/derive/attributes_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/ethereum-optimism/optimism/espresso"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"

"github.com/ethereum-optimism/optimism/op-node/rollup"
Expand Down Expand Up @@ -196,7 +197,18 @@ func (aq *AttributesQueue) NextAttributes(ctx context.Context, parent eth.L2Bloc
}
aq.batch = batch
aq.concluding = concluding
aq.log.Info("singular batch from op-node is ", "batch", aq.batch, "concluding", concluding)
// Log tx hashes instead of raw bytes, since hashes are compact whereas raw tx bytes can

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little nit: we can simplify this comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified! 23c8dd0

// be large and truncated by DataDog.
txHashes := make([]common.Hash, 0, len(aq.batch.Transactions))
for i, rawTx := range aq.batch.Transactions {
var tx types.Transaction
if err := tx.UnmarshalBinary(rawTx); err == nil {
txHashes = append(txHashes, tx.Hash())
} else {
aq.log.Warn("failed to unmarshal transaction", "index", i, "err", err)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could that not spam a lot of logs if there are errors?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wouldn't be too spammy since there would be just one log for each malformed transaction, but on second thought, it doesn't make much sense to log a malformed transaction anyway, so I've removed it!

}
Comment thread
shenkeyao marked this conversation as resolved.
}
aq.batch.LogContext(aq.log).Info("singular batch from op-node", "tx_hashes", txHashes, "concluding", concluding)
Comment thread
shenkeyao marked this conversation as resolved.
}

// Actually generate the next attributes
Expand Down
Loading