feat(flashblocks): improve test coverage for revamped flashblocks RPC layer#239
feat(flashblocks): improve test coverage for revamped flashblocks RPC layer#239brendontan03 wants to merge 3 commits intoniven/cleanup-flashblocks-rpcfrom
Conversation
sieniven
left a comment
There was a problem hiding this comment.
@brendontan03 Take a look at the latest commit on the revamp PR - bb05216. Lets also add unit test coverage on the flashblocks sequence validator (flashblocks/src/execution/validator.rs) to validate that the the executed block outputs matches the default payload validator executed block outputs.
You can use the helper debug function to do a full state comparison. Perhaps we can run on a few test cases:
- Block with legacy transactions
- Block with multiple ERC20 transactions
- Block with a tx that calls the selfdestruct opcode
- Block with some initial ERC20 transactions, then a tx that calls the selfdestruct opcode, then somemore transactions
|
@claude review the tests added in the PR.
|
|
Claude finished @sieniven's task in 2m 55s —— View job Code Review: Flashblocks Test CoverageTasks:
1. Cache Unit Tests (
|
| Area | Severity | Issue |
|---|---|---|
| Cache | Critical | target_index > 0 promotion path has no coverage |
| Cache | Medium | test_get_tx_info tests 3 behaviors; split required |
| Cache | Medium | get_block_by_hash confirm fallback not tested |
| Cache | Medium | get_rpc_block(Number(n)) path not tested |
| Cache | Low | get_executed_blocks target > confirm+1 guard untested |
| Cache | Low | Missing assert_eq!(confirm_height, 4) in eviction test |
| E2E | Critical | Low-latency (pending) property is not actually tested |
| E2E | Medium | fb_smoke_test violates single responsibility |
| E2E | Medium | eth_sendRawTransactionSync sync semantics unverified |
| E2E | Low | Flaky startup assertion on block tx count |
| E2E | Low | eth_getRawTransactionByBlockNumberAndIndex hits canonical, not flashblocks |
Summary
This PR improves test coverage for the revamped flashblocks RPC layer #176 to prevent regressions and verify new functionality.
Tests
FlashblockStateCacheInnerandFlashblockStateCachewhich guarantees the caching and eviction mechanism works as expected.