Skip to content

Add exhaustive initialization lint to DelayedInboxMessage#4589

Closed
cats2101 wants to merge 1 commit intoOffchainLabs:masterfrom
cats2101:fix/exhaustive-init-delayed-inbox-message
Closed

Add exhaustive initialization lint to DelayedInboxMessage#4589
cats2101 wants to merge 1 commit intoOffchainLabs:masterfrom
cats2101:fix/exhaustive-init-delayed-inbox-message

Conversation

@cats2101
Copy link
Copy Markdown

@cats2101 cats2101 commented Apr 1, 2026

Summary

  • Annotate DelayedInboxMessage with // lint:require-exhaustive-initialization
  • Update all initialization sites across production code and tests to explicitly set all four fields (BlockHash, BeforeInboxAcc, Message, ParentChainBlockNumber)
  • One struct per PR as recommended in Use the struct-initialization linter more #3121

Changes

Annotation added:

  • arbnode/mel/messages.goDelayedInboxMessage struct

Production code fix:

  • arbnode/inbox_tracker.go — added missing BlockHash field

Test fixes (added missing zero-value fields):

  • arbnode/delayed_seq_reorg_test.go — 9 init sites, added ParentChainBlockNumber
  • arbnode/mel/extraction/delayed_message_lookup_test.go — 2 init sites
  • arbnode/mel/extraction/message_extraction_function_test.go — 2 init sites
  • arbnode/mel/extraction/messages_in_batch_test.go — 3 init sites (+ added common import)
  • arbnode/mel/runner/backlog_test.go — 1 init site (file deleted upstream)
  • arbnode/mel/runner/database_test.go — 2 init sites
  • arbnode/mel/runner/mel_test.go — 1 init site
  • mel-replay/merkle_tree_fetcher_test.go — 1 init site (file deleted upstream)
  • mel-replay/delayed_message_db_test.go — 1 init site

Test plan

  • go test ./linters/structinit/ passes
  • make lint (requires full build environment with solgen)
  • make test on affected packages

Closes #3121

Annotate DelayedInboxMessage with lint:require-exhaustive-initialization
and update all initialization sites to explicitly set all four fields
(BlockHash, BeforeInboxAcc, Message, ParentChainBlockNumber).

Closes OffchainLabs#3121
@cats2101 cats2101 force-pushed the fix/exhaustive-init-delayed-inbox-message branch from d3dfd80 to 8b038fe Compare April 3, 2026 14:03
@rauljordan rauljordan added the trivial Adding this tag auto-closes trivial PRs politely. label Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Thank you for your contribution. However, this PR has been automatically closed because it was labeled as trivial. As stated in our CONTRIBUTING.md:


Important

Please, do not send pull requests for trivial changes; these will be rejected.
These types of pull requests incur a cost to reviewers and do not provide much value to the project.
If you are unsure, please open an issue first to discuss the change.
Here are some examples of trivial PRs that will most-likely be rejected:

  • Fixing typos
  • AI-generated code
  • Refactors that don't improve usability

We appreciate meaningful contributions!

@github-actions github-actions bot closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trivial Adding this tag auto-closes trivial PRs politely.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use the struct-initialization linter more

3 participants