Skip to content

Add exhaustive initialization lint to DelayedInboxMessage#4589

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

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 20+ 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
  • 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
  • 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
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.

Use the struct-initialization linter more

2 participants