-
Notifications
You must be signed in to change notification settings - Fork 47
Prover tests for empty blocks #2443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Bug: Transaction List Nulls Cause Block Number ErrorsThe |
Bug: Block Number Calculation Incorrect for Non-Standard Genesis BlocksWhen |
Bug: Null Transaction Handling MismatchThe |
Bug: Test Initialization Order Causes Null ReferencesInstance fields (senderKeyPair, receivingAccount, storingNumber, logging, storing, reading) are initialized with references to chainConfig, but chainConfig is only initialized by the test framework after instance field initialization. This will cause these fields to use a null or uninitialized chainConfig, leading to NullPointerException or incorrect bytecode compilation. These fields should either be initialized lazily in a @beforeeach method or moved into the test methods themselves. |
testing/src/main/java/net/consensys/linea/testing/MultiBlockExecutionEnvironment.java
Outdated
Show resolved
Hide resolved
arithmetization/src/test/java/net/consensys/linea/zktracer/EmptyBlockTests.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/net/consensys/linea/testing/MultiBlockExecutionEnvironment.java
Outdated
Show resolved
Hide resolved
arithmetization/src/test/java/net/consensys/linea/zktracer/EmptyBlockTests.java
Show resolved
Hide resolved
|
Thanks for fixing the daily ref tests !! |
testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java
Show resolved
Hide resolved
testing/src/main/java/net/consensys/linea/testing/MultiBlockExecutionEnvironment.java
Outdated
Show resolved
Hide resolved
| null); | ||
| besuExecTools.executeTest(); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Early Exit Prevents Tracer Initialization
When runWithBesuNode is true, the run() method returns early without initializing the tracer field, leaving it null. Tests that call getHub() after running with Besu node will encounter a NullPointerException since getHub() returns tracer.getHub() and tracer is null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
testing/src/main/java/net/consensys/linea/testing/MultiBlockExecutionEnvironment.java
Show resolved
Hide resolved
arithmetization/src/test/java/net/consensys/linea/zktracer/EmptyBlockTests.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/net/consensys/linea/testing/MultiBlockExecutionEnvironment.java
Show resolved
Hide resolved
7a66335 to
5342cec
Compare
arithmetization/src/test/java/net/consensys/linea/zktracer/EmptyBlockTests.java
Fixed
Show fixed
Hide fixed
testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java
Show resolved
Hide resolved
testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java
Outdated
Show resolved
Hide resolved
testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java
Show resolved
Hide resolved
testing/src/main/java/net/consensys/linea/testing/BesuExecutionTools.java
Outdated
Show resolved
Hide resolved
dfadcae to
ca5ec51
Compare
arithmetization/src/test/java/net/consensys/linea/zktracer/EmptyBlockTests.java
Outdated
Show resolved
Hide resolved
ca5ec51 to
b8eca91
Compare
various configurations of empty / nonempty blocks, in particular E EEEE EEEN NEEN NEEE ENNE EENENE where E = empty block, N = nonempty block
testing/src/main/java/net/consensys/linea/testing/MultiBlockExecutionEnvironment.java
Outdated
Show resolved
Hide resolved
arithmetization/src/test/java/net/consensys/linea/zktracer/EmptyBlockTests.java
Outdated
Show resolved
Hide resolved
b8eca91 to
5f09e65
Compare
arithmetization/src/test/java/net/consensys/linea/zktracer/EmptyBlockTests.java
Outdated
Show resolved
Hide resolved
| .nonce(116) | ||
| .address(Address.fromHexStringStrict("0x1122334455667788990011223344556677889900")) | ||
| .code( | ||
| BytecodeCompiler.newProgram(chainConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Instance fields initialized before chainConfig is set
The instance fields receivingAccount, storingNumber, and logging use BytecodeCompiler.newProgram(chainConfig) during initialization, but chainConfig is a static field initialized in the parent class's @BeforeAll method. In JUnit 5, instance fields are initialized when the test class is instantiated, which occurs before @BeforeAll methods execute. This means chainConfig will be null when these fields are initialized, causing a NullPointerException when the tests run.
Additional Locations (2)
* feat: new tests state manager integration various configurations of empty / nonempty blocks, in particular E EEEE EEEN NEEN NEEE ENNE EENENE where E = empty block, N = nonempty block * feat: allow MultiBlock tests to run with Besu node * feat: allow for empty blocks in BesuNodeTests --------- Co-authored-by: amkCha <[email protected]>
Note
Adds parameterized empty-block test scenarios and Besu-backed execution support (with null-transaction handling), plus minor import and test-runner tweaks.
EmptyBlockTests: Refactor to parameterized tests covering multiple E/N block patterns; add@Execution(SAME_THREAD); introduceBlockTypeand helperbuilderFromBlockTypeList; allow running against Besu viarunWithBesuand validate logs only when not using Besu.BlockhashTest: Add@Execution(SAME_THREAD).MultiBlockExecutionEnvironment: AddrunWithBesuNodeoption; when enabled, translate empty blocks tonulltransactions and execute viaBesuExecutionTools(one tx per block); keep existing replay path otherwise.BesuExecutionTools: Accept and handlenulltransactions for empty blocks; add preconditions; adjust conflation tracing range for empty vs non-empty blocks; minor cleanup and state checks.OsakaUserTransaction: Update EIP-7825 gas limit cap import toTraceOsaka.Written by Cursor Bugbot for commit f5e8fd6. This will update automatically on new commits. Configure here.