Skip to content

singular batch from op-node is log without the transaction info#392

Merged
shenkeyao merged 7 commits intocelo-integration-rebase-16.2from
keyao/add-tx-info
Apr 6, 2026
Merged

singular batch from op-node is log without the transaction info#392
shenkeyao merged 7 commits intocelo-integration-rebase-16.2from
keyao/add-tx-info

Conversation

@shenkeyao
Copy link
Copy Markdown
Member

Closes https://app.asana.com/1/1208976916964769/project/1209976130071762/task/1212148617379345?focus=true.

This PR:

  • Adds transaction hashes to the batcher log.
  • Simplifies the log call.

This PR does not:

  • Change other logged fields.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 2, 2026

Claude finished @shenkeyao's task in 1m 9s —— View job


Code Review: PR #392

  • Gather context and read changes
  • Review code quality, security, performance
  • Post review feedback

Overall: Looks good. The change is clean and well-motivated — logging tx hashes instead of raw bytes is the right call for both readability and avoiding DataDog truncation.

A few observations:

  1. Good use of LogContext — switching from manually passing "batch", aq.batch to aq.batch.LogContext(aq.log) is a nice improvement. It provides structured batch metadata (type, timestamp, parent hash, epoch, tx count) instead of dumping the whole struct.

  2. Silent unmarshal failures — left an inline comment. If UnmarshalBinary ever fails, the hash is silently dropped, which could make debugging harder. A warning log would help surface this.

  3. No tests — understandable for a logging-only change, no action needed.

Comment thread op-node/rollup/derive/attributes_queue.go
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the logging mechanism in AttributesQueue.NextAttributes to log transaction hashes instead of raw transaction bytes, aiming to prevent log truncation in external aggregators. A review comment highlights concerns regarding the performance overhead of RLP decoding within the derivation pipeline's hot path and notes that silently skipping malformed transactions could result in inconsistent or misleading log data.

Comment thread op-node/rollup/derive/attributes_queue.go
Copy link
Copy Markdown
Member

@jjeangal jjeangal left a comment

Choose a reason for hiding this comment

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

Little comments but fine to approve

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

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!

@shenkeyao shenkeyao merged commit 8fd7cec into celo-integration-rebase-16.2 Apr 6, 2026
50 of 51 checks passed
@shenkeyao shenkeyao deleted the keyao/add-tx-info branch April 6, 2026 19:09
QuentinI pushed a commit that referenced this pull request Apr 9, 2026
* Add log

* Add hashes

* Update op-node/rollup/derive/attributes_queue.go

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* Fix lint

* Simplify comment, remove malformed tx log

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants