Skip to content

Conversation

@alexandrosfilios
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Nov 20, 2025

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
4441 4 4437 0
View the top 3 failed tests by shortest run time
TestVersion30
Stack Traces | 5.230s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
�[38;5;48;1myay!! we validated block 9 in 358.75ms�[0;0m
�[38;5;48;1myay!! we validated block 10 in 219.50ms�[0;0m
    precompile_inclusion_test.go:94: goroutine 610040 [running]:
        runtime/debug.Stack()
        	/opt/hostedtoolcache/go/1.25.5/x64/src/runtime/debug/stack.go:26 +0x5e
        github.com/offchainlabs/nitro/util/testhelpers.RequireImpl({0x40f1670, 0xc0943b7880}, {0x40aeda0, 0xc12242f020}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/util/testhelpers/testhelpers.go:29 +0x55
        github.com/offchainlabs/nitro/system_tests.Require(0xc0943b7880, {0x40aeda0, 0xc12242f020}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/system_tests/common_test.go:2003 +0x5d
        github.com/offchainlabs/nitro/system_tests.testPrecompiles(0xc0943b7880, 0x1e, {0xc0b9387db0, 0x6, 0xc0c89e6d00?})
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:94 +0x371
        github.com/offchainlabs/nitro/system_tests.TestVersion30(0xc0943b7880?)
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:67 +0x798
        testing.tRunner(0xc0943b7880, 0x3d31340)
        	/opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1934 +0xea
        created by testing.(*T).Run in goroutine 1
        	/opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1997 +0x465
        
    precompile_inclusion_test.go:94: �[31;1m [] execution aborted (timeout = 5s) �[0;0m
--- FAIL: TestVersion30 (5.23s)
TestVersion40
Stack Traces | 5.240s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
=== PAUSE TestVersion40
=== CONT  TestVersion40
    precompile_inclusion_test.go:94: goroutine 610041 [running]:
        runtime/debug.Stack()
        	/opt/hostedtoolcache/go/1.25.5/x64/src/runtime/debug/stack.go:26 +0x5e
        github.com/offchainlabs/nitro/util/testhelpers.RequireImpl({0x40f1670, 0xc0943b7a40}, {0x40aeda0, 0xc12242ef30}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/util/testhelpers/testhelpers.go:29 +0x55
        github.com/offchainlabs/nitro/system_tests.Require(0xc0943b7a40, {0x40aeda0, 0xc12242ef30}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/system_tests/common_test.go:2003 +0x5d
        github.com/offchainlabs/nitro/system_tests.testPrecompiles(0xc0943b7a40, 0x28, {0xc10adaddf8, 0x5, 0x39?})
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:94 +0x371
        github.com/offchainlabs/nitro/system_tests.TestVersion40(0xc0943b7a40?)
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:71 +0x64b
        testing.tRunner(0xc0943b7a40, 0x3d31348)
        	/opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1934 +0xea
        created by testing.(*T).Run in goroutine 1
        	/opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1997 +0x465
        
    precompile_inclusion_test.go:94: �[31;1m [] execution aborted (timeout = 5s) �[0;0m
--- FAIL: TestVersion40 (5.24s)
TestBidValidatorAuctioneerRedisStream
Stack Traces | 17.120s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
ERROR[12-19|10:50:02.774] Context closed, autonomous auctioneer shutting down
ERROR[12-19|10:50:02.774] Context closed, autonomous auctioneer shutting down
ERROR[12-19|10:50:02.775] Context closed, autonomous auctioneer shutting down
INFO [12-19|10:50:02.775] Context done while waiting redis streams to be ready, failed to start
INFO [12-19|10:50:02.775] Submitted transaction                    hash=0x204b8cfb3087451ec3fe50bf452913210658cf5bbda4d3caeb75f2eda268b3bc from=0x6B1F2BfB0a056a66979DcDbd4cC1E25c2cdC7947 nonce=0  recipient=0x57114058365b2054716Cbe97A110bD8280639C25 value=0
INFO [12-19|10:50:03.681] Starting work on payload                 id=0x03d46d83ca33f021
INFO [12-19|10:50:03.682] Updated payload                          id=0x03d46d83ca33f021                      number=18 hash=c78e9f..e7ff1c txs=1 withdrawals=0 gas=46490     fees=4.649e-08    root=81b822..41ffe1 elapsed="301.513µs"
INFO [12-19|10:50:03.682] Stopping work on payload                 id=0x03d46d83ca33f021                      reason=delivery
INFO [12-19|10:50:03.682] Imported new potential chain segment     number=18 hash=c78e9f..e7ff1c blocks=1 txs=1 mgas=0.046 elapsed="483.376µs" mgasps=96.178   triediffs=43.93KiB triedirty=0.00B
INFO [12-19|10:50:03.682] Chain head was updated                   number=18 hash=c78e9f..e7ff1c root=81b822..41ffe1 elapsed="38.302µs"
INFO [12-19|10:50:03.686] Starting work on payload                 id=0x03ecc81eabd66a75
INFO [12-19|10:50:03.686] Updated payload                          id=0x03ecc81eabd66a75                      number=18 hash=c7b930..e4a182 txs=1 withdrawals=0 gas=46490     fees=4.649e-08    root=d89e90..c88b24 elapsed="359.541µs"
INFO [12-19|10:50:03.686] Stopping work on payload                 id=0x03ecc81eabd66a75                      reason=delivery
INFO [12-19|10:50:03.686] Imported new potential chain segment     number=18 hash=c7b930..e4a182 blocks=1 txs=1 mgas=0.046 elapsed="451.874µs" mgasps=102.883  triediffs=44.86KiB triedirty=0.00B
INFO [12-19|10:50:03.687] Chain head was updated                   number=18 hash=c7b930..e4a182 root=d89e90..c88b24 elapsed="52.408µs"
INFO [12-19|10:50:03.688] Starting work on payload                 id=0x030fa8f0867c2a5e
INFO [12-19|10:50:03.688] Updated payload                          id=0x030fa8f0867c2a5e                      number=18 hash=82a586..c2ae02 txs=0 withdrawals=0 gas=0         fees=0            root=484dbe..2651c8 elapsed="55.283µs"
INFO [12-19|10:50:03.688] Stopping work on payload                 id=0x030fa8f0867c2a5e                      reason=delivery
INFO [12-19|10:50:03.688] Imported new potential chain segment     number=18 hash=82a586..c2ae02 blocks=1 txs=0 mgas=0.000 elapsed="166.592µs" mgasps=0.000    triediffs=38.06KiB triedirty=0.00B
INFO [12-19|10:50:03.688] Chain head was updated                   number=18 hash=82a586..c2ae02 root=484dbe..2651c8 elapsed="28.424µs"

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

@alexandrosfilios alexandrosfilios marked this pull request as ready for review November 20, 2025 14:04
@alexandrosfilios alexandrosfilios force-pushed the afilios/fix-expected-surplus branch from 64e9da2 to 6cb625f Compare November 20, 2025 14:04
} else {
// l1GasPrice can be zero because of roundings, hence backlogCost is calculated separately
backlogFee := big.NewInt(backlogCallDataUnits)
backlogFee.Mul(backlogFee, blobFeePerByte)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have enough context to understand this line change. Could you please add a brief description?

Copy link
Contributor

Choose a reason for hiding this comment

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

now I look at the entire computation and not sure I get it.

can you add a comment with the full computation for computing backlog cost here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! We want to capture two values: l1GasPrice and backlogCost. This is the code we had initially:

			blobFeePerByte, _ := s.parentChain.BlobFeePerByte(ctx, header)
			blobFeePerByte.Mul(blobFeePerByte, blobTxBlobGasPerBlob)
			blobFeePerByte.Div(blobFeePerByte, usableBytesInBlob)
			l1GasPrice = blobFeePerByte.Int64() / 16
			backlogCost = (backlogCallDataUnits * blobFeePerByte.Int64()) / 16

This means:

l1GasPrice = (blobFeePerByte * blobTxBlobGasPerBlob) / (usableBytesInBlob * 16)
backlogCost = backlogCallDataUnits * (blobFeePerByte * blobTxBlobGasPerBlob) / (usableBytesInBlob * 16)

The problem here was that we divide with usableBytesInBlob too early and because of rounding, the value of blobFeePerByte becomes zero. Then even if we multiply with backlogCallDataUnits, it will still stay zero. The solution here was to multiply with backlogCallDataUnits before we divide. The problem here was that I forgot a line that multiplied with blobFeePerByte (the intention was to use it there as, well, this is why I had even extracted it outside of the if else).

Copy link
Contributor

@tsahee tsahee left a comment

Choose a reason for hiding this comment

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

question

} else {
// l1GasPrice can be zero because of roundings, hence backlogCost is calculated separately
backlogFee := big.NewInt(backlogCallDataUnits)
backlogFee.Mul(backlogFee, blobFeePerByte)
Copy link
Contributor

Choose a reason for hiding this comment

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

now I look at the entire computation and not sure I get it.

can you add a comment with the full computation for computing backlog cost here?

@tsahee tsahee assigned alexandrosfilios and unassigned tsahee Nov 26, 2025
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 33.14%. Comparing base (5b59a1a) to head (d332244).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4038      +/-   ##
==========================================
- Coverage   33.35%   33.14%   -0.21%     
==========================================
  Files         453      453              
  Lines       55536    55537       +1     
==========================================
- Hits        18524    18409     -115     
- Misses      33774    33922     +148     
+ Partials     3238     3206      -32     

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