Skip to content

MEL fix number of batch posting reports check bug#4464

Open
ganeshvanahalli wants to merge 2 commits intomasterfrom
mel-batchpostingreport-bugfix
Open

MEL fix number of batch posting reports check bug#4464
ganeshvanahalli wants to merge 2 commits intomasterfrom
mel-batchpostingreport-bugfix

Conversation

@ganeshvanahalli
Copy link
Contributor

This PR fixes the bug where we previously compared the number of batch posting reports to number of batches for equality and that is not the case! As they need not be equal.

Resolves NIT-4540

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.00%. Comparing base (f9004e9) to head (577c6c4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4464      +/-   ##
==========================================
+ Coverage   32.92%   33.00%   +0.08%     
==========================================
  Files         493      493              
  Lines       58294    58298       +4     
==========================================
+ Hits        19193    19244      +51     
+ Misses      35768    35685      -83     
- Partials     3333     3369      +36     

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

❌ 7 Tests Failed:

Tests completed Failed Passed Skipped
4241 7 4234 0
View the top 3 failed tests by shortest run time
TestRedisProduceComplex/one_producer,_all_consumers_are_active
Stack Traces | 1.230s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
�[36mDEBUG�[0m[03-05|19:07:48.205] consumer: xdel                           �[36mcid�[0m=0b397a35-6d56-4af0-b970-71a3b1c9c57e �[36mmessageId�[0m=1772737667084-8
�[36mDEBUG�[0m[03-05|19:07:48.205] consumer: xdel                           �[36mcid�[0m=9a23a8dc-2ea8-48d2-8f6f-478f8dbc7aba �[36mmessageId�[0m=1772737667082-10
�[36mDEBUG�[0m[03-05|19:07:48.205] Redis stream consuming                   �[36mconsumer_id�[0m=52df7d86-0256-4074-8008-d1c7f3ff0717 �[36mmessage_id�[0m=1772737667084-9
�[36mDEBUG�[0m[03-05|19:07:48.205] consumer: setting result                 �[36mcid�[0m=52df7d86-0256-4074-8008-d1c7f3ff0717 �[36mmsgIdInStream�[0m=1772737667084-9  �[36mresultKeyInRedis�[0m=result-key:stream:56c7eaf2-7bab-45f9-908d-d6056f68bfe5.1772737667084-9
�[36mDEBUG�[0m[03-05|19:07:48.205] Redis stream consuming                   �[36mconsumer_id�[0m=647fef38-20b6-4881-af2b-2e0a0a6a46b6 �[36mmessage_id�[0m=1772737667084-5
�[36mDEBUG�[0m[03-05|19:07:48.205] consumer: xack                           �[36mcid�[0m=52df7d86-0256-4074-8008-d1c7f3ff0717 �[36mmessageId�[0m=1772737667084-9
�[36mDEBUG�[0m[03-05|19:07:48.205] consumer: setting result                 �[36mcid�[0m=647fef38-20b6-4881-af2b-2e0a0a6a46b6 �[36mmsgIdInStream�[0m=1772737667084-5  �[36mresultKeyInRedis�[0m=result-key:stream:56c7eaf2-7bab-45f9-908d-d6056f68bfe5.1772737667084-5
�[36mDEBUG�[0m[03-05|19:07:48.205] consumer: xdel                           �[36mcid�[0m=52df7d86-0256-4074-8008-d1c7f3ff0717 �[36mmessageId�[0m=1772737667084-9
�[36mDEBUG�[0m[03-05|19:07:48.205] consumer: xack                           �[36mcid�[0m=647fef38-20b6-4881-af2b-2e0a0a6a46b6 �[36mmessageId�[0m=1772737667084-5
�[36mDEBUG�[0m[03-05|19:07:48.206] consumer: xdel                           �[36mcid�[0m=647fef38-20b6-4881-af2b-2e0a0a6a46b6 �[36mmessageId�[0m=1772737667084-5
�[36mDEBUG�[0m[03-05|19:07:48.206] consumer: xdel                           �[36mcid�[0m=ab97f172-50dc-4302-b1c6-92b32959e76f �[36mmessageId�[0m=1772737667082-0
�[36mDEBUG�[0m[03-05|19:07:48.207] consumer: xack                           �[36mcid�[0m=01f11239-30cc-4430-b843-58998c0b631d �[36mmessageId�[0m=1772737667082-4
�[33mWARN �[0m[03-05|19:07:48.207] XClaimJustID returned empty response when indicating heartbeat �[33mmsgID�[0m=1772737667082-7
�[33mWARN �[0m[03-05|19:07:48.207] XClaimJustID returned empty response when indicating heartbeat �[33mmsgID�[0m=1772737667082-8
�[33mWARN �[0m[03-05|19:07:48.207] XClaimJustID returned empty response when indicating heartbeat �[33mmsgID�[0m=1772737667082-6
�[33mWARN �[0m[03-05|19:07:48.207] XClaimJustID returned empty response when indicating heartbeat �[33mmsgID�[0m=1772737667082-5
�[36mDEBUG�[0m[03-05|19:07:48.207] consumer: xdel                           �[36mcid�[0m=01f11239-30cc-4430-b843-58998c0b631d �[36mmessageId�[0m=1772737667082-4
�[36mDEBUG�[0m[03-05|19:07:48.217] checkResponses                           �[36mresponded�[0m=26 �[36merrored�[0m=0 �[36mchecked�[0m=100
�[36mDEBUG�[0m[03-05|19:07:48.224] redis producer: check responses starting
--- FAIL: TestRedisProduceComplex/one_producer,_all_consumers_are_active (1.23s)
TestSequencerPriceAdjustsFrom25Gwei
Stack Traces | 7.370s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [03-05|19:19:39.230] 
INFO [03-05|19:19:39.230] Post-Merge hard forks (timestamp based):
INFO [03-05|19:19:39.230]  - Shanghai:                    @0         
INFO [03-05|19:19:39.230]  - Cancun:                      @0          blob: (target: 3, max: 6, fraction: 3338477)
INFO [03-05|19:19:39.230]  - Prague:                      @0          blob: (target: 6, max: 9, fraction: 5007716)
INFO [03-05|19:19:39.230]  - Osaka:                       @0          blob: (target: 6, max: 9, fraction: 5007716)
INFO [03-05|19:19:39.230] 
INFO [03-05|19:19:39.230] All fork specifications can be found at https://ethereum.github.io/execution-specs/src/ethereum/forks/
INFO [03-05|19:19:39.230] 
INFO [03-05|19:19:39.230] ---------------------------------------------------------------------------------------------------------------------------------------------------------
INFO [03-05|19:19:39.230] 
INFO [03-05|19:19:39.230] Loaded most recent local block           number=0   hash=8e4045..936bd5 age=56y11mo3w
INFO [03-05|19:19:39.230] Initialized transaction indexer          range="last 2350000 blocks"
INFO [03-05|19:19:39.231] Submitted transaction                    hash=0x658a3b33238a4f9981c298032f3d621b57e623adc25c3fd4f6c8aa4956a2ce09 from=0xb386a74Dcab67b66F8AC07B4f08365d37495Dd23 nonce=8   recipient=0x38FaF545434Fce9935A024c1f2d5E8DC4ccA6bb7 value=0
INFO [03-05|19:19:39.232] DataPoster sent transaction              nonce=8   hash=658a3b..a2ce09 feeCap=4,947,590,750  tipCap=50,000,000    blobFeeCap=<nil> gas=154,341
INFO [03-05|19:19:39.232] BatchPoster: batch sent                  sequenceNumber=9   from=14  to=15  prevDelayed=5   currentDelayed=5   totalSegments=3  numBlobs=0
INFO [03-05|19:19:39.232] Submitted transaction                    hash=0x19c3bae94bfc34504052aa3fe5f300e6830e8d00ec9138d664d1acf81085bdba from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=161 recipient=0x7E23C8862920797d81916d62c274dd9217113e28 value=1,000,000,000,000
INFO [03-05|19:19:39.232] ExecutionEngine: Added DelayedMessages   msgIdx=187 delayedMsgIdx=85  block-header="&{ParentHash:0x2eeedc7d12f8ecc6ec3b0d0bfb9cee44005907e6e33c02befae93e829ed657ae UncleHash:0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 Coinbase:0xE02b66224449E89337236911c45B540Db868f692 Root:0x27c33d7c57b9283d0f90ef2a94761dab3a7ba3e46100124f48b59f4a7399d782 TxHash:0x5b5a04dceda82578ec60fbca04bc1addddc77cfb17cd41c7b7c9afe5a77ccd8a ReceiptHash:0xf08cf5553e1dae52e3df19b356b8320e17c39fb055f635739c31052db5c3e45e Bloom:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] Difficulty:+1 Number:+187 GasLimit:1125899906842624 GasUsed:0 Time:1772738501 Extra:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] MixDigest:0x000000000000000000000000000000a800000000000000330000000000000000 Nonce:[0 0 0 0 0 0 0 86] BaseFee:+100000000 WithdrawalsHash:<nil> BlobGasUsed:<nil> ExcessBlobGas:<nil> ParentBeaconRoot:<nil> RequestsHash:<nil>}"
INFO [03-05|19:19:39.233] Starting work on payload                 id=0x03b22d437c2c3f0f
INFO [03-05|19:19:39.233] Starting work on payload                 id=0x03d721a4ea078385
TestVersion40
Stack Traces | 9.450s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
        created by testing.(*T).Run in goroutine 1
        	/opt/hostedtoolcache/go/1.25.7/x64/src/testing/testing.go:1997 +0x465
        
    precompile_inclusion_test.go:94: �[31;1m [] execution aborted (timeout = 5s) �[0;0m
INFO [03-05|19:14:34.302] Submitted transaction                    hash=0x9dbca82b53a80835cd77a5b533e25cd7bf419058a995bdeb518d4055d63fae4b from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=28  recipient=0xA02062aa4Cb0872315ACA3eA6dBF077d90B2DAC1 value=0
INFO [03-05|19:14:34.303] Submitted contract creation              hash=0x35ad308421e21ec63c3c024dd16ea089162d220126a8d29b63efdf301e876423 from=0x57Ff0F473737a1c161bfF9efDF016F7991585088 nonce=18  contract=0x548c9E48e32748F36CD0265E6e6359e20c2432FA value=0
INFO [03-05|19:14:34.306] InboxTracker                             sequencerBatchCount=7  messageCount=59 l1Block=37 l1Timestamp=2026-03-05T19:14:33+0000
INFO [03-05|19:14:34.307] Deploying user logic contracts
INFO [03-05|19:14:34.310] InboxTracker                             sequencerBatchCount=7  messageCount=7  l1Block=35 l1Timestamp=2026-03-05T19:14:33+0000
INFO [03-05|19:14:34.310] Submitted transaction                    hash=0x11634608b5d36e59105987b662d479fe6b7714b97fe64d06320c53a51e78fe31 from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=178 recipient=0x38Be091519c255cE6edFa70181676a479c114D2a value=10,000,000,000,000,000
INFO [03-05|19:14:34.312] Writing cached state to disk             block=1  hash=a0ce30..8b8cd5 root=8448b4..050cee
INFO [03-05|19:14:34.312] Persisted trie from memory database      nodes=20  flushnodes=0 size=3.26KiB   flushsize=0.00B time="136.696µs" flushtime=0s gcnodes=0 gcsize=0.00B gctime="1.664µs"   livenodes=0    livesize=0.00B
INFO [03-05|19:14:34.312] Writing cached state to disk             block=1  hash=a0ce30..8b8cd5 root=8448b4..050cee
INFO [03-05|19:14:34.312] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time=892ns       flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s          livenodes=0    livesize=0.00B
INFO [03-05|19:14:34.312] Writing snapshot state to disk           root=6b754c..7398ca
INFO [03-05|19:14:34.312] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time="1.031µs"   flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s          livenodes=0    livesize=0.00B
INFO [03-05|19:14:34.313] Blockchain stopped
INFO [03-05|19:14:34.314] Submitted transaction                    hash=0x886e1ce31a87f46f75cb689c1fbea6f3be7d6eab7287d283ec49dbbce93f6707 from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=29  recipient=0x457b1BA688E9854BDbed2f473F7510C476A3dA09 value=0
INFO [03-05|19:14:34.314] New Key                                  name=User177          Address=0x8E56695932337b0D1c4fb908D10b373c29231CE2
--- FAIL: TestVersion40 (9.45s)

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

@rauljordan rauljordan assigned eljobe and unassigned rauljordan Mar 5, 2026
batch.SequenceNumber,
)
if gotHash != batchPostReportBatchHash {
continue
Copy link
Member

Choose a reason for hiding this comment

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

From Claude:

  1. No test coverage for the core bugfix scenario

File: arbnode/mel/extraction/message_extraction_function_test.go

There is no test with multiple batches where only a subset have matching reports (e.g., 3 batches, 1 report). The "OK" test uses exactly 1 batch and 1 report — still a 1:1 match. The continue path is
never exercised in a success scenario. The existing "mismatched hash" test only passes by accident because the post-loop validation fires before the panic.

  1. Post-loop validation (line 207) is effectively dead code for the panic case

File: arbnode/mel/extraction/message_extraction_function.go:207-213

The validation len(batchPostingReports) != batchPostReportIndex was designed to catch unprocessed reports, but due to the critical bug above, the code panics before reaching this check whenever continue
fires.

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.

5 participants