Skip to content

Conversation

@bragaigor
Copy link
Contributor

Updates ProgramPrepare to accept wasm instead of statedb and code.

Closes NIT-4407

debugInt = 1
}

wasm, err := getWasm(statedb, programAddress, params)
Copy link
Contributor Author

@bragaigor bragaigor Jan 28, 2026

Choose a reason for hiding this comment

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

we could use getWasmFromContractCode which is called by getWasm. My concern comes from this comment:

// addressForLogging may be empty or may not correspond to the code, so we need to be careful to use the code passed in separately
wasm, err := getWasmFromContractCode(statedb, code, params, false)

Copy link
Member

@KolbyML KolbyML Jan 28, 2026

Choose a reason for hiding this comment

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

If we used getWasmFromContractCode make sure the isActivation flag is set to true, because handle is only used in ethCall? so it is simulating contract activation?, other than that for the potential edgecase you are presenting, I trust your judgement

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.82%. Comparing base (db29e55) to head (dc0f425).

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4284       +/-   ##
===========================================
- Coverage   57.12%   32.82%   -24.31%     
===========================================
  Files         476      476               
  Lines       56785    56785               
===========================================
- Hits        32441    18638    -13803     
- Misses      19506    34877    +15371     
+ Partials     4838     3270     -1568     

@github-actions
Copy link
Contributor

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
4074 6 4068 0
View the top 3 failed tests by shortest run time
TestDataStreaming_PositiveScenario/Many_senders,_long_messages
Stack Traces | 0.120s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
        github.com/offchainlabs/nitro/daprovider/data_streaming.testBasic.func1()
        	/home/runner/work/nitro/nitro/daprovider/data_streaming/protocol_test.go:230 +0x19b
        created by github.com/offchainlabs/nitro/daprovider/data_streaming.testBasic in goroutine 247
        	/home/runner/work/nitro/nitro/daprovider/data_streaming/protocol_test.go:223 +0x85
        
    protocol_test.go:230: �[31;1m [] too much time has elapsed since request was signed �[0;0m
WARN [01-28|15:53:14.038] Served datastreaming_start               conn=127.0.0.1:40922 reqid=8 duration="131.776µs" err="too much time has elapsed since request was signed"
INFO [01-28|15:53:14.039] rpc response                             method=datastreaming_start logId=8  err="too much time has elapsed since request was signed" result={} attempt=0 args="[\"0x697a30e9\", \"0x2b\", \"0xd9\", \"0x2406\", \"0xa\", \"0xdb2eab5e518d55cf14cd3c2becc9d43ee078f8d7e3337fcacf3d1e4c9e7ed93d4bf36e3f1c481191c6a7be388d4465bf833da2f5c7e4eb4daf00d2b230d45eb000\"]" errorData=null
    protocol_test.go:230: goroutine 274 [running]:
        runtime/debug.Stack()
        	/opt/hostedtoolcache/go/1.25.6/x64/src/runtime/debug/stack.go:26 +0x5e
        github.com/offchainlabs/nitro/util/testhelpers.RequireImpl({0x161f870, 0xc000483880}, {0x16060c0, 0xc000e04e40}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/util/testhelpers/testhelpers.go:29 +0x9f
        github.com/offchainlabs/nitro/daprovider/data_streaming.testBasic.func1()
        	/home/runner/work/nitro/nitro/daprovider/data_streaming/protocol_test.go:230 +0x19b
        created by github.com/offchainlabs/nitro/daprovider/data_streaming.testBasic in goroutine 247
        	/home/runner/work/nitro/nitro/daprovider/data_streaming/protocol_test.go:223 +0x85
        
    protocol_test.go:230: �[31;1m [] too much time has elapsed since request was signed �[0;0m
--- FAIL: TestDataStreaming_PositiveScenario/Many_senders,_long_messages (0.12s)
TestDataStreaming_PositiveScenario
Stack Traces | 0.160s run time
=== RUN   TestDataStreaming_PositiveScenario
--- FAIL: TestDataStreaming_PositiveScenario (0.16s)
TestValidationInputsAtWithWasmTarget
Stack Traces | 3.130s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [01-28|16:01:52.005] Submitted transaction                    hash=0x3d8c057622d7a3a23c901469f63ad165cdf12cbbeddd0bc9c29eb50a6e6226a1 from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=5  recipient=0x0000000000000000000000000000000000000071 value=1,000,000,000,000,000,000
INFO [01-28|16:01:52.005] Stopping work on payload                 id=0x03d2fafe1ecfb45d reason=delivery
INFO [01-28|16:01:52.006] Imported new potential chain segment     number=4  hash=8c4c38..62a4d6 blocks=1  txs=1  mgas=4.765 elapsed=2.212ms     mgasps=2154.025 triediffs=12.23KiB  triedirty=0.00B
INFO [01-28|16:01:52.007] Chain head was updated                   number=4  hash=8c4c38..62a4d6 root=d6028d..ba41f0 elapsed="392.143µs"
WARN [01-28|16:01:52.007] Served eth_getTransactionReceipt         reqid=8   duration="23.914µs"  err="transaction indexing is in progress" errdata="\"transaction indexing is in progress\""
INFO [01-28|16:01:52.007] Persisted dirty state to disk            size=133.94KiB elapsed=4.392ms
WARN [01-28|16:01:52.008] error getting gas price                  err="context canceled"
WARN [01-28|16:01:52.008] error getting latest block               err="context canceled"
�[90mTime to activate multicall: 171.558532ms�[0;0m
�[90mwasm multicall deployed at 0xA02062aa4Cb0872315ACA3eA6dBF077d90B2DAC1�[0;0m
WARN [01-28|16:01:52.008] error acting as staker                   err="error getting latest staked node of own wallet 0x0000000000000000000000000000000000000000: context canceled"
INFO [01-28|16:01:52.008] Blockchain stopped
INFO [01-28|16:01:52.009] HTTP server stopped                      endpoint=127.0.0.1:42431
TRACE[01-28|16:01:52.009] P2P networking is spinning down
INFO [01-28|16:01:52.009] Writing cached state to disk             block=7 hash=875560..d8416b root=bbb9e2..89d4b5
INFO [01-28|16:01:52.009] Submitted transaction                    hash=0x776b6b9c0b3ce1715b9ce90cba7213fdb8d83f610d64b507690fabd51e33204d from=0x26E554a8acF9003b83495c7f45F06edCB803d4e3 nonce=7  recipient=0x0000000000000000000000000000000000000071 value=1,000,000,000,000,000,000
INFO [01-28|16:01:52.010] New Key                                  name=Faucet        Address=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A
INFO [01-28|16:01:52.010] New Key                                  name=RollupOwner   Address=0x57Ff0F473737a1c161bfF9efDF016F7991585088
INFO [01-28|16:01:52.010] New Key                                  name=Sequencer     Address=0xb386a74Dcab67b66F8AC07B4f08365d37495Dd23
--- FAIL: TestValidationInputsAtWithWasmTarget (3.13s)

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

@bragaigor bragaigor marked this pull request as ready for review January 28, 2026 17:11
Copy link
Member

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

:shipit: looks good

debugInt = 1
}

wasm, err := getWasm(statedb, programAddress, params)
Copy link
Member

@KolbyML KolbyML Jan 28, 2026

Choose a reason for hiding this comment

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

If we used getWasmFromContractCode make sure the isActivation flag is set to true, because handle is only used in ethCall? so it is simulating contract activation?, other than that for the potential edgecase you are presenting, I trust your judgement

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.

4 participants